make sure we never overflow when calculating sleep time