Programming and Data Types    

Timer Object Properties

The timer object supports many properties that control aspects of its functioning, such as:

These properties fall into four general categories, described in the following tables. For more detailed information about these properties, see timer.
Informational Properties
Provide information about the current state of the timer
Behavioral Properties
Specify how the timer operates
Timer Callback Function Properties
Specify which functions the timer executes
User Specified Properties
Enable you to include application-specific information with your timers

Informational Properties

These timer object properties provide information about the current state of the timer object. These properties are all read-only properties.

Property
Description
AveragePeriod
The average time between executions of TimerFcn since the timer began
InstantPeriod
The time between the last two executions of TimerFcn
Running
The current state of the timer, 'on' or 'off'
TasksExecuted
The number of times the timer has executed TimerFcn since the timer was started

Behavioral Properties

These timer object properties control the basic functioning of the timer. For more information about these properties, see Timer Object Execution Modes.

Property
Description
BusyMode
Specifies how the timer object handles the queuing of the timer callback function (TimerFcn) when the previously queued execution of TimerFcn has not finished
ExecutionMode
Specifies how the timer object queues the timer callback function (TimerFcn) for execution
Period
The number of seconds between executions of the timer callback function (TimerFcn)
StartDelay
The number of seconds before queuing the first execution of the timer callback function (TimerFcn)
TasksToExecute
The total number of times to execute the timer callback function (TimerFcn)

Timer Callback Function Properties

These timer object properties specify the callback functions that the timer executes. For more information, see Creating Timer Callback Functions.

Property
Description
ErrorFcn
The function the timer executes when an error occurs
StartFcn
The function the timer executes when it starts
StopFcn
The function the timer executes when it stops executing. See Stopping Timers for more information.
TimerFcn
The function you want the timer to execute

User-Specified Properties

These timer object properties enable users to associate application-specific data with the timer objects they create.

Property
Description
Name
A text string that identifies the timer
Tag
User-defined label for the timer object
UserData
User-defined data


  Creating and Deleting Timer Objects Starting and Stopping Timers