From: Ben Beltran Date: Fri, 5 Apr 2013 19:22:08 +0000 (-0600) Subject: Add microtime, because hrtime() wasn't right X-Git-Url: https://git.r.bdr.sh/rbdr/cologne/commitdiff_plain/9f9564be72fe27b823713f6e104343c4affadb42?ds=sidebyside;hp=--cc Add microtime, because hrtime() wasn't right --- 9f9564be72fe27b823713f6e104343c4affadb42 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",