Optimization
#1

Hello,

First, sorry for my bad English, it isn't my first language.

I've a question about optimization in my script. Which of the following proposals is the best ?

Код:
public OnPlayerConnect(playerid)
{
        SetTimerEx("Timer", 1000, false, "i", playerid);
        return 1;
}

public Timer(playerid)
{
       SendClientMessage(playerid, -1, "Example message");
}
OR



Код:
public OnGameModeInit()
{
        SetTimer("Timer", 1000, false);
        return 1;
}

public Timer()
{
       for(new i=0; i<MAX_PLAYERS; i++)
       {
              if(IsPlayerConnected(i))
              {
                   SendClientMessage(i, -1, "Example message");
              }
       }
}
Actually, I'd have said the second one is such better than the first because he has less timer of course but I'd like to have a confirmation.

Thank you for your help.
Etolas
Reply


Messages In This Thread
Optimization - by Etolas - 20.02.2015, 07:00
Re: Optimization - by Kenway - 20.02.2015, 07:04
Re: Optimization - by Etolas - 20.02.2015, 07:06
Re: Optimization - by CalvinC - 20.02.2015, 07:09
Re: Optimization - by Kenway - 20.02.2015, 07:10
Re: Optimization - by Etolas - 20.02.2015, 07:12
Re: Optimization - by arakuta - 20.02.2015, 10:13
Re: Optimization - by AndySedeyn - 20.02.2015, 10:30
Re: Optimization - by CalvinC - 20.02.2015, 10:39
Re: Optimization - by Kyance - 20.02.2015, 13:02

Forum Jump:


Users browsing this thread: 1 Guest(s)