SA-MP Forums Archive
timer is slow - 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)
+--- Thread: timer is slow (/showthread.php?tid=576981)



timer is slow - ToPhrESH - 08.06.2015

Hey on my server it has a timer that takes like double as long as it should. instead of counting down from 5 seconds it takes like 10 seconds counts down twice as slow.

its only on this host im using but on my older host it worked fine and normal.. does anyone know how to fix this? i think its something in the server config or stream? thanks


Re: timer is slow - Gammix - 08.06.2015

Try using a timer fix:
https://sampforum.blast.hk/showthread.php?tid=571505
https://sampforum.blast.hk/showthread.php?tid=289675

Or else make debug for your script, specially debuging the interval count. Checking after how much time it's called.

And checking the time taken to end the callback. For example:
pawn Код:
public My_Timer()
{
    new tick = GetTickCount();

    //your script starts from here
    printf("debug start: %i", GetTickCount() - tick);
   
    //your code
   
    //your script ends from here
    printf("debug end: %i", GetTickCount() - tick);
}



Re: timer is slow - ToPhrESH - 08.06.2015

Can an administrator move this to support.. I think I put this in the wrong section..
It's nothing wrong with the coding, but instead when I move the gamemode on different hosts the timers mess up.

I got a new host and instead of counting down from 5 to 1 normally in 5 seconds it counts down slowly from 5 to 1 and takes like 10 seconds instead of 5.. all the number values are like doubled

on my other host its normal, everything works fine ill upload a video to show you.


Re: timer is slow - ToPhrESH - 08.06.2015

https://www.youtube.com/watch?v=LJYHE8rAx88

see the timer going down so slow and the time below counting really slow