@nikitas
For the science:
// gcc MicroDelay.c -Wall -O3 -lauto
#include <proto/timer.h>
#include <stdio.h>
static void DoMicroDelay(uint32 microseconds, uint32 count)
{
struct TimeVal a, b;
ITimer->GetSysTime(&a);
for (uint32 i = 0; i < count; i++) {
ITimer->MicroDelay(microseconds);
}
ITimer->GetSysTime(&b);
double duration = (b.Seconds * 1000000 + b.Microseconds) -
(a.Seconds * 1000000 + a.Microseconds);
printf("%lu * %lu microseconds took %f seconds\n", count, microseconds, duration / 1000000.0);
}
int main()
{
DoMicroDelay(1, 1000000);
DoMicroDelay(10, 100000);
DoMicroDelay(100, 10000);
DoMicroDelay(1000, 1000);
return 0;
}