Method description:
The start time, corresponding to console.timeEnd, records the time period.
grammar:
The code copy is as follows:
console.time(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.time = function(label) {
this._times[label] = Date.now();
};