Component: Timer (Storage)
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | Storage |
Contents
Timer component
Allows you to measure the passage of time via the use of a hardware timer peripheral. Works like a stopwatch with macros to start and stop the timer counter. Returns time as integer Seconds, Milliseconds, Microseconds and also Floating Point and String.
Examples
Here is a basic example showing the operation of the timer component used to time a section of code or the duration of a specific event.
Downloadable macro reference
GetCountSeconds
Returns the count value as a number of whole seconds, rounded down to the nearest second
Parameters
- This macro has no parameters
Return value
StartCounter
Starts the timer counting.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
GetCountString
Returns the count value as a floating point string in seconds.
Parameters
- This macro has no parameters
Return value
GetCountMicroSeconds
Returns the count value as a number of whole microseconds, rounded down to the nearest microsecond
Parameters
- This macro has no parameters
Return value
GetCountMilliseconds
Returns the count value as a number of whole milliseconds, rounded down to the nearest millisecond
Parameters
- This macro has no parameters
Return value
StopCounter
Stops the timer counting.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
GetCountReal
Returns the count value as a floating point value in seconds.
Parameters
- This macro has no parameters
Return value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Timer
This property is of type Fixed list of ints and can be referenced with the variable name Timer.
Timer Peripheral to use to monitor the passage of time.
Bit Depth
This property is of type Unsigned integer and can be referenced with the variable name BitDepth.
Number of bits in the timer peripheral.
8-bit timers can count from 0-255 before overflowing.
16-bit timers can count from 0 to 65535 before overflowing.
Instruction Rate
This property is of type Unsigned integer and can be referenced with the variable name InstructionRate.
No additional information
Rollover Frequency
This property is of type Floating point and can be referenced with the variable name RolloverFreq.
No additional information
Rollover Time
This property is of type Floating point and can be referenced with the variable name RolloverTime.
No additional information
Max Time Measurement
This property is of type Floating point and can be referenced with the variable name MaxTimeMeasurement.
Max time in seconds that we can measure before rolling over and starting again.