Programming Previous page   Next Page

Executing a Timer Callback Function Multiple Times

The timer object supports three multiple-execution modes:

In many ways, these execution modes operate the same:

The execution modes differ only in where they start measuring the time period between executions. The following table describes these differences.

Execution Mode
Description
'fixedRate'
Time period between executions begins immediately after the timer callback function is added to the MATLAB execution queue.
'fixedDelay'
Time period between executions begins when the timer function callback actually starts executing, after any time lag due to delays in the MATLAB execution queue.
'fixedSpacing'
Time period between executions begins when the timer callback function finishes executing.

The following figure illustrates the difference between these modes. Note that the amount of time between executions (specified by the Period property) remains the same. Only the point at which execution begins is different.

Differences Between Execution Modes


Previous page  Timer Object Execution Modes Handling Callback Function Queuing Conflicts Next page

© 1994-2005 The MathWorks, Inc.