Big Chungus
08/01/2020, 10:20 AMaleksey.tomin
08/01/2020, 10:26 AMval nowMilleeconds = memScoped {
val timeVal = alloc<timeval>()
gettimeofday(timeVal.ptr, null)
val sec = timeVal.tv_sec
val usec = timeVal.tv_usec
(sec * 1_000L) + (usec / 1_000L)
}
Windows
val nowMilleeconds = memScoped {
val timeVal = alloc<timeval>()
mingw_gettimeofday(timeVal.ptr, null) // mingw: doesn't expose gettimeofday, but mingw_gettimeofday
val sec = timeVal.tv_sec
val usec = timeVal.tv_usec
(sec * 1_000L) + (usec / 1_000L)
}
Big Chungus
08/01/2020, 10:27 AMkotlin.system.getTimeMillis()
Or is that not the same?aleksey.tomin
08/01/2020, 10:29 AMonly delta between two subsequent calls makes sense.
Big Chungus
08/01/2020, 10:30 AMErik Christensen
08/01/2020, 10:33 AM