tickcount alternatives
#1

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

gettime() returns the unix time (in seconds), which is the same for everyone.
Reply
#3

But I need milliseconds too.
Reply
#4

Multiply it by 1000 then.
Reply
#5

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.
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)