The solution is clearly to multiply by 1000 before performing floor division:
`t=(now-start)*1000/freq`
The solution is clearly to multiply by 1000 before performing floor division:
`t=(now-start)*1000/freq`