Solved

High Performance Counter roll-over

Posted on 2000-03-21
4
506 Views
Last Modified: 2013-12-03
When does the Pentium class CPU high-performance counter roll-over? QueryPerformanceCounter() returns the count in a LONGLONG, but how high does it actually get before it wraps around to zero?
0
Comment
Question by:pebler
  • 3
4 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 200 total points
ID: 2642878
You'll won't live to see it!

Even if the performance counter ticks off CPU cycles on a 1000MHz machine the counter (and it isn't that accurate)  it can still count for thousands of centuries.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2644331
Why the bad grade?  If you don't like and answer or if it is incomplete, you can ask for additional details instead of giving a bad grade.  But I don't think there are additional details to give in this case....
0
 

Author Comment

by:pebler
ID: 2645655
Didn't I give it a "good"?
I suppose I should have rather asked "how many bits is used by the counter?"
Even a 64-bit counter at 1000MHz would only count for 5.85 centuries, not thousands. The counters do only go at around 1Mhz, and 585000 years certainly is long enough, but if the counter was say 48-bits, you're down to 9 years. Also good enough of course, but if for some really odd reason fewer bits are used, you start getting into reasonable amounts of time. Even though your numbers were off (unless it's actually more than 64 bits?) I took your answer to mean 64-bit or at least 48-bit.
You're right that I should have asked for more details before accepting the answer. This is only the second question I've asked here, and I wasn't really thinking about how it would affect your points, or rating or whatever. Sorry about that.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2645926
The counter is 64 bits.   When I did the math I got thoundands of centuries.

I did it again and I got 5.85 centuries too.  I probably did 1000Hz, not 1000Mhz.   Since it is hard to keep a windows computer running for a day without a crash, that should be sufficient though.

>>  I wasn't really thinking about how it
>> would affect your points
It gets permenantly recorded in our record and I don't like to see many C's.  So please be more careful in the future.  (If an answer deserves a C, that is different, but usually that just means you need to "talk" to the expert som more.)
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now