Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undocumented console.timeEnd() change in 6.x #6452

Closed
ben-page opened this issue Apr 28, 2016 · 5 comments
Closed

undocumented console.timeEnd() change in 6.x #6452

ben-page opened this issue Apr 28, 2016 · 5 comments
Assignees
Labels
console Issues and PRs related to the console subsystem. doc Issues and PRs related to the documentations.

Comments

@ben-page
Copy link
Contributor

ben-page commented Apr 28, 2016

  • 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()
@addaleax addaleax added the console Issues and PRs related to the console subsystem. label Apr 28, 2016
@cjihrig
Copy link
Contributor

cjihrig commented Apr 28, 2016

Care to open a documentation PR?

@cjihrig cjihrig added the doc Issues and PRs related to the documentations. label Apr 28, 2016
@whitlockjc
Copy link
Contributor

whitlockjc commented Apr 28, 2016

I agree it should be documented even though the way things worked prior to v6.0.0 was by accident. If @ben-page doesn't want to do the PR, I will.

Assigning to myself.

@whitlockjc whitlockjc self-assigned this Apr 28, 2016
@ben-page
Copy link
Contributor Author

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
Copy link
Contributor

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 doc commit 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
Copy link
Member

jasnell commented Apr 30, 2016

Fix landed in #6454

@jasnell jasnell closed this as completed Apr 30, 2016
@sam-github sam-github added doc Issues and PRs related to the documentations. and removed doc Issues and PRs related to the documentations. labels Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
console Issues and PRs related to the console subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

No branches or pull requests

6 participants