Files
wren/test/timer/sleep_float.wren

22 lines
352 B
Plaintext
Raw Permalink Normal View History

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