Efficient Timing
#7

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
pawn Код:
millisecond_time_counter += GetTickCount() - lastMillis; // += time passed since last timer call
lastMillis = GetTickCount();
As this adds just the time that passed by since the last timer call, you got the sharp time AND the ability to set the time ingame (by modifying the millisecond_time_counter). GetTickCount should be quite lighweighted and shouldnt cause any lag.
This is my favourite method when it comes to measure time for whatever.
Important Note: GetTickCount will cause problems on servers with uptime of over 24 days (physical server, not SA:MP server) as GetTickCount will eventually warp past the integer size constraints.
Reply


Messages In This Thread
Efficient Timing - by Audiophr3ak - 21.09.2012, 05:03
Re: Efficient Timing - by Babul - 21.09.2012, 11:09
Re: Efficient Timing - by Audiophr3ak - 21.09.2012, 12:00
Re: Efficient Timing - by Basssiiie - 21.09.2012, 12:40
Re: Efficient Timing - by nickdodd25 - 21.09.2012, 20:39
Re: Efficient Timing - by Mauzen - 21.09.2012, 21:15
Re: Efficient Timing - by Audiophr3ak - 22.09.2012, 09:36

Forum Jump:


Users browsing this thread: 1 Guest(s)