I’ve been needing a timer module, and found this thread of a feature request for such a thing to be implemented properly:
Since I couldn’t find anyone posting anything else about it, I wanted to try to make a neat module for it myself. This has changed over time - initially it was quite bad, but it’s improved to the point I’d be happy for people to use it (also, it works completely as I’d expect it a timer module to now, finally).
https://www.roblox.com/library/3228141085/Timer-Module
Documentation
Methods:
Events:
Properties:
Simple example use case:
Changelog
19-May-2021:
- Added infinite duration condition (Duration can be 0 or less to be infinite)
- Added pause function with :Pause(), which can be unpaused using :Start()
- Added Timer.TimeElapsed (shows how long it has been since the timer started. Paused timespan not taken into account)
- Further polishing, should function cleanly and as expected now
- Changed some variables.
- Changed :Stop() method to :Destroy() (more consistent with Roblox instances)
22-May-2021:
- Uses os.clock() now, instead of tick()
Tell me what you think!