| 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 // A utility object for measuring time intervals. | 5 // A utility object for measuring time intervals. |
| 6 | 6 |
| 7 class Interval { | 7 class Interval { |
| 8 int _start, _stop; | 8 int _start, _stop; |
| 9 | 9 |
| 10 Interval() { | 10 Interval() { |
| 11 } | 11 } |
| 12 | 12 |
| 13 void start() { | 13 void start() { |
| 14 _start = BenchUtil.now; | 14 _start = BenchUtil.now; |
| 15 } | 15 } |
| 16 | 16 |
| 17 void stop() { | 17 void stop() { |
| 18 _stop = BenchUtil.now; | 18 _stop = BenchUtil.now; |
| 19 } | 19 } |
| 20 | 20 |
| 21 // Microseconds from between start() and stop(). | 21 // Microseconds from between start() and stop(). |
| 22 int get elapsedMicrosec() { | 22 int get elapsedMicrosec { |
| 23 return (_stop - _start) * 1000; | 23 return (_stop - _start) * 1000; |
| 24 } | 24 } |
| 25 | 25 |
| 26 // Milliseconds from between start() and stop(). | 26 // Milliseconds from between start() and stop(). |
| 27 int get elapsedMillisec() { | 27 int get elapsedMillisec { |
| 28 return (_stop - _start); | 28 return (_stop - _start); |
| 29 } | 29 } |
| 30 } | 30 } |
| OLD | NEW |