node js 获取程序执行时间 time timeEnd
node js 获取程序执行时间 time timeEnd
示例代码:
function getFunRunTime(){
    console.time('test');
    let temp;
    for (let index = 0; index < 10000; index++) {
        temp += index
    }
    // time和timeEnd的参数要相同
    console.timeEnd('test');
}
getFunRunTime();
控制台输出:
test: 0.384765625ms
作者:孟繁贵 Email:meng010387@126.com 期待共同进步!

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号