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

Unified Diff: runtime/lib/stopwatch_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
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/core_patch.dart » ('j') | sdk/lib/core/stopwatch.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/stopwatch_patch.dart
diff --git a/runtime/lib/stopwatch_patch.dart b/runtime/lib/stopwatch_patch.dart
index 2bdc2c531b01b6d4a8305400e393aaea3b8f2d19..e16005cab8652c6477803310a6e76e47eca74406 100644
--- a/runtime/lib/stopwatch_patch.dart
+++ b/runtime/lib/stopwatch_patch.dart
@@ -5,9 +5,15 @@
// A VM patch of the stopwatch part of dart:core.
patch class Stopwatch {
+ /* patch */ static void _initTicker() {
+ if (_frequency == null) {
+ _frequency = _computeFrequency();
+ }
+ }
+
// Returns the current clock tick.
/* patch */ static int _now() native "Stopwatch_now";
// Returns the frequency of clock ticks in Hz.
- /* patch */ static int _frequency() native "Stopwatch_frequency";
+ static int _computeFrequency() native "Stopwatch_frequency";
}
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/core_patch.dart » ('j') | sdk/lib/core/stopwatch.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698