start method
void
start()
Starts the sleep timer.
Implementation
void start() {
if (duration != Duration.zero && !isRunning) {
if (_target == Duration.zero) _target = duration;
_prediction?.cancel();
_timer?.cancel();
_prediction = Timer.periodic(periodicTime, _counter);
_timer = Timer(_target, _complete);
}
}