which of the two would consume less CPU from my se...
# support-forum
c
which of the two would consume less CPU from my server?
Copy code
c++
// GameModeInit
SetTimer("FuncThatLoopForAllPlayers1", 250, true);
SetTimer("FuncThatLoopForAllPlayers2", 1000, true);
SetTimer("FuncThatLoopForAllPlayers3", 1250, true);

// example function
public FuncThatLoopForAllPlayers1() {
  foreach(new i : Player) {
      if(Logged[i] > 0)
      {
        // do func stuff
      }
  }
}
or
Copy code
c++
// GameModeInit
for(new i = 0; i < MAX_PLAYERS; ++i) {
  SetTimerEx("FuncThatRecivePlayerIdAsParameter1", 250, true, "i", i);
  SetTimerEx("FuncThatRecivePlayerIdAsParameter2", 1000, true, "i", i);
  SetTimerEx("FuncThatRecivePlayerIdAsParameter3", 1250, true, "i", i);
}

// example function
public FuncThatRecivePlayerIdAsParameter1(i) {
  if(Logged[i] > 0)
  {
    // do func stuff
  }
}