node.js中的console.timeEnd方法使用说明
2014-12-09 09:11
856 查看
方法说明:
完成时间,执行 console.time 到 console.timeEnd 之间所花费的时间。
语法:
复制代码 代码如下:console.timeEnd(label)
接收参数:
Label 与开始时间 console.log 的 label 对应
例子:
复制代码 代码如下:console.time('100-elements');
for (var i = 0; i < 100; i++) {
;
}
console.timeEnd('100-elements');
源码:
复制代码 代码如下: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);
};
您可能感兴趣的文章:
相关文章推荐
- node.js中的console.timeEnd方法使用说明
- node.js中的console.time方法使用说明
- node.js中的console.time方法使用说明
- node.js中的console.assert方法使用说明
- node.js中的http.request.end方法使用说明
- node.js中的http.response.end方法使用说明
- node.js中的console.log方法使用说明
- node.js中的console.dir方法使用说明
- node.js中的console.dir方法使用说明
- node.js中的console.error方法使用说明
- node.js中的console.warn方法使用说明
- node.js中的console.trace方法使用说明
- node.js中的http.request.end方法使用说明
- node.js中的console.info方法使用说明
- node.js中的console.info方法使用说明
- node.js中的console.error方法使用说明
- node.js中的console.trace方法使用说明
- node.js中的console.log方法使用说明
- node.js中的console.warn方法使用说明
- node.js中的http.response.end方法使用说明