Handle a signal
var start = Time.sec
Sig.INT {
say "Ran for #{Time.sec - start} seconds."
Sys.exit
}
{ |i|
say i
Sys.sleep(0.5)
} * InfOutput:
1
2
3
4
^CRan for 2 seconds.Last updated
Was this helpful?
var start = Time.sec
Sig.INT {
say "Ran for #{Time.sec - start} seconds."
Sys.exit
}
{ |i|
say i
Sys.sleep(0.5)
} * Inf1
2
3
4
^CRan for 2 seconds.Last updated
Was this helpful?