tests: improve calculation in hwtimer_wait

Kudos to @Kijewski