summaryrefslogtreecommitdiff
path: root/lib/console.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/console.js')
-rw-r--r--lib/console.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/console.js b/lib/console.js
index 646e268624..2359cb36e0 100644
--- a/lib/console.js
+++ b/lib/console.js
@@ -67,9 +67,10 @@ Console.prototype.time = function(label) {
Console.prototype.timeEnd = function(label) {
- var time = this._times.get(label);
+ const time = this._times.get(label);
if (!time) {
- throw new Error(`No such label: ${label}`);
+ process.emitWarning(`No such label '${label}' for console.timeEnd()`);
+ return;
}
const duration = process.hrtime(time);
const ms = duration[0] * 1000 + duration[1] / 1e6;