Need help figuring out the percent operation/sleep time a battery should use per amount of time
Battery capacity C=1000mAh

Operating current Io=20mA

Sleeping current Is=0.05mA

Operating time To

Sleeping time Ts

Time total To+Ts=8000 ..................... (1)

Ignoring the self discharge,

C = IoTo + IsTs

1000 = 20*To + 0.05*Ts......................(2)

Equation (1) &amp; (2) are two linear equations with two variables and easy to solve.

You may solve them using substitution method. Online solution here