获取js函数执行时间
作者:互联网
一、输出当前函数的执行时间
二、代码
<!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>
标签:111111111,console,函数,js,获取,getSum,计时器,Document 来源: https://blog.csdn.net/Jack_13201/article/details/119320520