is an extension that adds the IntervalTimer
classes from the Source SDK as Handle methodmaps.
This is useful if you want Valve-style timers without having to keep track of timestamps and durations by yourself.
Yes, you can technically do something similar in SourcePawn with enum structs already, but it is a bit of a pain if you want to store the timer state (which is precisely why I made this).
public void OnPluginStart()
// Initialize our timer variables.
// Remember to close Handles using the 'delete' operator to avoid memory leaks.
g_PrintCountdownTimer = new CountdownTimer();
g_PrintIntervalTimer = new IntervalTimer();
public void OnClientPutInServer(int client)
// Start the countdown timer. If restarted while already running, the elapsed time resets.
public void OnGameFrame()
// Use the countdown timer.
if (g_PrintCountdownTimer.HasStarted() && g_PrintCountdownTimer.IsElapsed())
LogMessage("New player(s) have joined the server.");
// Start and use the interval timer.
else if (g_PrintIntervalTimer.IsGreaterThan(10.0))
LogMessage("This log message sends every 10 seconds.");