Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: sdk/lib/_internal/lib/core_patch.dart

Issue 345873003: Update timer and adjust frequency. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cache stopwatch work. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/lib/core_patch.dart
diff --git a/sdk/lib/_internal/lib/core_patch.dart b/sdk/lib/_internal/lib/core_patch.dart
index 38e4f4f97dba19e514a102ee2707445e1030616e..b6f538ffec9700b8d3e709384b5d42b256ae2fce 100644
--- a/sdk/lib/_internal/lib/core_patch.dart
+++ b/sdk/lib/_internal/lib/core_patch.dart
@@ -219,9 +219,13 @@ class DateTime {
@patch
class Stopwatch {
@patch
- static int _frequency() => 1000000;
+ static void _initTicker() {
+ Primitives.initTicker();
+ _frequency = Primitives.timerFrequency;
+ }
+
@patch
- static int _now() => Primitives.numMicroseconds();
+ static int _now() => Primitives.timerTicks();
}
class _ListConstructorSentinel extends JSInt {

Powered by Google App Engine
This is Rietveld 408576698