Skip to content

Instantly share code, notes, and snippets.

# Write code, which will allow execution of following. This code should
# run idefinietly and output the "hello" string two times per second.
2.times.per_second { puts "hello" }
# => "hello"
# => "hello"
# [...]
# This example should execute given code 10 times per second (every 100ms).