Method description:
Completion time, the time spent between executing console.time and console.timeEnd.
Grammar:
console.timeEnd(label)
Receive parameters:
Label corresponds to the label of console.log at the start time
Example:
console.time('100-elements');
for (var i = 0; i < 100; i ) {
;
}
console.timeEnd('100-elements');
Source code:
Console.prototype.timeEnd = function(label) {
var time = this._times[label];
if (!time) {
Throw new Error('No such label: ' label);
}
var duration = Date.now() - time;
This.log('%s: %dms', label, duration);
};