At time, do code.
Ruby
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
COPYING
README.md
Rakefile
atdo.gemspec

README.md

atdo

At time, do code. That is all.

Oh, ok, if you insist, here's a little example:

require 'atdo'

scheduler = AtDo.new
scheduler.at Time.now + 2 do
  puts "hello"
end
scheduler.at Time.now + 2 do
  puts "world"
end
sleep 3

And with rbtree storage instead of array:

require 'atdo'
require 'rbtree'

scheduler = AtDo.new storage: MultiRBTree
scheduler.at Time.now + 2 do
  puts "hello"
end
scheduler.at Time.now + 2 do
  puts "world"
end
sleep 3

Both of these output

hello
world

See the unit tests for more examples.

The rbtree option is better for larger lists of tasks, especially with random inserts.