blob: 635668127d09d5d060dde652dc552f99dfd76e80 [file] [log] [blame]
import 'dart:async';
void main() {
throw 'Unimplemented';
}
var _tickCount = 0;
Timer? _timer;
@pragma('vm:entry-point', 'call')
void startTimer(int millis) {
if (_timer == null) {
final period = Duration(milliseconds: millis);
_timer = Timer.periodic(period, (_) {
_tickCount++;
});
print('Started timer with period $period');
}
}
@pragma('vm:entry-point', 'call')
void stopTimer() {
_timer?.cancel();
_timer = null;
}
@pragma('vm:entry-point', 'call')
void resetTimer() {
_tickCount = 0;
}
@pragma('vm:entry-point', 'get')
int get ticks => _tickCount;