mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 06:38:45 +01:00
28 lines
398 B
Plaintext
28 lines
398 B
Plaintext
import "timer" for Timer
|
|
|
|
Fiber.new {
|
|
Timer.sleep(0)
|
|
IO.print("a")
|
|
}.call()
|
|
|
|
Fiber.new {
|
|
Timer.sleep(0)
|
|
IO.print("b")
|
|
}.call()
|
|
|
|
Fiber.new {
|
|
Timer.sleep(0)
|
|
IO.print("c")
|
|
}.call()
|
|
|
|
IO.print("main")
|
|
Timer.sleep(0) // This is enough to let the other fiber run.
|
|
IO.print("done")
|
|
|
|
// expect: main
|
|
// Run in the order they were enqueued.
|
|
// expect: a
|
|
// expect: b
|
|
// expect: c
|
|
// expect: done
|