Browse Source

pomodoro: some tuning

tags/v0.9
parent
commit
6d8008cdf8
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      plugins/pomodoro

+ 3
- 3
plugins/pomodoro View File

@@ -68,7 +68,7 @@ class EventLoop
else
timer.index = @timers.size
@timers.push timer
heapify_up @timers.size - 1
heapify_up timer.index
end
end

@@ -126,7 +126,7 @@ private

def dispatch_timers
now = Time.new
while not @timers.empty? and @timers[0].when < now do
while not @timers.empty? and @timers[0].when <= now do
@timers[0].callback.call
remove_timer_at 0
end
@@ -134,7 +134,7 @@ private

def nearest_timeout
return nil if @timers.empty?
timeout = @timers[0].when - Time.new
timeout = @timers[0].until
if timeout < 0 then 0 else timeout end
end



Loading…
Cancel
Save