fix rate measure bugs with timespan/stopwatch tick mismatch, add tests