changed timer arithmetic to int because we do not accept times > 4.2 s and it is faster on 32 bit targets