📜  time js 代码 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:03.060000             🧑  作者: Mango

代码示例4
// Start your timer
let time1 = performance.now();
// Perform your Loop
for (let i = 0; i <= 10; i++) {
     console.log(i); 
}
// End your timer
let time2 = performance.now()
// Log the time it took to complete
console.log(`Your loop took ${time1 - time2} milleseconds`);