From Test-Scratch-Wiki

Reset Timer
2.0 Reset Timer.png
Category Sensing
Type Stack

The Reset Timer block is a Sensing block and a Stack block. The block sets the timer's value back to 0.0. When this block is present, the project typically utilizes the Timer output block; usually the timer must be reset at the beginning of a project for the Timer block to hold the right value.

There are no blocks that set the timer to a chosen value. The timer can only be specifically set to 0, using this block.

Example Uses

  • When a project is started, resetting the timer along with it for the right timer value
when gf clicked
reset timer
  • Resetting the timer for timing each level of a game
when I receive [next v]
switch to background [level 2 v]
reset timer
  • Timing progress on various things, and resetting it when necessary
when I receive [final level v]
switch to background [end v]
reset timer
if <(timer) > [180]> then
say [Game over!] for (1) secs
stop [all v]

See Also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.