Making Samples executable. #!/usr/bin/env io and chmod a+x *.io
[io/quag.git] / samples / misc / ErlangChallenge.io
blob178961d405b105e43092ec1d33381da5e98aff24
1 #!/usr/bin/env io
3 //Collector debugOn
5 Test := Object clone do(
6 newSlot("next", nil)
7 newSlot("id", nil)
8 ping := method(
9 //writeln("ping ", id)
10 if(next, next @@ping)
11 yield
15 max := 10000
17 t := Test clone
19 setup := method(
20 for(i, 1, max,
21 t := Test clone setId(i) setNext(t)
22 t @@id
23 yield
27 writeln(max, " coros")
28 writeln(Date secondsToRun(setup), " secs to setup")
29 writeln(Date secondsToRun(t ping; yield), " secs to ping")