Use time.sleep(5) instead of possibly negative/infinite time calculation.