would it be overflowing?
# getting-started
b
would it be overflowing?
s
I think
.nano
is returning something different than what you're expecting. This is the documentation for the function:
Copy code
Gets the number of nanoseconds within the second in this duration.
The length of the duration is stored using two fields - seconds and nanoseconds. The nanoseconds part is a value from 0 to 999,999,999 that is an adjustment to the length in seconds. The total duration is defined by calling this method and getSeconds().
It may make more it more obvious if you change your delay to something like 10 seconds instead of 1 second. I suspect you'll see that your printlns don't really change the way I think you're expecting.
d
It does not make sense to use
LocalDateTime
api to measure this at all. Use
System.currentTimeMillis()
or use
kotlin.system.measureTimeMillis { runBlocking { ... } }
👆 2
b
Yep that works much better 🙂