var start = Time.sec Sig.INT { say "Ran for #{Time.sec - start} seconds." Sys.exit } { |i| say i Sys.sleep(0.5) } * Inf
1 2 3 4 ^CRan for 2 seconds.
Last updated 10 months ago