Unable to access this with code.
The easiest way to verify this:
1) Charge the device to 100%. Leave this while playing music until the battery dies. Keep track of how much time has passed.
2) Recharge the device to 100%, leave it in the game and run the application until the battery dies.
This gives you some idea (at least compared to just playing music) how much energy is being consumed by your application.
source share