I would either use asynchronous timers or one timer that looks for multiples for the higher time increments. One of these two options would give you better performance. In the second case for example (with 1s, 5s, and 8s intervals) you timer callback would have an interval of 1 second and have code like:
int CVICALLBACK TimerCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_TIMER_TICK:
//Insert code to do every second
countToFive++;
countToEight++;
if(countToFive >= 5)
{
//Insert code to do every 5 seconds
countToFive = 0;
}
if(countToEight >= 😎
{
//Insert code to do every 8 seconds
countToEight = 0;
}
break;
}
return 0;
}
where countToFive and countToEigth are static int globals initialized to 0.
Best Regards,
Chris Matthews
National Instruments