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