Files
wren/test/timer/sleep_float.wren
Bob Nystrom ea5c3b01eb Add module for Scheduler.
Also reorganizes some code to make it easier to add more modules.
2015-09-13 11:32:39 -07:00

22 lines
336 B
Plaintext

import "scheduler" for Scheduler
import "timer" for Timer
// These are both rounded to 1, so "a" should complete first.
Scheduler.add {
Timer.sleep(1.5)
IO.print("a")
}
Scheduler.add {
Timer.sleep(1.3)
IO.print("b")
}
IO.print("main")
Timer.sleep(3)
IO.print("done")
// expect: main
// expect: a
// expect: b
// expect: done