I'm comparing the resource consumption of two Android Apps.
App A uses accelerometer
App B uses both accelerometer and gyroscope
After reading these sensors, these apps does some processing on the sensor values. Now I measured their CPU usage using dumpsys cpuinfo as well as top command.
In general, App B uses 3-4 times more CPU than App A. The actual numbers are as follows: These results for single CPU and my phone is using Dual-core 1.2 GHz Cortex-A9 CPU (Samsung Galaxy S2).
App A (Average CPU Usage: 5%)
APP B (Average CPU Usage = 20%)
Then I measured the percentage battery usage for these two apps. I kept the Android phone in Aeroplane mode and only one of these two apps were running at a a specific moment of time. After running them for one hour, I get the following results:
Remaining battery level after one hour of use:
Idle mode: 99%
Running App A: 96%
Running App B: 93%
I was expecting the same ratio with these battery level as I observed with CPU Usage.
I also tested these apps on a smartwatch ( CPU: Quad-core 1.2 GHz Cortex-A7) and I observed even smaller difference between the battery use. The observed results for one hour use are as follows:
Remaining battery level after one hour of use:
Idle mode: 99%
Running App A: 87%
Running App B: 85%
So my question: Why the ratio of CPU usage for these apps is not reflected in their remaining battery levels? Or Shouldn't the CPU Usage be linearly related to the battery use ?
Could the reason be that multiple cores are active at the same, that's why I observe small difference between the their battery levels?
PS: I use partial lock in these apps.