# Pause the execution of the current thread for 5 seconds
sleep(5)
loop do
# Print the current time
puts Time.now
# Pause the execution of the loop for 1 second
sleep(1)
end
# Register a block of code to be executed when the program exits
at_exit { puts "Goodbye!" }
Next: timeouts