You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 20, 2022. It is now read-only.
The timers that are in use now are just their likeness.
IMHO would be nice to make them like this:
-- Creates a simple timer that runs the given function after a specified delay.
function timer.simple(delay, function) end
-- other possible function name - timer.create
-- Creates a new timer that will repeat its function given amount of times.
function timer.repeating(delay, repititions, function)
creates and returnes TimerObject
end
function TimerObject:Pause() end
function TimerObject:Resume() end
function TimerObject:Restart() end
-- Returns amount of repetitions/executions left before the timer destroys itself.
function TimerObject():RespLeft() end
function TimerObject:Adjust(delay, repititions, function) end
function TimerObject:Destroy() end
I think everyone agrees that such timers will save a lot of effort.
The text was updated successfully, but these errors were encountered:
Good idea, but I don't think it's fit for the Timer class. The Timer class is specifically for timing things - the changes suggested here do not time anything, but rather provide utility for callbacks after a specific amount of time, either once or on an interval. I think it'd be better to have another class for these types of operations, named Callback or similar.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The timers that are in use now are just their likeness.
IMHO would be nice to make them like this:
-- Creates a simple timer that runs the given function after a specified delay.
function timer.simple(delay, function) end
-- other possible function name - timer.create
-- Creates a new timer that will repeat its function given amount of times.
function timer.repeating(delay, repititions, function)
creates and returnes TimerObject
end
function TimerObject:Pause() end
function TimerObject:Resume() end
function TimerObject:Restart() end
-- Returns amount of repetitions/executions left before the timer destroys itself.
function TimerObject():RespLeft() end
function TimerObject:Adjust(delay, repititions, function) end
function TimerObject:Destroy() end
I think everyone agrees that such timers will save a lot of effort.
The text was updated successfully, but these errors were encountered: