diff options
author | Micha Hanselmann <deermichel@github.com> | 2019-07-25 01:34:33 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-07-28 08:51:10 +0300 |
commit | 35cb9558658e587d98b6d83bfd2b1642ba2cc8c2 (patch) | |
tree | b45b715d8f882c1a1cf3279168898d1c00e21d2d /src/node.cc | |
parent | 41fa5536d179e86540756c78f7794bbd697c8697 (diff) |
src: move relative uptime init
PR-URL: https://github.com/nodejs/node/pull/28849
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'src/node.cc')
-rw-r--r-- | src/node.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node.cc b/src/node.cc index d20a7cfe91c..82128eb22ab 100644 --- a/src/node.cc +++ b/src/node.cc @@ -782,6 +782,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* 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); |