# HG changeset patch # User Waqas Hussain # Date 1336841214 -18000 # Node ID b2d177f2febcf7b9fc8cf90654d5ccaa56e24fbb # Parent ca39f9b4cc8e8abe200b1fb41b97b517913c7d2b util.timer: Always pass the current time to timer callbacks. diff -r ca39f9b4cc8e -r b2d177f2febc util/timer.lua --- a/util/timer.lua Sat May 12 21:39:30 2012 +0500 +++ b/util/timer.lua Sat May 12 21:46:54 2012 +0500 @@ -27,7 +27,7 @@ if delay >= current_time then t_insert(new_data, {delay, callback}); else - local r = callback(); + local r = callback(current_time); if r and type(r) == "number" then return _add_task(r, callback); end @@ -67,7 +67,7 @@ function _add_task(delay, callback) local event_handle; event_handle = event_base:addevent(nil, 0, function () - local ret = callback(); + local ret = callback(get_time()); if ret then return 0, ret; elseif event_handle then