diff options
| author | Ben Beltran <ben@freshout.us> | 2013-04-05 13:22:08 -0600 |
|---|---|---|
| committer | Ben Beltran <ben@freshout.us> | 2013-04-05 13:22:08 -0600 |
| commit | 9f9564be72fe27b823713f6e104343c4affadb42 (patch) | |
| tree | 77a0838bbfb68bb06495acd7fb5cc5d2d2b0c767 | |
| parent | faf177fa8ddb796858f4397749c83db9386b3c5c (diff) | |
Add microtime, because hrtime() wasn't right
| -rw-r--r-- | lib/cobalt.js | 5 | ||||
| -rw-r--r-- | package.json | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/cobalt.js b/lib/cobalt.js index c832c7f..771c9c7 100644 --- a/lib/cobalt.js +++ b/lib/cobalt.js @@ -6,6 +6,7 @@ var Ne = require('neon'); Module = Ne.Module; Class = Ne.Class; + var Microtime = require('microtime'); } else { Module = global.Module; Class = global.Class; @@ -207,8 +208,8 @@ return performance.timing.navigationStart + performance.now(); } - if (typeof process !== 'undefined') { - return process.hrtime(); + if (typeof Microtime !== 'undefined') { + return Microtime.nowDouble() * 1000; } return Date.now(); diff --git a/package.json b/package.json index 3d9017b..d79810e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "dependencies" : { "neon" : "1.0.x", "socket.io" : "0.9.x", - "colors" : "0.x.x" + "colors" : "0.x.x", + "microtime" : "0.3.x" }, "engines" : { "node" : ">= 0.8.0" }, "main" : "./lib/cobalt.js", |