@salass00
Quote:
salass00 wrote:
@freddix
UNIT_MICROHZ has ?s accuracy.
For higher accuracy than that you can use UNIT_ECLOCK
...
No, this has not been exactly correct since AmigaOS 2.x. While the old AmigaOS 1.x documentation explains that UNIT_VBLANK timing accuracy is coarser than UNIT_MICROHZ, this explanation only holds for the timer.device versions available in AmigaOS 1.x.
With AmigaOS 2.x the source that drives the timer.device time keeping was switched, yielding much higher accuracy in excess of what UNIT_MICROHZ could deliver in AmigaOS 1.x. In effect, the same source drives UNIT_VBLANK, UNIT_MICROHZ and UNIT_ECLOCK. There is no difference in accuracy between UNIT_VBLANK and UNIT_MICROHZ.
The exception is UNIT_ECLOCK. Since it does not use seconds/microseconds values for time intervals, you can go beyond microsecond accuracy. In practice, however, this may make little difference because task scheduling will tend to get in the way and skew your delay times

UNIT_ECLOCK is really useful only if you want to measure time differences with great accuracy.
Incidentally, if you use the EClock timer, you should not peek SysBase->ex_EClockFrequency, but use timer.device/ReadEClock() instead. This is because SysBase->ex_EClockFrequency may be set to a legacy value on AmigaOS 4.x while the actual EClock frequency returned and referenced by timer.device/ReadEClock() may be much, much higher.