OiO.lk English Android Android boot time with μs accuracy
Android

Android boot time with μs accuracy


It is a fact that both uptime -s and Kotlin:

object X {
  private val startTime = Clock.System.now()
  private val androidBootTime = startTime - SystemClock.elapsedRealtime().toDuration(DurationUnit.MILLISECONDS)

with X referenced by an Application subclass,
returns an accuracy that is around ±10 seconds, ie. different invocations produce different boot times for the same boot session

Is there a Kotlin code-sample producing μs-accuracy boot time?

What is the highest attainable accuracy of Android boot time?

It is also a fact that determining the start time of your app can only be done by a static timestamp, all other intelligent means are defeated by Android caching and intentional slowness



You need to sign in to view this answers

Exit mobile version