summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoman Reiss <me@silverwind.io>2015-10-29 20:22:12 +0100
committerRoman Reiss <me@silverwind.io>2015-11-10 15:37:06 +0100
commit9aee2c0e26a493337ddccb94a2ce891e58c3547b (patch)
treeb2cb46811fc52ba2c757ed67dce8ab8c31edadb0 /lib
parent1bacf37ef8317bda7f2d0b1188956294cdc3987d (diff)
downloadnode-new-9aee2c0e26a493337ddccb94a2ce891e58c3547b.tar.gz
console: use 'label' argument for time and timeEnd
Turns out the argument is actually called label in the console spec, while being wrongly named on MDN. This reverts commit 8c043c12456d9b5a500f9cefcca27a61a1a381cf. MDN has been updated in: https://developer.mozilla.org/en-US/docs/Web/API/Console/timeEnd$compare?locale=en-US&to=947893&from=918571 https://developer.mozilla.org/en-US/docs/Web/API/Console/time$compare?locale=en-US&to=947891&from=896987 PR-URL: https://github.com/nodejs/node/pull/3590 Reviewed-By: targos - Michaƫl Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/console.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/console.js b/lib/console.js
index d2b4f3fc5b..531a383876 100644
--- a/lib/console.js
+++ b/lib/console.js
@@ -55,19 +55,19 @@ Console.prototype.dir = function(object, options) {
};
-Console.prototype.time = function(timerName) {
- this._times.set(timerName, process.hrtime());
+Console.prototype.time = function(label) {
+ this._times.set(label, process.hrtime());
};
-Console.prototype.timeEnd = function(timerName) {
- var time = this._times.get(timerName);
+Console.prototype.timeEnd = function(label) {
+ var time = this._times.get(label);
if (!time) {
- throw new Error('No such timer name: ' + timerName);
+ throw new Error('No such label: ' + label);
}
const duration = process.hrtime(time);
const ms = duration[0] * 1000 + duration[1] / 1e6;
- this.log('%s: %sms', timerName, ms.toFixed(3));
+ this.log('%s: %sms', label, ms.toFixed(3));
};