small optimization of Executes

This commit is contained in:
InsanusMokrassar 2020-06-03 20:03:04 +06:00
parent 25901b7ab6
commit 69e2e10d29

View File

@ -5,7 +5,7 @@ import kotlinx.coroutines.delay
suspend inline fun KronScheduler.doWhile(noinline block: suspend () -> Boolean) {
do {
delay(next().unixMillisLong - DateTime.now().unixMillisLong)
delay((next() - DateTime.now()).millisecondsLong)
} while (block())
}
suspend inline fun doWhile(