Solved

High Performance Counter roll-over

Posted on 2000-03-21
4
512 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Apparent collision of square brackets in jQuery and Classic ASP 12 29
What namespace do I need to import? 2 29
PL SQL Developer 7 37
C# LINQ ForEach() question 6 28
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…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

831 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