Timer Service - Lightweight Timer

Timer Service - Lightweight Timer

Github Source Code: TimerService

:pushpin: Overview

A simple memory-efficient timer service that supports:
:white_check_mark: Start, pause, and reset timers
:white_check_mark: Automatic cleanup to prevent memory leaks**
:white_check_mark: Custom callback execution when the timer ends**


:package: How to Use

Creating a Timer

local Timer = require(game.ReplicatedStorage.TimerService)  

local myTimer = Timer.new(10, function()  
    print("Timer ended!")  
end)  

Starting / Pausing

myTimer:start()  
myTimer:pause()  

Reset / Destroy

myTimer:reset(true) -- Resets & pauses  
myTimer:destroy() -- Cleans up memory  

Check Timer State

print("Is running:", myTimer:getIsRunning()) -- true/false  
print("Time left:", myTimer:getTimeLeft())  

:scroll: License

This project is licensed under the MIT License .
You are free to use, modify, share, and include this module in commercial projects , including monetized Roblox games.

Read the full license here.


:bust_in_silhouette: Credits

Made by @natxnek
:speech_balloon: Feedback & support? Reply below!

1 Like