一、输出当前函数的执行时间
二、代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="title">111111111</div>
<script>
function getSum() {
console.time('计时器1')
for(var i = 0; i < 100; i++) {
console.log(i)
}
console.timeEnd('计时器1')
}
getSum()
</script>
</body>
</html>