Home > Web Front-end > JS Tutorial > body text

node.js中的console.time方法使用说明_node.js

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

方法说明:

开始时间,与console.timeEnd对应,记录时间段。

语法:

复制代码 代码如下:

console.time(label)

接收参数:

Label             与开始时间 console.log 的 label 对应

例子:

复制代码 代码如下:

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

源码:

复制代码 代码如下:

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!