Hello!
How can i execute task at a specific time with Kotlin? Wich way is better?
m
Marcin Bak
01/16/2020, 9:04 AM
not sure if its a better way. probably solution would depend on a target where your code is run (server, mobile?).
my first idea would be to use coroutines and call
delay(plannedRunTimeMilliseconds - now())
s
Stephan Schroeder
01/16/2020, 10:59 AM
If you’re using Spring, you can use the @Scheduled annotation. And if not you can always just use