This site has been archived and made available for preservation purposes. No edits can be made.

CreateTimer

Creates a timer.

[top]Declaration

Code cpp:
VAULTSCRIPT VAULTSPACE Timer (*VAULTAPI(CreateTimer))(VAULTSPACE RawFunction(), VAULTSPACE Interval) VAULTCPP(noexcept);
Code c:
native CreateTimer(const func{}, interval);

[top]Parameters

Function - the function of the timer
Interval - the timer interval in milliseconds

[top]Return value

Returns a Timer referring to the newly created timer.

[top]Usage example (C++)

Code cpp:
Result VAULTSCRIPT MyTimer()
{
    // Timer function
    return static_cast<Result>(0);
}
Void VAULTSCRIPT exec() noexcept
{
    CreateTimer(MyTimer, static_cast<Interval>(5000));
}

[top]Usage example (PAWN)

Code c:
forward MyTimer();
public MyTimer()
{
    // Timer function
    return 0;
}
main()
{
    CreateTimer("MyTimer", 5000);
}

[top]Related pages