diff --git a/lib/timers_uv.js b/lib/timers_uv.js index 2c377873c2..59b016ef3b 100644 --- a/lib/timers_uv.js +++ b/lib/timers_uv.js @@ -67,8 +67,7 @@ function insert(item, msecs) { list.ontimeout = function() { debug('timeout callback ' + msecs); - // TODO - don't stop and start the watcher all the time. - // just set its repeat + var now = new Date(); debug('now: ' + now); @@ -76,7 +75,7 @@ function insert(item, msecs) { while (first = L.peek(list)) { var diff = now - first._idleStart; if (diff + 1 < msecs) { - list.start(diff, 0); + list.start(msecs - diff, 0); debug(msecs + ' list wait because diff is ' + diff); return; } else {