| Block Group: | Logic |
| Icon: | ![]() |
The Stop Watch block counts up when enabled. An event is fired when the block loops or stops.
For information on using dataflow blocks, see Dataflow.
The following properties of the Stop Watch block can take input and give output.
modulo, loop, reset, resetValue and onLoop are not shown on the block; edit or bind them in the Properties panel.
enabled sets or returns whether the Stop Watch block is currently counting up.
interval specifies the duration, in seconds, between updates to the output property. For example, if interval is 0.5, the output property counts up every 0.5 seconds. If interval is 0, the stopwatch does not count. The Stop Watch block from the palette has an interval of 0.5.
step specifies the number that is added to the output with each update. For example, if step is 1, then each time the stopwatch counts up, its output increases by 1. The Stop Watch block from the palette has a step of 1.
modulo Specifies the value that signals the stopwatch to loop or stop.If loop is TRUE, then the stopwatch will loop when it reaches the final step before modulo, and output is always less than modulo. If loop is FALSE, then the stopwatch stops at the first step where output is greater than or equal to modulo. If modulo is 0 (the default), the stopwatch never loops or stops.
loop determines whether the Stop Watch block will start again when it reaches modulo. The default is TRUE.
reset causes the stopwatch to restart at the resetValue.
resetValue specifies the value that the stopwatch is set to when reset is triggered. The default is 0.
onLoop fires when the stopwatch either loops or stops.
The following property of the Stop Watch block can give output but cannot take input.
output returns the current stopwatch value.
The following image demonstrates a Stop Watch block. In this example, the block counts up by 1 every 0.5 seconds.
This thread in the DGLogik Community Forum shows a use cases for the block: