aUCBLogo Demos and Tests / testprofile
to testprofile
profile [a]
end
to a
pr 5
repeat 10
[ b "1 #
]
pr c
end
to b b1 b2
(pr b1 b2)
end
to _b p1 p2
ifelse not item "b profile_running
[ setItem "b profile_running true
setItem "b profile_start timefine
make "profile_result runResult [_b p1 p2]
setItem "b profile_time
(item "b profile_time)+timefine-(item "b profile_start)
setItem "b profile_running false
][ make "profile_result runResult [_b p1 p2]
]
setItem "b profile_nr (item "b profile_nr)+1
ifelse empty? profile_result
[ stop
][ output first profile_result
]
end
to c [c1 3][c2 4]
if c1 == 0 [output 0]
pr c1
output (c c1-1)
end