ProtoFlux:Stopwatch: Difference between revisions

From Resonite Wiki
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:
}}
}}


A simple Stopwatch node.
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).
 
{{stub}}


== Inputs ==
== Inputs ==
Line 26: Line 24:
=== Start ([[Impulses|Call]]) ===  
=== Start ([[Impulses|Call]]) ===  


Call this to Start the Stopwatch => puts the Stopwatch into a Running state.
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 in the Running state.
If Stopwatch Reset was not called, Time Output will continue from the value it was when it was last in a Stopped state.


=== Stop ([[Impulses|Call]]) ===  
=== Stop ([[Impulses|Call]]) ===  


Call this to Stop the Stopwatch => puts the Stopwatch into a Stopped state. (default)
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 Stopped state.
If Stopwatch Reset was not called, Time Output will be the value it was when it was last in a Stopped state. (default 0)


=== Reset ([[Impulses|Call]]) ===  
=== Reset ([[Impulses|Call]]) ===  


Call this to Reset the Stopwatch => puts the Stopwatch into a Stopped state. (default)
Calls to Reset the Stopwatch, sets the Time output to zero (0).
Calling Reset sets the Time Output to zero (0).


== Outputs ==
== Outputs ==
Line 64: Line 57:


== Examples ==
== Examples ==
{{stub}}


[[Category:ProtoFlux:Time]]
[[Category:ProtoFlux:Time]]

Revision as of 03:14, 20 May 2024

Stopwatch
Start
OnStart
Stop
OnStop
Reset
OnReset
Time
IsRunning
Actions

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.

Examples