repo.or.cz
/
io
/
quag.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Making Samples executable. #!/usr/bin/env io and chmod a+x *.io
[io/quag.git]
/
samples
/
misc
/
ErlangChallenge.io
blob
178961d405b105e43092ec1d33381da5e98aff24
1
#!/
usr
/
bin
/
env io
2
3
//
Collector debugOn
4
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
12
)
13
)
14
15
max
:=
10000
16
17
t
:=
Test
clone
18
19
setup
:=
method
(
20
for
(
i
,
1
,
max
,
21
t
:=
Test
clone
setId
(
i
)
setNext
(
t
)
22
t
@@
id
23
yield
24
)
25
)
26
27
writeln
(
max
,
" coros"
)
28
writeln
(
Date
secondsToRun
(
setup
),
" secs to setup"
)
29
writeln
(
Date
secondsToRun
(
t ping
;
yield
),
" secs to ping"
)