mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
console: throw when no such label exists in console.timeEnd
Test included.
This commit is contained in:
1 parent
3bcbd14bb1
commit
77c18d1e1b
2 files changed
+14
-1
No files matched your search
+5
-1
@@ -49,7 +49,11 @@ exports.time = function(label) {
|
||||
|
||||
|
||||
exports.timeEnd = function(label) {
|
||||
var duration = Date.now() - times[label];
|
||||
var time = times[label];
|
||||
if (!time) {
|
||||
throw new Error('No such label: ' + label);
|
||||
}
|
||||
var duration = Date.now() - time;
|
||||
exports.log('%s: %dms', label, duration);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user