Index: sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
index 161ebf1e5b89006302e41c8adcff9c1744840a3d..0557c8a4855bdc4f8361ae928a847381ec2a3d2f 100644 |
--- a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart |
@@ -535,6 +535,17 @@ class Primitives { |
static num dateNow() => JS('num', r'Date.now()'); |
+ static num numMicroseconds() { |
+ if (JS('bool', 'typeof window != "undefined" && window !== null')) { |
+ var performance = JS('var', 'window.performance'); |
+ if (performance != null && |
+ JS('bool', 'typeof #.webkitNow == "function"', performance)) { |
+ return (1000 * JS('num', '#.webkitNow()', performance)).floor(); |
Emily Fortuna
2012/11/26 23:31:31
This is the line that's different. The key thing I
|
+ } |
+ } |
+ return 1000 * dateNow(); |
+ } |
+ |
// This is to avoid stack overflows due to very large argument arrays in |
// apply(). It fixes http://dartbug.com/6919 |
static String _fromCharCodeApply(List<int> array) { |