Skip to content

Commit

Permalink
src: move relative uptime init
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
Micha Hanselmann authored and Trott committed Jul 28, 2019
1 parent 41fa553 commit 35cb955
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 35cb955

Please sign in to comment.