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.