- local r = func(current_time);
- if type(r) == "number" then _add_task(r, func); end
+ local r = callback(current_time);
+ if type(r) == "number" then
+ _add_task(r, callback);
+ next_time = math_min(next_time, r);
+ end
+ else
+ next_time = math_min(next_time, t - current_time);