Timers (advanced question, not beginner)

Started by
8 comments, last by dpadam450 16 years, 4 months ago
I'm using windows functions: QueryPerformance... QueryPerformanceFreq() in DevC++ returns 3.5 e6 (3.5 Ghz which I'm on AMD 3500+) QueryPerformanceFreq() in VS2005 returns 7.0e+010 Acutally after copying this its strange that they are very very close to a 2.0 multiplier. (I didnt show every digit thats why im saying close). Maybe because its running in debug? I couldnt get release mode to work cuz of a library issue. I'm going to try to get that up and see.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Advertisement
Well I got the release mode working but its the same result. I'm going to test this on some other machines at school with different processors.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

The AMD 3500+ doesn't run at 3.5ghz. It runs at 2.2ghz. That, and 3.5e6 is actually 3.5 million (which would, by your metric, be 3.6mhz) and not 3.5 billion. Also, the difference between 3.5e6 and 7.0e10 is a lot more than 2x. It's more like 4 orders of magnitude.

Besides, it shouldn't matter. The results of QueryPerformanceFreq() should only really be used in conjunction with the results from QueryPerformanceCounter(), so the timer results will be consistent either way.
NextWar: The Quest for Earth available now for Windows Phone 7.
Are you sure you handle 64-bit integers the same way on both platforms? Maybe the one in DevC++ got shortened.
Well your right in the math logic.

The thing is, DevC++, my particles work correctly I took the final time in seconds and multiplied by the framerate given from Fraps, and I got 1.

In MSoft, uhm my particles move like a hair each frame and I think its cuz that 7.blah e10 is so damn big.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

I love "advanced, not beginner" questions :D

Quote:returns 7.0e+010

You have a bug somewhere; there's no way a timer is running at 70 GHz.
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3
Its not my code, how can there be a bug. I call a windows function and it gives me that number.


Anyway, you're supposed to use the ".QuadPart" right? I mean like i said, this all works in DevC++.

LARGE_INTEGER freq;

freq = 9813606787
freq.QuadPart = 10311586962
freq.HighPart = 2
freq.LowPart = 2092886133

Should I just use a different timer method all together?

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Quote:Original post by dpadam450
Its not my code, how can there be a bug.


Can I use that as my signature?
Look at the way they do it in Ogre3D source code since they compensate for speedstepped cpu's.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
It got solved. Sent it to a friend. Really weird how he fixed it though. Didn't make sense.

As for the Scuppy guy, I figured someone would think I'm saying that in an amateur way, but what I meant was this way: If I call a void function taking void as the paramter and it returns 455, but its returning -1, then I have no damn effect on that function. And if it is said to be an algorithm and work all the time, then its not a bug, its some other b/s happening somewhere.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement