Difference between revisions of "Component: Timer (Timing)"
From Flowcode Help
Jump to navigationJump to search(3 intermediate revisions by one other user not shown) | |||
Line 5: | Line 5: | ||
|- | |- | ||
| width="20%" style="color:gray;" | Version | | width="20%" style="color:gray;" | Version | ||
− | | | + | | 14.0 |
|- | |- | ||
| width="20%" style="color:gray;" | Category | | width="20%" style="color:gray;" | Category | ||
Line 15: | Line 15: | ||
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. | ||
− | == | + | ==Version information== |
− | + | Library Version, Component Version, Date, Author, Info | |
+ | |||
− | |||
==Detailed description== | ==Detailed description== | ||
Line 44: | Line 44: | ||
− | |||
− | |||
− | |||
− | |||
Line 55: | Line 51: | ||
+ | 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. | ||
+ | {{Fcfile|TimerExample.fcfx|Timer Example}} | ||
==Macro reference== | ==Macro reference== | ||
Line 207: | Line 205: | ||
|- | |- | ||
| colspan="2" | Timer Peripheral to use to monitor the passage of time. | | colspan="2" | Timer Peripheral to use to monitor the passage of time. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Prescaler | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Postscaler | ||
+ | |- | ||
+ | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
Line 247: | Line 255: | ||
| colspan="2" | | | colspan="2" | | ||
|} | |} | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_TimerComponent.fcfx FC_Comp_Source_TimerComponent.fcfx] | ||
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_TimerComponent.fcfx FC_Comp_Source_TimerComponent.fcfx] |
Latest revision as of 14:48, 24 July 2024
Author | Matrix TSL |
Version | 14.0 |
Category | Timing |
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.
Version information
Library Version, Component Version, Date, Author, Info
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.
Macro reference
GetCountMicroSeconds
![]() |
GetCountMicroSeconds |
Returns the count value as a number of whole microseconds, rounded down to the nearest microsecond | |
![]() |
Return |
GetCountMilliseconds
![]() |
GetCountMilliseconds |
Returns the count value as a number of whole milliseconds, rounded down to the nearest millisecond | |
![]() |
Return |
GetCountReal
![]() |
GetCountReal |
Returns the count value as a floating point value in seconds. | |
![]() |
Return |
GetCountSeconds
![]() |
GetCountSeconds |
Returns the count value as a number of whole seconds, rounded down to the nearest second | |
![]() |
Return |
GetCountString
![]() |
GetCountString |
Returns the count value as a floating point string in seconds. | |
![]() |
Precision |
Number of decimal places to display in string | |
![]() |
Return |
GetRawCount
![]() |
GetRawCount |
Efficient command to collect the integer number of instructions since the timer was started. | |
![]() |
Return |
ResetCounter
![]() |
ResetCounter |
![]() |
Return |
StartCounter
![]() |
StartCounter |
Starts the timer counting. | |
![]() |
ResetCounters |
Range: 0-1 where 0=Do Not Reset and 1=Reset | |
![]() |
Return |
StopCounter
![]() |
StopCounter |
Stops the timer counting. | |
![]() |
Return |
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_TimerComponent.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_TimerComponent.fcfx