Skip to content

Timers

Interval and timeout operators. The playground environment ships this file, so a program in the browser can import it.

To use these operators, add the import to the program:

Import "Timers.rgr"

Source: lib/Timers.rgr.

Operator Arguments Gives
clearInterval i: TimeIntervalID void
clearTimeout i: TimeOutID void
setInterval code: block, ms: int TimeIntervalID
setTimeout code: block, ms: int TimeOutID
setTimeout ms: int, code: block TimeOutID
time_as_string string

Target support marks

  • Own template
  • Default template
  • No template

The operator works for a target with an own template and for a target with the default template. The default template is the * entry of the definition: it writes the same code for every target that has no template of its own. A target with no template writes no code, and a program that uses the operator does not compile for that target.

clearInterval

(clearInterval i) → void
clearInterval(i: TimeIntervalID)

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: no template
  • Rust: no template
  • Python: no template
  • Java: no template
  • Kotlin: no template
  • Dart: no template
  • Swift: no template
  • C#: no template
  • C++: no template
  • PHP: no template
  • Scala: no template

Definition: lib/Timers.rgr, line 14

clearTimeout

(clearTimeout i) → void
clearTimeout(i: TimeOutID)

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: no template
  • Python: no template
  • Java: own template
  • Kotlin: no template
  • Dart: no template
  • Swift: no template
  • C#: no template
  • C++: own template
  • PHP: no template
  • Scala: no template

Definition: lib/Timers.rgr, line 24

setInterval

(setInterval code ms) → TimeIntervalID
setInterval(code: block, ms: int)

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: no template
  • Rust: no template
  • Python: no template
  • Java: no template
  • Kotlin: no template
  • Dart: no template
  • Swift: no template
  • C#: no template
  • C++: no template
  • PHP: no template
  • Scala: no template

Definition: lib/Timers.rgr, line 19

setTimeout

(setTimeout code ms) → TimeOutID
setTimeout(code: block, ms: int)

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: no template
  • Rust: no template
  • Python: no template
  • Java: no template
  • Kotlin: no template
  • Dart: no template
  • Swift: no template
  • C#: no template
  • C++: no template
  • PHP: no template
  • Scala: no template

Definition: lib/Timers.rgr, line 168

setTimeout

(setTimeout ms code) → TimeOutID
setTimeout(ms: int, code: block)

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: own template
  • Python: no template
  • Java: own template
  • Kotlin: no template
  • Dart: no template
  • Swift: no template
  • C#: no template
  • C++: own template
  • PHP: no template
  • Scala: no template

Definition: lib/Timers.rgr, line 34

time_as_string

(time_as_string) → string

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: no template
  • Rust: no template
  • Python: no template
  • Java: no template
  • Kotlin: no template
  • Dart: no template
  • Swift: no template
  • C#: no template
  • C++: no template
  • PHP: no template
  • Scala: no template

Definition: lib/Timers.rgr, line 173

Ranger 3.5.1 · commit f323fd4 · development build