Timers
#1

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?
Reply
#2

I think the second way is better.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)