CreateTimer Function

Creates a basic timer. Calling CloseHandle() on a timer will end the timer.

Handle CreateTimer(float interval, Timer func, any data, int flags)

Parameters

float interval

Interval from the current game time to execute the given function.

Timer func

Function to execute once the given interval has elapsed.

any data

Handle or value to pass through to the timer callback function.

int flags

Flags to set (such as repeatability or auto-Handle closing).

Return Value

Handle to the timer object. You do not need to call CloseHandle(). If the timer could not be created, INVALID_HANDLE will be returned.