Hello Neeraj Srivastava,
Please check the attachment, you can find the MQX timing report for k60.
Regarding the time slice, the default time slice unit is number of ticks. Ticks are set by the frequency of the system timer in the <board>.h file. So there is not formula in order to determinate the time slice value, however it is recommended this value is greater than the context switch.
According with the MQX user guide:
A task uses round robin scheduling only if the MQX_TIME_SLICE_TASK attribute is
set in its task template. The task's time slice is determined by the value of the template's
DEFAULT_TIME_SLICE. However, if the value is zero, the task's time slice is the
default time slice for the processor. Initially, the default time slice for the processor is ten
times the interval of the periodic timer interrupt. Since the interval on most BSPs is five
milliseconds, the initial default time slice for the processor is usually 50 milliseconds.
You can change the default time slice for the processor with _sched_set_rr_interval() or
_sched_set_rr_interval_ticks(), passing the task ID parameter as
MQX_DEFAULT_TASK_ID.
When the time slice expires for an active round robin task, MQX RTOS saves the task's
context. MQX RTOS then performs a dispatch operation, in which it examines the ready
queues to determine, which task should become active. MQX RTOS moves the expired
task to the end of the task's ready queue, an action that causes control to pass to the next
task in the ready queue. If there are no other tasks in the ready queue, the expired task
continues to run.
With round robin scheduling, tasks of the same priority can share the processor in a timeequitable
manner.
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------