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