TaskTimer Function
Returns the elapsed time since the takt time measurement timer of the specified task starts in seconds.
Syntax
TaskTimer [(taskNum)]
Parameters
- taskNum
- Specify the task number as an integer. Task number omission specifies the current task.
Return Value
An actual value representing the elapsed time of a takt time measurement timer of the specified task. (Unit: second) Valid range is 0 to approx. 1.7E+31. Timer resolution is 0.001 seconds.
Description
Returns the elapsed time since the takt time measurement timer in the current task starts. Unlike the Tmr function, it does not count the elapsed time while the program is in pause or Halt state.
The takt time measurement timer can be reset by using ResetTaskTimer statement.
Real overhead
ResetTaskTimer
overHead = TaskTimer
See Also
ResetTaskTimer, ElapsedTime Function, Tmr Function
TaskTimer Function Example
ResetTaskTimer 'Resets the takt time measurement timer in the task
For i = 1 To 10 'Performs operation 10 times
GoSub Cycle
Next
Print TaskTimer / 10 'Measures a takt time in the task and displays it