No edit summary |
Added a description, moved relevant information from the input/output descriptions into the main description. Removed Stub tag. |
||
Line 18: | Line 18: | ||
}} | }} | ||
The <code>Stopwatch</code> node keeps track of time when running. To start the Stopwatch, send in a pulse to the Start Call. To stop the Stopwatch, send a pulse to the Stop Call. To reset the current value in this Stopwatch, send a pulse to the Reset Call. You can send a reset call when the Stopwatch is running, this will keep it running and the value will just be reset. Sending multiple pulses to the same call will not change it's previous state (Start does nothing if already started, stop does nothing when already stopped, reset does nothing when the value is 0). | |||
== Inputs == | == Inputs == | ||
Line 26: | Line 24: | ||
=== Start ([[Impulses|Call]]) === | === Start ([[Impulses|Call]]) === | ||
Calls to Start the Stopwatch, setting the <code>IsRunning</code> state to true. Does nothing if the Stopwatch is already in a running state. | |||
Does nothing if the Stopwatch is already | |||
=== Stop ([[Impulses|Call]]) === | === Stop ([[Impulses|Call]]) === | ||
Calls to Stop the Stopwatch, setting the <code>IsRunning</code> state to false. Does nothing if the Stopwatch is already in the stopped state. | |||
Does nothing if the Stopwatch is already in the | |||
=== Reset ([[Impulses|Call]]) === | === Reset ([[Impulses|Call]]) === | ||
Calls to Reset the Stopwatch, sets the Time output to zero (0). | |||
== Outputs == | == Outputs == | ||
Line 64: | Line 57: | ||
== Examples == | == Examples == | ||
[[Category:ProtoFlux:Time]] | [[Category:ProtoFlux:Time]] |
Revision as of 03:14, 20 May 2024
The Stopwatch
node keeps track of time when running. To start the Stopwatch, send in a pulse to the Start Call. To stop the Stopwatch, send a pulse to the Stop Call. To reset the current value in this Stopwatch, send a pulse to the Reset Call. You can send a reset call when the Stopwatch is running, this will keep it running and the value will just be reset. Sending multiple pulses to the same call will not change it's previous state (Start does nothing if already started, stop does nothing when already stopped, reset does nothing when the value is 0).
Inputs
Start (Call)
Calls to Start the Stopwatch, setting the IsRunning
state to true. Does nothing if the Stopwatch is already in a running state.
Stop (Call)
Calls to Stop the Stopwatch, setting the IsRunning
state to false. Does nothing if the Stopwatch is already in the stopped state.
Reset (Call)
Calls to Reset the Stopwatch, sets the Time output to zero (0).
Outputs
OnStarted (Continuation)
Sends an impulse after a Start Call has been impulsed.
OnStopped (Continuation)
Sends an impulse after a Stop Call has been impulsed.
OnReset (Continuation)
Sends an impulse after a Reset Call has been impulsed.
Time (Float)
Returns the amount of time since the stopwatch has been started, as a Float representing seconds before the decimal place and fractions of a second after the decimal place. If a TimeSpan is desired instead of a Float, use the TimeSpanFromSeconds node to convert for the appropriate resolution.
IsRunning (Bool)
Is true if the Stopwatch is in a Running state and false if the Stopwatch is in a Stopped state.