开发喵星球

NODE.JS计算一段程序执行时间

代码:
console.time('test')
var sum = 0
for (i = 0; i < 100000; i++) {
sum += i
}
console.log(sum)
console.timeEnd('test')

输出:
4999950000
test: 15.122ms
[Finished in 0.1s]

   
分类:Node.js 作者:开发喵 发表于:2020-04-07 02:41:29 阅读量:1200
<<   >>


powered by kaifamiao