The roll of thumb is 80% of the size of the tank. So a 40 gallon is only going to give you 30. The time it takes to run out depends on who is using thne shower and how hot they run the water. I take pretty hot showers after work. My daughter can drain a 50 if I let her.