Returns a Stream of counter values which fires every time
seconds.
The stream returns a counter with the number of completed intervals.
The stream ends automatically after time
seconds.
This method is based on the onElapsedTimeChange stream and is therefore executed before all other animatables.
await for (var counter in juggler.interval(0.5)) {
print(counter);
}
var stream = juggler.interval(0.5).take(10);
stream.listen((counter) => print(counter));
Source
Stream<int> interval(num time) async* { var count = 0; var nextTime = this.elapsedTime + time; await for (var elapsedTime in this.onElapsedTimeChange) { while (elapsedTime >= nextTime) { yield ++count; nextTime = nextTime + time; } } }