non-bash compatibility
min loop time to half the expected frequency