mIRC Homepage
Posted By: Epsil0n More accurate $ticks - 20/03/04 01:28 PM
Hello,

Is it possible to implement a second alias, that works like ticks but with more accuracy ?

$ticks is limited to 10ms accuracy (it uses the WinAPI fct GetTickCount() ), and this is a real problem when dealing with benchmarks of code that takes less than 10ms to gets executed... (very common on CPU > 2 GHz).

And furthermore, it prevents from synchronising the frame rates in the case of picwin demos and games, above 60 FPS.

A new identifier that would return the ticks in microseconds would be really good. Or a ticks with an accuracy of 1ms.

Here the code I used in a dll to add this functionnality in mIRC :

LARGE_INTEGER microtime;
LARGE_INTEGER freq;
QueryPerformanceCounter(&microtime);
QueryPerformanceFrequency(&freq);
wsprintf(data,"%I64i",microtime.QuadPart * 1000 /freq.QuadPart);

It queries the high res timer of the CPU to get an accurate $ticks.

Thanks.
Posted By: LocutusofBorg Re: More accurate $ticks - 21/03/04 10:02 AM
10 ms? In all my scripts, on all the OSs I have used, 1 ticks is equal to 1 millisec rather than 10... Where did you get the number 10?

Posted By: tidy_trax Re: More accurate $ticks - 21/03/04 10:47 AM
it's 10 for me too.
Posted By: starbucks_mafia Re: More accurate $ticks - 21/03/04 12:11 PM
$ticks has a resolution of 1ms, but it's accuracy is (allegedly) closer to 10ms. I'm not really sure how and where this major lack of accuracy comes into play though, since $ticks works just fine for 1ms accuracy when benchmarking in mIRC.
Posted By: root66 Re: More accurate $ticks - 23/03/04 07:21 PM
It is around 10. I am not sure I see a need to get any more accurate unless you want an atomic uptime script, but I guess I see your point. Also I am glad my posts arent the only ones that locutus tries to debunk with no info to back it up.
Posted By: Epsil0n Re: More accurate $ticks - 24/03/04 10:47 AM
I need it for picture windows games and demos frame rate regulation.

And also to synchronize the FPS between two distant computers.

So i need to calc the time for a frame to be drawn, but mIRC's $tick limitation made it impossible to calc above 60 FPS

(because 1000 / 60 = 16.66ms, and the $ticks accuracy show its limit there).

I don't want a nuclear uptime info, I want games to run fine on any FPS above 60

ex: a ball would move from steps of 60 pixels/frames at 10 FPS, and of 6 pixels/frames a 100FPS, so during 1sec the distance is always the same, whatever the FPS is.

BUT I need to calc the time of the frame processing, and on a 2.6GHZ it takes less than 3ms on a complicated game...

more info on www.picwin.tk if you want to discuss about game programming under mIRC
© mIRC Discussion Forums