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

Make docs for console.time and console.timeEnd more complete #198

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions doc/api/console.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,19 @@ Defaults to `false`. Colors are customizable, see below.

## console.time(label)

Mark a time.
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 miliseconds, just call the
[`console.timeEnd()`](#console_console_timeend_label) method, again passing the
timer's name as the parameter.

## console.timeEnd(label)

Finish timer, record output. Example:
Stops a timer that was previously started by calling
[`console.time()`](#console_console_time_label) and print the result to the
console.

Example:

console.time('100-elements');
for (var i = 0; i < 100; i++) {
Expand Down