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