ruby - Can I create an interval loop in an array? -
i'm trying created timed loop in array. mean..
array = [10, 15, 19, 25] array.each |e| loop ... end end
i want output this:
10 #=> waits 10 seconds... 15 #=> waits 10 seconds... 19 #=> waits 10 seconds... 25
is possible? thank in advance. :)
sleep x
pauses output x number of seconds.
so you're looking is:
array = [10, 15, 19, 25] array.each |e| puts e sleep 10 end
Comments
Post a Comment