trying this code ``` runBlocking { val tim...
# announcements
m
trying this code
Copy code
runBlocking {

      val timer = measureTimeMillis { delay(1000) }
      println("Delay Measure: $timer")

      val timer2 = measureTimeMillis { Thread.sleep(1000) }
      println("Thread Sleep Measure: $timer2")

    }
but the result was unexpected for me:
Copy code
Delay Measure: 1064
Thread Sleep Measure: 1002
Is it something I should expect the
delay
in coroutine takes more time than the
Thread.sleep
?
g
There is additional dispatching in case of coroutunes
Also such micro benchmarking without proper test harness has not so much sense
m
make sense 👍