Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2018-02-26 01:26:22 +0300
committerJames M Snell <jasnell@gmail.com>2018-03-06 18:50:01 +0300
commit9256dbb6115021fb69d5ccc2af0f7e27b0601007 (patch)
tree9127d1ce78731e3ff76f21517fb5c2b0162b0636 /doc/api/perf_hooks.md
parentad721429c02a086373d841206927718048d6b521 (diff)
perf_hooks: fix timing
Fixes: https://github.com/nodejs/node/issues/17892 Fixes: https://github.com/nodejs/node/issues/17893 Fixes: https://github.com/nodejs/node/issues/18992 PR-URL: https://github.com/nodejs/node/pull/18993 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'doc/api/perf_hooks.md')
-rw-r--r--doc/api/perf_hooks.md31
1 files changed, 20 insertions, 11 deletions
diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md
index 4e31a247859..98cc41276a4 100644
--- a/doc/api/perf_hooks.md
+++ b/doc/api/perf_hooks.md
@@ -181,7 +181,8 @@ added: v8.5.0
* Returns: {number}
-Returns the current high resolution millisecond timestamp.
+Returns the current high resolution millisecond timestamp, where 0 represents
+the start of the current `node` process.
### performance.timeOrigin
<!-- YAML
@@ -190,8 +191,8 @@ added: v8.5.0
* {number}
-The [`timeOrigin`][] specifies the high resolution millisecond timestamp from
-which all performance metric durations are measured.
+The [`timeOrigin`][] specifies the high resolution millisecond timestamp at
+which the current `node` process began, measured in Unix time.
### performance.timerify(fn)
<!-- YAML
@@ -302,7 +303,8 @@ added: v8.5.0
* {number}
The high resolution millisecond timestamp at which the Node.js process
-completed bootstrap.
+completed bootstrapping. If bootstrapping has not yet finished, the property
+has the value of -1.
### performanceNodeTiming.clusterSetupEnd
<!-- YAML
@@ -311,7 +313,8 @@ added: v8.5.0
* {number}
-The high resolution millisecond timestamp at which cluster processing ended.
+The high resolution millisecond timestamp at which cluster processing ended. If
+cluster processing has not yet ended, the property has the value of -1.
### performanceNodeTiming.clusterSetupStart
<!-- YAML
@@ -321,6 +324,7 @@ added: v8.5.0
* {number}
The high resolution millisecond timestamp at which cluster processing started.
+If cluster processing has not yet started, the property has the value of -1.
### performanceNodeTiming.loopExit
<!-- YAML
@@ -330,7 +334,8 @@ added: v8.5.0
* {number}
The high resolution millisecond timestamp at which the Node.js event loop
-exited.
+exited. If the event loop has not yet exited, the property has the value of -1.
+It can only have a value of not -1 in a handler of the [`'exit'`][] event.
### performanceNodeTiming.loopStart
<!-- YAML
@@ -340,7 +345,8 @@ added: v8.5.0
* {number}
The high resolution millisecond timestamp at which the Node.js event loop
-started.
+started. If the event loop has not yet started (e.g., in the first tick of the
+main script), the property has the value of -1.
### performanceNodeTiming.moduleLoadEnd
<!-- YAML
@@ -395,8 +401,9 @@ added: v8.5.0
* {number}
-The high resolution millisecond timestamp at which third_party_main processing
-ended.
+The high resolution millisecond timestamp at which third\_party\_main
+processing ended. If third\_party\_main processing has not yet ended, the
+property has the value of -1.
### performanceNodeTiming.thirdPartyMainStart
<!-- YAML
@@ -405,8 +412,9 @@ added: v8.5.0
* {number}
-The high resolution millisecond timestamp at which third_party_main processing
-started.
+The high resolution millisecond timestamp at which third\_party\_main
+processing started. If third\_party\_main processing has not yet started, the
+property has the value of -1.
### performanceNodeTiming.v8Start
<!-- YAML
@@ -642,6 +650,7 @@ obs.observe({ entryTypes: ['function'], buffered: true });
require('some-module');
```
+[`'exit'`]: process.html#process_event_exit
[`timeOrigin`]: https://w3c.github.io/hr-time/#dom-performance-timeorigin
[Async Hooks]: async_hooks.html
[W3C Performance Timeline]: https://w3c.github.io/performance-timeline/