How to get power usage on a Mac

前端 未结 3 1220
刺人心
刺人心 2021-02-14 18:38

I\'m trying to get the power usage (in watts) but I can\'t figure out how. I looked at pmset and IOKit but couldn\'t find anything about it. coconutBattery can calculate it for

3条回答
  •  盖世英雄少女心
    2021-02-14 19:21

    If you only need this information for a laptop, call IOPMCopyBatteryInfo and look at the values for the kIOBatteryVoltageKey and kIOBatteryAmperageKey keys to compute the power usage.

提交回复
热议问题