Possibly fix #31: avoid double to int conversion

If times are small, subtracted and converted to int it may be possible that this
results in 0 where something else would be correct.