timer.get, get timer
Get timer property values.
📝Syntax
value = get(t, 'PropertyName')
values = get(t)
📥Input Arguments
Parameter Description
t Timer object. Use a scalar timer when requesting all properties.
PropertyName Name of the property to query.
📤Output Arguments
Parameter Description
value Requested property value.
values Scalar structure containing the timer property values.
📄Description

get returns the value of a named timer property. Calling get with only a scalar timer returns a structure containing all timer properties, including read-only properties such as Running, TasksExecuted, AveragePeriod, and InstantPeriod.

💡Examples
Query one property and then all properties.
t = timer('Name', 'getExample', ...
  'StartDelay', 0.2, ...
  'TimerFcn', @(src, event) disp('done'));
delay = get(t, 'StartDelay')
props = get(t)
delete(t);
Read the number of completed tasks after a repeated timer finishes.
t = timer('ExecutionMode', 'fixedSpacing', ...
  'Period', 0.05, ...
  'TasksToExecute', 2, ...
  'TimerFcn', @(src, event) disp('tick'));
start(t);
wait(t);
executed = get(t, 'TasksExecuted')
delete(t);
🔗See Also
timerset
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub