Skip to content

Instantly share code, notes, and snippets.

@JohnMorales
Created April 13, 2015 22:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save JohnMorales/28f680ed9257aced17b9 to your computer and use it in GitHub Desktop.
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