diff --git a/src/node.cc b/src/node.cc index 084fe900cd35d4..49da1bef446400 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1949,10 +1949,10 @@ static void Uptime(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); double uptime; - uv_update_time(env->event_loop()); - uptime = uv_now(env->event_loop()) - prog_start_time; + uv_uptime(&uptime); + uptime -= prog_start_time; - args.GetReturnValue().Set(Number::New(env->isolate(), uptime / 1000)); + args.GetReturnValue().Set(Number::New(env->isolate(), uptime)); } @@ -3620,7 +3620,7 @@ void Init(int* argc, int* exec_argc, const char*** exec_argv) { // Initialize prog_start_time to get relative uptime. - prog_start_time = static_cast(uv_now(uv_default_loop())); + uv_uptime(&prog_start_time); // Make inherited handles noninheritable. uv_disable_stdio_inheritance();