The new PCIbex Farm is here! Be sure to check out all of its new features and changes.

Link Search Menu Expand Document

timer.test.ended

description

Tests whether the timer has ended.

syntax

getTimer(ELEMENT_NAME).test.ended()

example(s)


@
@newText("start", "Ready... go!")
@    .print()
@,
@newTimer("hurry", 1000)
@    .start()
@,
@newButton("click", "Click me!")
@    .print()
@    .wait()
@,
@getTimer("hurry")
$    .test.ended()
@    .success( newText("slow", "Too slow...").print() )
@    .failure( newText("fast", "Good job!").print() )
  • Adds a line of text saying Ready… go! to the screen, starts a 1s timer, adds a button reading Click me!, and waits for a click on the button. If the timer has ended by the time the button is clicked, the text Too slow… is added to the screen, otherwise if the button is clicked within 1s, Good job! appears below it.