| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart.core; | 5 part of dart.core; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A simple stopwatch interface to measure elapsed time. | 8 * A simple stopwatch interface to measure elapsed time. |
| 9 */ | 9 */ |
| 10 class Stopwatch { | 10 class Stopwatch { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 /** | 127 /** |
| 128 * Returns wether the [StopWatch] is currently running. | 128 * Returns wether the [StopWatch] is currently running. |
| 129 */ | 129 */ |
| 130 bool get isRunning => _start != null && _stop == null; | 130 bool get isRunning => _start != null && _stop == null; |
| 131 | 131 |
| 132 /** | 132 /** |
| 133 * Cached frequency of the system. Must be initialized in [_initTicker]; | 133 * Cached frequency of the system. Must be initialized in [_initTicker]; |
| 134 */ | 134 */ |
| 135 static int _frequency; | 135 static int _frequency; |
| 136 | 136 |
| 137 @patch | 137 /** |
| 138 * Initializes the time-measuring system. *Must* initialize the [_frequency] |
| 139 * variable. |
| 140 */ |
| 138 static void _initTicker() { | 141 static void _initTicker() { |
| 139 Primitives.initTicker(); | 142 Primitives.initTicker(); |
| 140 _frequency = Primitives.timerFrequency; | 143 _frequency = Primitives.timerFrequency; |
| 141 } | 144 } |
| 142 @patch | |
| 143 static int _now() => Primitives.timerTicks(); | 145 static int _now() => Primitives.timerTicks(); |
| 144 } | 146 } |
| OLD | NEW |