-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
console: sub-millisecond accuracy for console.time #3166
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
Merged
+21
−20
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
doc: reword description of console.time
PR-URL: #3166 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
- Loading branch information
commit fc72a578e6ecbc31ae305b479ab8c5824b949482
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,16 +74,16 @@ Defaults to `false`. Colors are customizable, see below. | |
|
|
||
| ### console.time(label) | ||
|
|
||
| Used to calculate the duration of a specific operation. To start a timer, call | ||
| the `console.time()` method, giving it a name as only parameter. To stop the | ||
| timer, and to get the elapsed time in milliseconds, just call the | ||
| [`console.timeEnd()`](#console_console_timeend_label) method, again passing the | ||
| timer's name as the parameter. | ||
| Starts a timer that can be used to compute the duration of an operation. Timers | ||
| are identified by a unique name. Use the same name when you call | ||
| [`console.timeEnd()`](#console_console_timeend_label) to stop the timer and | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this break refs?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw, this change is not directly related to this PR. |
||
| output the elapsed time in milliseconds. Timer durations are accurate to the | ||
| sub-millisecond. | ||
|
|
||
| ### console.timeEnd(label) | ||
|
|
||
| Stops a timer that was previously started by calling | ||
| [`console.time()`](#console_console_time_label) and print the result to the | ||
| [`console.time()`](#console_console_time_label) and prints the result to the | ||
| console. | ||
|
|
||
| Example: | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe call the parameter
timerNameto be in line with mdn?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same could be done in code, maybe as a seperate commit too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done