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);
};
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn