Basically that line does a little modulo math (divide, but only keep the remainder) to calculate where between t1 and t2 the current time should be. So it creates the looping by translating any time beyond t2 to the appropriate time between t1 and t2.