-
-
Save jmettraux/b3f2bacb2a59627aea00 to your computer and use it in GitHub Desktop.
in response to http://stackoverflow.com/posts/34446828
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rufus-scheduler' | |
p [ RUBY_VERSION, RUBY_PLATFORM ] | |
s = Rufus::Scheduler.new | |
t0 = Time.now | |
total = 38_000 | |
(total * 0.9).to_i.times do | |
s.every('1h') {} | |
end | |
(total * 0.1).to_i.times do | |
s.cron('* * * * *') {} | |
end | |
p Time.now - t0 | |
# results on my OSX laptop: | |
# | |
# $ chruby | |
# jruby-1.7.22 | |
# ruby-1.8.7-p374 | |
# ruby-1.9.3-p547 | |
# ruby-2.1.3 | |
# | |
# $ chruby jruby | |
# $ bundle exec ruby t.rb | |
# ["1.9.3", "java"] | |
# 16.403 | |
# | |
# $ chruby 1.9 | |
# $ bundle exec ruby t.rb | |
# ["1.9.3", "x86_64-darwin14.5.0"] | |
# 37.218007 | |
# | |
# $ chruby 2.1 | |
# $ bundle exec ruby t.rb | |
# ["2.1.3", "x86_64-darwin14.0"] | |
# 13.670538 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment