Implementation of repeatForSeconds
Wraparound test.