Home > Web Front-end > JS Tutorial > Instructions for using the console.time method in node.js_node.js

Instructions for using the console.time method in node.js_node.js

WBOY
Release: 2016-05-16 16:28:03
Original
1391 people have browsed it

Method description:

Start time, corresponding to console.timeEnd, recording time period.

Grammar:

Copy code The code is as follows:

console.time(label)

Receive parameters:

Label corresponds to the label of console.log at the start time

Example:

Copy code The code is as follows:

console.time('100-elements');
for (var i = 0; i < 100; i ) {
;
}
console.timeEnd('100-elements');

Source code:

Copy code The code is as follows:

Console.prototype.time = function(label) {
This._times[label] = Date.now();
};
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template