Thanks, I tried it out on my laptop.
Thanks for trying.
The BAT and PWR displays always show 0% and 0mW respectively as far
as I can tell. Note "apm -l" can show my batter percentage so I
guess that at least should be possible to get right. dmesg below in
case it's useful.
Now it's fixed.
I forgot to unveil("/dev/apm", "r").
See attached port.
Now BAT works (matches apm -l). Power still shows 0mW
(min: 0/max: 0) but I don't even know if my laptop can report power
consumption.
CPU percentage is lower than what "top -1" shows. E.g. with
"++$x while 1" running in a perl repl, top -1 shows 19% user but
your tool shows about 10%. I don't know which is more accurate, so
this isn't necessarily a complaint.
Try with a different delay, maybe the same one as top uses.
Use `apmtop -d DELAY` with DELAY being measured in tenths of seconds.
e.g. `apmtop -d 10` refreshes every second.
Comparing "apmtop -d 10" with "top -1s1" it's still a bit different,
but I don't have any evidence top's estimate is better.
I'm running "find /" in an xterm to use the CPU a bit.
Two side-by-side "top -1s1" instances agree within a couple percentage
points. "apmtop -d 10" shows a different number, e.g. 21% when top
shows 32%. Usually lower but sometimes higher.
CPU frequency looks plausible. Temperature is at least changing
(went from 32 C to 33 C); not sure if it's accurate.
I'll look into that.
I'm not saying 32C sounds wrong, just that I don't have
a way to verify it :)
--
James