Instead of keeping track of one global time value, use multiple bounded low-frequency oscillators. This will keep working for an unlimited amount of time.