From 1a1288d03ca9f84cc720dd6740acd36d85ae457a 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 Backport-PR-URL: https://github.com/nodejs/node/pull/22380 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 c1ca15718dc5d4..4a1eeaf98199ec 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