Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sleep (Time.now.round + 1 - Time.now).to_r
puts "Time is now #{"%10.5f" % Time.now.to_f}"
start_time = current_time = Time.now
while current_time.min == start_time.min
i = 0
while Time.now.sec == current_time.sec
i += 1
end
puts "Ran #{i} in the last sec #{"%10.5f" % Time.now.to_f}"
current_time = Time.now
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.