Which timer usage is better for periodic work?

Hello,
I’m using kernel timer like below for periodic work every 10 seconds for example.
Is it more effective to implement with free run timer for this considering accuracy?
What are the advantages?

MsgHandler_Add(APP_MY_WORK, APP_Periodic_Handler);
ke_timer_set(APP_MY_WORK, TASK_APP, TIMER_SETTING_S(10));

void APP_Periodic_Handler(ke_msg_id_t const msg_id, void const *param,
                      ke_task_id_t const dest_id, ke_task_id_t const src_id)
{
	switch(msg_id)
   	{
		case APP_MY_WORK:
			ke_timer_set(APP_MY_WORK, TASK_APP, TIMER_SETTING_S(10));
			
			{
			    // Do something, This may take a few seconds.
			}
		break;
	}
}

Thanks,
Calvin

Hi @Calvin ,
If you only ask one Timer for repeating task, you can see free run timer.
Have you seen any difference between both in your application?

1 Like