wren_rust 0.1.3

Bindings to the Wren scripting language API
1
2
3
4
5
6
7
8
9
10
11
12
13
import "scheduler" for Scheduler

class Timer {
  static sleep(milliseconds) {
    if (!(milliseconds is Num)) Fiber.abort("Milliseconds must be a number.")
    if (milliseconds < 0) Fiber.abort("Milliseconds cannot be negative.")

    startTimer_(milliseconds, Fiber.current)
    Scheduler.runNextScheduled_()
  }

  foreign static startTimer_(milliseconds, fiber)
}