Skip to content

Instantly share code, notes, and snippets.

@doxavore
Last active Jan 2, 2016
Embed
What would you like to do?
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