console.timeLog([label][, ...data])
对于先前通过调用 console.time()
启动的计时器,将经过时间和其他 data
参数打印到 stdout
:
console.time('process');
const value = expensiveProcess1(); // 返回 42
console.timeLog('process', value);
// 打印 "process: 365.227ms 42"
doExpensiveProcess2(value);
console.timeEnd('process');
For a timer that was previously started by calling console.time()
, prints
the elapsed time and other data
arguments to stdout
:
console.time('process');
const value = expensiveProcess1(); // Returns 42
console.timeLog('process', value);
// Prints "process: 365.227ms 42".
doExpensiveProcess2(value);
console.timeEnd('process');