Skip to content

Instantly share code, notes, and snippets.

@anonyo
Created August 22, 2016 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonyo/f3a8f053c6902741dbedabd690b6f6c5 to your computer and use it in GitHub Desktop.
Save anonyo/f3a8f053c6902741dbedabd690b6f6c5 to your computer and use it in GitHub Desktop.
Benchmarking hourly sidetiq
$: << 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