From d719db2c185bdafd9cc33595e202a589594432f2 Mon Sep 17 00:00:00 2001 From: Micha Hanselmann Date: Wed, 24 Jul 2019 15:34:33 -0700 Subject: [PATCH] src: move relative uptime init --- src/node.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index d20a7cfe91cc8c..82128eb22aba66 100644 --- a/src/node.cc +++ b/src/node.cc @@ -782,6 +782,9 @@ int InitializeNodeWithArgs(std::vector* argv, // Make sure InitializeNodeWithArgs() is called only once. CHECK(!init_called.exchange(true)); + // Initialize node_start_time to get relative uptime. + per_process::node_start_time = uv_hrtime(); + // Register built-in modules binding::RegisterBuiltinModules(); @@ -961,7 +964,6 @@ void Init(int* argc, InitializationResult InitializeOncePerProcess(int argc, char** argv) { atexit(ResetStdio); PlatformInit(); - per_process::node_start_time = uv_hrtime(); CHECK_GT(argc, 0);