AntonioRedondo / AnotherMonitor

Monitors and records the CPU and memory usage of Android devices
https://play.google.com/store/apps/details?id=org.anothermonitor
GNU General Public License v3.0
1.1k stars 335 forks source link

How to calculate the percentage? #10

Open Quang0309 opened 5 years ago

Quang0309 commented 5 years ago

screenshot from 2018-11-23 15-28-49

I have a question about the way you calculate the percentage, why we must take the totalT instead of total to calculate the CPU usage percentage?

AntonioRedondo commented 4 years ago

Hello @Quang0309,

I just saw your issue now!

I don't know the logic behind that operation. But the way it's calculated is taken from this StackOverflow question: How to calculate the CPU usage of a process by PID in Linux from C?

Antonio