I have a circuit/device that using ESP32 as microcontroller. I want to calculate how much total current and power that my device drawn. 

So, the current draw will be like this:

[![my current data](https://i.stack.imgur.com/WMX3c.png)](https://i.stack.imgur.com/WMX3c.png)

My question is:

1. The total current drawn in 1 minute by my device is `1.62` A (i just summing all of `current draw * time`), is it correct?
2. How long my device last if i powered it with battery 4000 mAh, device is using 5 V, and ON/active time is 12 hours a day?

EDITED (1):

OK, now I have measured the current drawn using 1 ohm resistor series with load/device. Then connected my digital oscilloscope. Now what i got is like this:

[![enter image description here](https://i.stack.imgur.com/Z0m7U.png)](https://i.stack.imgur.com/Z0m7U.png)

So, to calculate total current drawn i just have to multiple current draw with period, is it correct?

EDITED (2):

Okay, now i got the average current consumption. But i got another question, i need to calculate the power consumption and energy that consumed by 1 hour. To get the power consumption i need to multiple current with voltage, like this:

P = V \* I = 5V \* 12.25mA = 61,25 mWatt.

1. Is it correct?
2. Is this average power drawn each day?
3. Then to calculate energy each hour, i just multiply it by 3600. E = 0.06125 \* 3600 = 220.5 Wh. Is it correct?

Thank You