When assessing reaction times in PsyScript it is usual to use the timer built into the wait command. This is entirely self-contained and as a scripter you don't have to worry about setting it up. However, because it's self-contained it can't be used if you want to time something more complicated than a single button-press. For instance you may want to time an operation which involves answering several questions or clicking a number of things in a particular order. Tasks like those can be performed using the two timers described in this page: the count-up timer and the count-down timer.
The count-up timer is always counting up. You can reset it to zero using this command:
Once reset it will count up from zero. Its current value can be found in the $timerTime variable. PsyScript cannot compare numbers. For example, you cannot check to see if the timer has reached 15 seconds yet. That's what the count-down timer is for.
The count-down timer is always counting down. You can reset it to a particular time using a command like this:
At that point it will start counting down from the time given. Its current value can be found in the $countdownTime variable. If it has not reached zero yet, the time will be reported as a number of seconds, from the start time you supplied down to just above "0". If the time has reached or passed zero, the variable will return the string 'expired'. You can test for this value in your script and do different things depending on whether the countdown has expired or not:
start timer
Resets the count-up timer to zero.
start timer
count down from value seconds
Resets the count-down timer to the number of seconds given.
count down from 10.62 seconds
count down from $varTimeForThisPhase seconds