clock.timerExpired

Syntax clock.timerExpired (processname, ctSecsBetwRuns=60)

Params processname is a string.

ctSecsBetwRuns, is the number of seconds between runs of the process. It's optional, if not specified its value is 60.

Action Determines if the timer has expired.

Returns True if the timer has expired, false if it hasn't.

Examples clock.timerExpired ("all your base")

   » true

loop {if clock.timerExpired ("test", 2) {speaker.beep ()}}

   » beeps the speaker every two seconds

clock.timerExpired (this, 24 * 60 * 60) //returns true once a day

   » true

Notes This verb encapsulates logic that appears in the thread scripts in Radio 7.1. Usually processname will be the address of the script that needs to time itself so it only does something every few seconds, minutes or hours. If you need to coordinate access between different threads, use the semaphore verbs.

clock.timerExpired always returns true the first time you call it.

The timers are stored at system.temp.timers.

If you are setting timers from scripts running in guest databases, you might want to pass the this through string.popFileFromAddress, to make system.temp.timers easier to read.

See also semaphore.lock

string.popFileFromAddress

this

Discuss