From 9383c33ad0c2afa331d16d9aa88b2eea905c98bc Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 25 Feb 2018 14:26:22 -0800 Subject: [PATCH] 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 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Anatoli Papirovski --- doc/api/perf_hooks.md | 31 +++++---- lib/perf_hooks.js | 52 +++++++++------ src/node_perf.cc | 35 ++++++++++ src/node_perf.h | 8 ++- src/node_perf_common.h | 6 +- test/parallel/test-performance.js | 102 ++++++++++++++++++++++++------ 6 files changed, 182 insertions(+), 52 deletions(-) diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index 4e31a247859550..98cc41276a4122 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