Created
August 22, 2016 20:55
-
-
Save anonyo/f3a8f053c6902741dbedabd690b6f6c5 to your computer and use it in GitHub Desktop.
Benchmarking hourly sidetiq
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
$: << File.dirname(__FILE__)+'/../lib' | |
require 'ice_cube' | |
require 'benchmark' | |
include IceCube | |
schedule = Schedule.new(now = Time.utc(2010, 1, 1)) do |s| | |
s.add_recurrence_rule(Rule.hourly(2)) | |
end | |
Benchmark.bmbm do |x| | |
x.report("next occurance x 10") do | |
10.times do | |
schedule.next_occurrence(Time.now) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment