Created
March 25, 2014 20:32
-
-
Save tjfontaine/9770725 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/node.cc b/src/node.cc | |
index ac906f0..82ce0b2 100644 | |
--- a/src/node.cc | |
+++ b/src/node.cc | |
@@ -1714,13 +1714,10 @@ static Handle<Value> Uptime(const Arguments& args) { | |
HandleScope scope; | |
double uptime; | |
- uv_err_t err = uv_uptime(&uptime); | |
+ uv_update_time(uv_default_loop()); | |
+ uptime = uv_now(uv_default_loop()); | |
- if (err.code != UV_OK) { | |
- return Undefined(); | |
- } | |
- | |
- return scope.Close(Number::New(uptime - prog_start_time)); | |
+ return scope.Close(Number::New((uptime - prog_start_time) / 1000)); | |
} | |
@@ -2893,7 +2890,7 @@ static Handle<Value> DebugEnd(const Arguments& args) { | |
char** Init(int argc, char *argv[]) { | |
// Initialize prog_start_time to get relative uptime. | |
- uv_uptime(&prog_start_time); | |
+ prog_start_time = uv_now(uv_default_loop()); | |
// Make inherited handles noninheritable. | |
uv_disable_stdio_inheritance(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment