Skip to content

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

Description

@ben-page
  • 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

  1. added
    consoleIssues and PRs related to the console subsystem.
    on Apr 28, 2016
  2. cjihrig commented on Apr 28, 2016

    @cjihrig
    Contributor

    Care to open a documentation PR?

  3. added
    docIssues and PRs related to Node.js documentation.
    on Apr 28, 2016
  4. whitlockjc commented on Apr 28, 2016

    @whitlockjc
    Contributor

    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.

  5. self-assigned this
    on Apr 28, 2016
  6. ben-page commented on Apr 28, 2016

    @ben-page
    ContributorAuthor

    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?

  7. whitlockjc commented on Apr 28, 2016

    @whitlockjc
    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.

  8. jasnell commented on Apr 30, 2016

    @jasnell
    Member

    Fix landed in #6454

  9. added
    docIssues and PRs related to Node.js documentation.
    and removed
    docIssues and PRs related to Node.js documentation.
    on Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

consoleIssues and PRs related to the console subsystem.docIssues and PRs related to Node.js documentation.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions