]> git.r.bdr.sh - rbdr/cologne/commitdiff
Proper nows now
authorBen Beltran <redacted>
Mon, 13 May 2013 16:09:25 +0000 (11:09 -0500)
committerBen Beltran <redacted>
Mon, 13 May 2013 16:09:25 +0000 (11:09 -0500)
lib/cobalt.js
package.json

index 58a305c156a4306b4b19520ca2544e23a73de6b5..17e694864606a70694840543ae9ab1ffa2f61c3e 100644 (file)
 
       // 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) {
index c384de4c66a1d86c82bb7a8fdad93029e1ff725d..ca81d0897f7f7196939302f8f5c3358226232de6 100644 (file)
@@ -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",