int cloaddr = 0xFE000000 + 0x3000 + 0x04; volatile unsigned int* cloptr = (volatile unsigned int*)(cloaddr); unsigned int tval = *cloptr;
start = clock(); operation(); stop = clock();
start = clock(); loop N times: operation(); endloop; stop = clock();
loop: sleep(X); action(); endloop;... is not sufficient: errors in sleep(), duration of action()
target = clock(); loop: target += X; sleep(target - clock()); action(); endloop;