From: Ben Beltran Date: Mon, 13 May 2013 16:09:25 +0000 (-0500) Subject: Proper nows now X-Git-Tag: v1.1.0~29 X-Git-Url: https://git.r.bdr.sh/rbdr/cologne/commitdiff_plain/adc1a8da06f8af4c06a311ca459de4dcf379f5fd?hp=e16e2dbf4c0911a5d5e8d1d56bb1c674b37fc161 Proper nows now --- diff --git a/lib/cobalt.js b/lib/cobalt.js index 58a305c..17e6948 100644 --- a/lib/cobalt.js +++ b/lib/cobalt.js @@ -239,7 +239,15 @@ // Returns the current time in microseconds. now : function () { - this.constructor.now(); + if (typeof performance !== 'undefined' && performance.timing) { + return performance.timing.navigationStart + performance.now(); + } + + if (typeof Microtime !== 'undefined') { + return Microtime.nowDouble() * 1000; + } + + return Date.now(); }, _levelString : function (level) { diff --git a/package.json b/package.json index c384de4..ca81d08 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "url" : "http://github.com/ktlacaelel" } ], - "version" : "0.1.5", + "version" : "0.1.6", "dependencies" : { "neon" : "1.0.x", "socket.io" : "0.9.x",