Reworked interval timing to avoid using millis()

Reworked the interval timing so the sketch can run longer.