Code: Select all
while (TRUE) {
chBSemWait(&semaphore);
tmStartMeasurement(&TimeMonitor);
doStuff();
chThdSleepMicroseconds(5000);
tmStopMeasurement(&TimeMonitor);
}
Also note that the measurement has 3 distinct outputs: last, worst, best.
Giovanni