| 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 |
| 4 library engine.utilities.general; | 4 library engine.utilities.general; |
| 5 | 5 |
| 6 import 'java_core.dart'; | 6 import 'java_core.dart'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Helper for measuring how much time is spent doing some operation. | 9 * Helper for measuring how much time is spent doing some operation. |
| 10 */ | 10 */ |
| 11 class TimeCounter { | 11 class TimeCounter { |
| 12 int result = 0; | 12 int _result = 0; |
| 13 |
| 14 /** |
| 15 * @return the number of milliseconds spent between [start] and [stop]. |
| 16 */ |
| 17 int get result => _result; |
| 13 | 18 |
| 14 /** | 19 /** |
| 15 * Starts counting time. | 20 * Starts counting time. |
| 16 * | 21 * |
| 17 * @return the [TimeCounterHandle] that should be used to stop counting. | 22 * @return the [TimeCounterHandle] that should be used to stop counting. |
| 18 */ | 23 */ |
| 19 TimeCounter_TimeCounterHandle start() => new TimeCounter_TimeCounterHandle(thi
s); | 24 TimeCounter_TimeCounterHandle start() => new TimeCounter_TimeCounterHandle(thi
s); |
| 20 } | 25 } |
| 21 | 26 |
| 22 /** | 27 /** |
| 23 * The handle object that should be used to stop and update counter. | 28 * The handle object that should be used to stop and update counter. |
| 24 */ | 29 */ |
| 25 class TimeCounter_TimeCounterHandle { | 30 class TimeCounter_TimeCounterHandle { |
| 26 final TimeCounter TimeCounter_this; | 31 final TimeCounter TimeCounter_this; |
| 27 | 32 |
| 28 int _startTime = JavaSystem.currentTimeMillis(); | 33 int _startTime = JavaSystem.currentTimeMillis(); |
| 29 | 34 |
| 30 TimeCounter_TimeCounterHandle(this.TimeCounter_this); | 35 TimeCounter_TimeCounterHandle(this.TimeCounter_this); |
| 31 | 36 |
| 32 /** | 37 /** |
| 33 * Stops counting time and updates counter. | 38 * Stops counting time and updates counter. |
| 34 */ | 39 */ |
| 35 void stop() { | 40 void stop() { |
| 36 { | 41 { |
| 37 TimeCounter_this.result += JavaSystem.currentTimeMillis() - _startTime; | 42 TimeCounter_this._result += JavaSystem.currentTimeMillis() - _startTime; |
| 38 } | 43 } |
| 39 } | 44 } |
| 40 } | 45 } |
| OLD | NEW |