mIRC Home    About    Download    Register    News    Help

Print Thread
More accurate $ticks #75913
20/03/04 01:28 PM
20/03/04 01:28 PM
Joined: Mar 2004
Posts: 5
E
Epsil0n Offline OP
Nutrimatic drinks dispenser
Epsil0n  Offline OP
Nutrimatic drinks dispenser
E

Joined: Mar 2004
Posts: 5
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.

Re: More accurate $ticks #75914
21/03/04 10:02 AM
21/03/04 10:02 AM
Joined: Mar 2003
Posts: 1,271
Sunnydale, CA
L
LocutusofBorg Offline
Hoopy frood
LocutusofBorg  Offline
Hoopy frood
L

Joined: Mar 2003
Posts: 1,271
Sunnydale, CA
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?



DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: More accurate $ticks #75915
21/03/04 10:47 AM
21/03/04 10:47 AM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
tidy_trax  Offline
Hoopy frood
T

Joined: Nov 2003
Posts: 2,327
it's 10 for me too.


New username: hixxy
Re: More accurate $ticks #75916
21/03/04 12:11 PM
21/03/04 12:11 PM
Joined: Dec 2002
Posts: 2,962
Norwich, UK
S
starbucks_mafia Offline
Hoopy frood
starbucks_mafia  Offline
Hoopy frood
S

Joined: Dec 2002
Posts: 2,962
Norwich, UK
$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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: More accurate $ticks #75917
23/03/04 07:21 PM
23/03/04 07:21 PM
Joined: Oct 2003
Posts: 101
root66 Offline
Vogon poet
root66  Offline
Vogon poet

Joined: Oct 2003
Posts: 101
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.

Re: More accurate $ticks #75918
24/03/04 10:47 AM
24/03/04 10:47 AM
Joined: Mar 2004
Posts: 5
E
Epsil0n Offline OP
Nutrimatic drinks dispenser
Epsil0n  Offline OP
Nutrimatic drinks dispenser
E

Joined: Mar 2004
Posts: 5
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