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 targos committed Aug 2, 2019
1 parent f6051f9 commit 8db43b1
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 @@ -734,6 +734,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 @@ -913,7 +916,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 8db43b1

Please sign in to comment.