SA-MP Forums Archive
Timers - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Timers (/showthread.php?tid=192451)



Timers - Pooh7 - 22.11.2010

Which method is better?

pawn Код:
SetTimer("func1", 500, false);
SetTimer("func2", 1000, false);
SetTimer("func3", 1500, false);
SetTimer("func4", 2000, false);
SetTimer("func5", 2500, false);
SetTimer("func6", 3000, false);
// lots of timers
// lots of timers
// lots of timers


or




pawn Код:
SetTimer("func1", 500, false);

public func1()
{
   //very small code
   SetTimer("func2", 500, false);
   return 1;
}

public func2()
{
   //very small code
   SetTimer("func3", 500, false);
   return 1;
}

public func3()
{
   //very small code
   SetTimer("func4", 500, false);
   return 1;
}

public func4()
{
   //very small code
   SetTimer("func5", 500, false);
   return 1;
}

public func5()
{
   //very small code
   SetTimer("func6", 500, false);
   return 1;
}

public func6()
{
   //very small code
   SetTimer("func7", 500, false);
   return 1;
}

// lots of same functions
// lots of same functions

I want to make about 50 timers with 500ms interval. Functions would including only SetCameraPos and SetCameraLookAt, nothing more.

So, what method is better and faster?


Re: Timers - [MWR]Blood - 22.11.2010

I think the second way is better.