Skip to content

Commit

Permalink
add bench for gh-146
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Mar 26, 2015
1 parent e64eef4 commit aa201ab
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions misc/freq.rb
@@ -0,0 +1,24 @@

require 'benchmark'

$:.unshift('lib')
require 'rufus/scheduler'

N = 10

puts
puts "Ruby: #{RUBY_PLATFORM} #{RUBY_VERSION}"
puts "N is #{N}"
puts

Benchmark.benchmark(Benchmark::Tms::CAPTION, 31) do |b|

cl = Rufus::Scheduler::CronLine.new('*/2 * * * *')

b.report('.next_time') do
N.times { cl.next_time }
end
b.report('.frequency') do
N.times { cl.frequency }
end
end

0 comments on commit aa201ab

Please sign in to comment.