Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am soulware on github.
  • I am soulware (https://keybase.io/soulware) on keybase.
  • I have a public key whose fingerprint is 0573 59D2 3EC2 EACD 1DFB 55A9 5A0C C0C0 4885 727C

To claim this, I am signing this object:

require 'rubygems'
require 'rufus-scheduler'
# the following example should poll every 5s
# and trigger a job at seconds 0,10,20,30,40,50
# but no jobs ever fire unless we are very lucky with our timing
scheduler = Rufus::Scheduler::PlainScheduler.start_new(:frequency => 5.0)
scheduler.cron "0,10,20,30,40,50 * 0-59 * * *" do
puts "doing something #{Time.now}"
@soulware
soulware / gist:175249
Created August 26, 2009 02:08
scheduler slowdown
require 'rubygems'
require 'rufus/scheduler'
scheduler = Rufus::Scheduler.start_new
10000.times do |x|
scheduler.in(60*60) do
# nothing
end
puts "scheduled #{x}" if x%100==0
def hello
puts "hello"
end