console.timeEnd([label])
Stops
a timer that was previously started by calling console.time() and prints the
result to stdout.
/* Start the timer */ console.time('100000-elements'); for (let i = 0; i < 100000; i++) { } /* End the timer */ console.timeEnd('100000-elements');
Output
100000-elements:
3.242ms
Points to note
a. Elapsed time is
printed in milliseconds.
b. Timers are identified
by a unique label. In our example, '100000-elements' is the label.
No comments:
Post a Comment