OLD | NEW |
| (Empty) |
1 // This code was auto-generated, is not intended to be edited, and is subject to | |
2 // significant change. Please see the README file for more information. | |
3 library engine.utilities.general; | |
4 import 'java_core.dart'; | |
5 /** | |
6 * Helper for measuring how much time is spent doing some operation. | |
7 */ | |
8 class TimeCounter { | |
9 int result = 0; | |
10 | |
11 /** | |
12 * Starts counting time. | |
13 * | |
14 * @return the [TimeCounterHandle] that should be used to stop counting. | |
15 */ | |
16 TimeCounter_TimeCounterHandle start() => new TimeCounter_TimeCounterHandle(thi
s); | |
17 } | |
18 /** | |
19 * The handle object that should be used to stop and update counter. | |
20 */ | |
21 class TimeCounter_TimeCounterHandle { | |
22 final TimeCounter TimeCounter_this; | |
23 int _startTime = JavaSystem.currentTimeMillis(); | |
24 TimeCounter_TimeCounterHandle(this.TimeCounter_this); | |
25 | |
26 /** | |
27 * Stops counting time and updates counter. | |
28 */ | |
29 void stop() { | |
30 { | |
31 TimeCounter_this.result += JavaSystem.currentTimeMillis() - _startTime; | |
32 } | |
33 } | |
34 } | |
OLD | NEW |