Method description:
Complete time, the time it takes to execute console.time to console.timeEnd.
grammar:
The code copy is as follows:
console.timeEnd(label)
Receive parameters:
Label corresponds to label of start time console.log
example:
The code copy is as follows:
console.time('100-elements');
for (var i = 0; i < 100; i++) {
;
}
console.timeEnd('100-elements');
Source code:
The code copy is as follows:
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);
};