Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 510 Bytes

File metadata and controls

19 lines (13 loc) · 510 Bytes

Measure JavaScript Execution Time

Category: JavaScript

You can measure how long a call takes in JavaScript using timer methods.

For example:

console.time("some-operation");
callSomeFunction ();
console.timeLog("some-operation");
anotherFunction () ;
console.timeEnd("some-operation");

Output for timers is in seconds/milliseconds and timeLog will show the time in seconds since the timer was started.

Each timer should be given a unique label to differentiate from other timers.