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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • 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.