This is an example code of how to calculate the duty cycle and battery consumption in a ESP8266 reading some analog input and with LIGHT_SLEEP mode configuration.

Specifications:

Parameter Value
Battery Capacity 5400 [mAh]
Current in Active Mode 170 [mA]
Current in Light Sleep 0.9 [mA]
Circuit Voltage 3.3 [V]