tickcount alternatives - 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: tickcount alternatives (
/showthread.php?tid=444663)
tickcount alternatives -
hbzi - 17.06.2013
Hey everyone. I'm here to ask you for alternatives to the tickcount function.
At a windows OS I get normal ticks, but when I changed to linux I get ridiculous low ticks.
Is there an alternative to count milliseconds?
Thanks in advance.
Re: tickcount alternatives -
Sinner - 17.06.2013
gettime() returns the
unix time (in seconds), which is the same for everyone.
Re: tickcount alternatives -
hbzi - 17.06.2013
But I need milliseconds too.
Re: tickcount alternatives -
Cameryn - 17.06.2013
Multiply it by 1000 then.
Re: tickcount alternatives -
hbzi - 17.06.2013
What's the point of having 5 seconds or 5.000 seconds?
I need exact milliseconds like tickcount provides.
I'm trying with Timers but I guess it's not working:
pawn Код:
timers[0][playerid] = SetTimerEx("Milis", 1, 1, "i", playerid);
forward Milis(playerid);
public Milis(playerid)
{
timers[1][playerid]++;
}
It gives me always 0.
Re: tickcount alternatives -
Sinner - 18.06.2013
Quote:
Originally Posted by hbzi
But I need milliseconds too.
|
GetTickCount() is meant as a measurement of time relative to another one (so for example counting the time that has passed), not an absolute measurement (like gettime(), which is always the same). If your implementation relies on GetTickCount() always being the same you're not using it correctly. With this in mind, any implementation that needs to use gettime() doesn't require that much accuracy.