setInterval method
seconds
is the amount of time that Okito will wait to call
the function again, it will continiously work.
Returns a function that can stop the interval.
Example
final stopInterval = Okito.setInterval(5, () {
print('I will run every 5 seconds');
});
Okito.setTimeout(20, stopInterval);
Implementation
Function setInterval(int seconds, Function callback) {
final timer = Timer.periodic(Duration(seconds: seconds), (_) => callback());
return timer.cancel;
}