Closed
Description
- Version: v6.0.0
- Platform: Windows 10 x64
- Subsystem: console
_Description_
On node < 6 you could call timeEnd() multiple times for the same label to receive the current elapsed time. This no longer works in node v6.
This is a side effect of this pull request #3562, which fixed timers being leaked. This change completely makes sense, but it also removes (probably unintended) functionality. Should this change be in the documentation?
_Example_
console.time('timer');
setTimeout(function() {
console.timeEnd('timer');
}, 10);
setTimeout(function() {
console.timeEnd('timer');
}, 20);output on node v5.9.1
timer: 11.898ms
timer: 20.454ms
output on node v6.0.0
timer: 11.111ms
(node:33232) Warning: No such label 'timer' for console.timeEnd()
Activity
cjihrig commentedon Apr 28, 2016
Care to open a documentation PR?
whitlockjc commentedon Apr 28, 2016
I agree it should be documented even though the way things worked prior to
v6.0.0was by accident. If @ben-page doesn't want to do the PR, I will.Assigning to myself.
ben-page commentedon Apr 28, 2016
I'd be happy to. I'm not certain of the appropriate format for documenting API changes. Is there an example in the docs you could point me to?
whitlockjc commentedon Apr 28, 2016
This is a really good read: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md Make sure you look at the suggested Git commit log message. Also, here is a randomly picked
doccommit that made it through the review process: 31de5cc Please let us know if we can clear anything else up or if you need assistance.jasnell commentedon Apr 30, 2016
Fix landed in #6454