diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-06-13 15:30:21 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-07-04 22:14:09 +0200 |
commit | b016745e489afb6ac1eb0f14afdf56aeec36469e (patch) | |
tree | 0967453eb1a1160ff8893d73e76a6df41c5f050f /doc/api/console.md | |
parent | 7951e6d26b2c2036a8d6dbb92b395f9e15d90e14 (diff) | |
download | android-node-v8-b016745e489afb6ac1eb0f14afdf56aeec36469e.tar.gz android-node-v8-b016745e489afb6ac1eb0f14afdf56aeec36469e.tar.bz2 android-node-v8-b016745e489afb6ac1eb0f14afdf56aeec36469e.zip |
console: implement timeLog method
Refs: https://github.com/whatwg/console/pull/138
PR-URL: https://github.com/nodejs/node/pull/21312
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/console.md')
-rw-r--r-- | doc/api/console.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/api/console.md b/doc/api/console.md index 6c63a4ffb5..95801c31fe 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -413,6 +413,25 @@ console.timeEnd('100-elements'); // prints 100-elements: 225.438ms ``` +### console.timeLog([label][, ...data]) +<!-- YAML +added: REPLACEME +--> +* `label` {string} **Default:** `'default'` +* `...data` {any} + +For a timer that was previously started by calling [`console.time()`][], prints +the elapsed time and other `data` arguments to `stdout`: + +```js +console.time('process'); +const value = expensiveProcess1(); // Returns 42 +console.timeLog('process', value); +// Prints "process: 365.227ms 42". +doExpensiveProcess2(value); +console.timeEnd('process'); +``` + ### console.trace([message][, ...args]) <!-- YAML added: v0.1.104 |