Skip to content
Permalink
Browse files

src: move relative uptime init

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 Jul 24, 2019
1 parent f6051f9 commit 8db43b1ff5ebcbf47d8b69858cf14318a9d5c9b5
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/node.cc
@@ -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();

@@ -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);

0 comments on commit 8db43b1

Please sign in to comment.
You can’t perform that action at this time.