aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/cobalt.js10
1 files changed, 9 insertions, 1 deletions
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) {