09 November 2016

Thread CPU Time

Linux/Android

  • getrusage() // may not up-to-date on Android

  • clock_gettime(CLOCK_THREAD_CPUTIME_ID) // consistent on Android

  • /proc/stat

  • /proc/[pid]/stat

Android

  • SystemClock.currentThreadTimeMillis()

  • Debug.threadCpuTimeNanos()

Network Usage

Linux

Android

  • NetworkStats

  • TrafficStats

  • /proc/uid_stat/[uid]/tcp_[snd | rcv]