From 28880cf89d5a5c1be19d5c7260bba88d600cff49 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 5bef91eafb7603..27bcc8bf99e829 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