Search

open.mp forum

RegisterLogin

Discussion

General
Chat
Tech
Life
Art
Programming
open.mp
Development Updates
Questions and Suggestions
SA-MP
General Discussions
Videos and Screenshots
Support
Pawn Scripting
Tutorials
Releases
Plugins
Libraries
Filterscripts
Gamemodes
Maps
Advertisements
Other languages
Spanish/Espa?ol
Programaci?n
Discusi?n GTA SA Multijugador
Mods
Offtopic
Juegos
Portuguese/Portugu?s
Russian/???????
Italian/Italiano
Dutch/Nederlands
German/Deutsch
Romanian/Rom?na
Ex-Yu
Polish/Polski
Og?lne
Serwery
Skryptowanie
Filmiki i zdjecia
Lithuanian/Lietuvi?kas
French/Fran?ais
Hungarian/Magyar
Hindi/Urdu
Turkish
Other
Internal
Team
Hidden
Archived

Library

 Collections Links Members Roles

Best practice with timers

Hello guys!? I would like to ask a question about the use of timers.? Suppose I have several systems that do checks from time to...

ID
d6ouivnilegovhg7bm70
author
rhaegarx's avatar

RhaegarX

@rhaegarx


View profile
Copy link
  Report member
started
Jan 21, 2021
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Pawn Scripting
Best practice with timers
rhaegarx's avatar

RhaegarX

@rhaegarx


View profile
Copy link
  Report member
• 5y
Pawn Scripting

Best practice with timers

pawn

Hello guys!? I would like to ask a question about the use of timers.? Suppose I have several systems that do checks from time to time, the best way would be to create a single timer that does all the checks or create multiple timers to check each thing?? Which way would be the most optimized and least burdensome on the server?

Code 1:

SetTimer("ExecuteAll", 1000, false);

public ExecuteAll()
{
    // Verification 1
    // Verification 2
    // Verification 3
    ...
}



Code 2:

SetTimer("Execute1", 1000, false);
SetTimer("Execute2", 1000, false);
SetTimer("Execute3", 1000, false);

public Execute1()
{
    // Verification 1
}
public Execute2()
{
    // Verification 2
}
public Execute3()
{
    // Verification 3
}
0 likes0 replies

    Please sign up or log in to reply