Skip to content

Instantly share code, notes, and snippets.

@doxavore
Last active January 2, 2016 10:09
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 doxavore/8288495 to your computer and use it in GitHub Desktop.
Save doxavore/8288495 to your computer and use it in GitHub Desktop.
Timers 2.0.0 on JRuby 1.7.4
>> require 'timers'
true
>> timers = Timers.new
#<Timers:0x322114c1 @interval=#<Hitimes::Interval:0x19d9a49d>, @timers=#<SortedSet: {}>, @paused_timers=#<SortedSet: {}>>
>> timer = timers.after(5) { puts 'hello' }
#<Timers::Timer:81e fires in 4.995706082 seconds>
# ... never fires
# Also, this doesn't seem to work, from the specs:
>> fired = false
false
>> timer = timers.after(5) { fired = true }
#<Timers::Timer:9a8 fires in 4.999 seconds>
>> timer
#<Timers::Timer:9a8 fired 2.64 seconds ago>
>> fired
false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment