Difference between revisions of "Component: Timer (Storage)"
From Flowcode Help
Jump to navigationJump to search(2 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
==Timer component== | ==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, stop and reset the timer counter. Returns time as integer Seconds, Milliseconds, Microseconds and also Floating Point and String. | Allows you to measure the passage of time via the use of a hardware timer peripheral. Works like a stopwatch with macros to start, stop and reset the timer counter. Returns time as integer Seconds, Milliseconds, Microseconds and also Floating Point and String. | ||
+ | |||
+ | ==Component Pack== | ||
+ | |||
+ | STORAGE | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 26: | Line 36: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 62: | Line 78: | ||
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:]] - | + | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL |
| width="90%" | ResetCounters | | width="90%" | ResetCounters | ||
|- | |- | ||
Line 150: | Line 166: | ||
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] - | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
Line 208: | Line 224: | ||
| colspan="2" | Max time in seconds that we can measure before rolling over and starting again. | | colspan="2" | Max time in seconds that we can measure before rolling over and starting again. | ||
|- | |- | ||
− | | width="10%" align="center" style="background-color:# | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
− | | width="90%" style="background-color:# | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|- | |- |
Latest revision as of 17:24, 9 November 2022
Author | Matrix TSL |
Version | 1.1 |
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, stop and reset the timer counter. Returns time as integer Seconds, Milliseconds, Microseconds and also Floating Point and String.
Component Pack
STORAGE
Detailed description
No detailed description exists yet for this component
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 | |
![]() |
Return |
![]() |
StartCounter |
Starts the timer counting. | |
![]() |
ResetCounters |
Range: 0-1 where 0=Do Not Reset and 1=Reset | |
![]() |
Return |
![]() |
GetCountString |
Returns the count value as a floating point string in seconds. | |
![]() |
Precision |
Number of decimal places to display in string | |
![]() |
Return |
![]() |
GetCountMicroSeconds |
Returns the count value as a number of whole microseconds, rounded down to the nearest microsecond | |
![]() |
Return |
![]() |
GetCountMilliseconds |
Returns the count value as a number of whole milliseconds, rounded down to the nearest millisecond | |
![]() |
Return |
![]() |
StopCounter |
Stops the timer counting. | |
![]() |
Return |
![]() |
ResetCounter |
![]() |
Return |
![]() |
GetCountReal |
Returns the count value as a floating point value in seconds. | |
![]() |
Return |
![]() |
GetRawCount |
Efficient command to collect the integer number of instructions since the timer was started. | |
![]() |
Return |