wonder Expert Licensed User Longtime User Sep 12, 2016 #1 As of now, I'm using the NanoTime lib to benchmark my code in nanoseconds. Is it possible to have a measurement in CPU cycles and/or CPU time as well? Thanks in advance. Last edited: Sep 12, 2016
As of now, I'm using the NanoTime lib to benchmark my code in nanoseconds. Is it possible to have a measurement in CPU cycles and/or CPU time as well? Thanks in advance.
JordiCP Expert Licensed User Longtime User Sep 12, 2016 #2 (not tested, but could be what you are after?) https://developer.android.com/reference/android/os/Debug.html#threadCpuTimeNanos() Also, if you know elapsed time and CPU speed you could get % of usage and CPU cycles for a given function Upvote 0
(not tested, but could be what you are after?) https://developer.android.com/reference/android/os/Debug.html#threadCpuTimeNanos() Also, if you know elapsed time and CPU speed you could get % of usage and CPU cycles for a given function