Fix infinite loop with clock() returning (clock_t)-1.