You can switch on logging in the options to diagnose unexpected power use. Currently the logging can capture the code running from timeouts and intervals and the power up and down of some devices. The captured times are probably not perfect but should be good enough to indicate problems.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The Power Manager app has a logging feature:
You might find something out with that :)
Edit: there's also this: https://www.espruino.com/Reference#l_E_gÂetPowerUsage