Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 519
  • Last Modified:

High Performance Counter roll-over

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
pebler
Asked:
pebler
  • 3
1 Solution
 
nietodCommented:
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
 
nietodCommented:
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
 
peblerAuthor Commented:
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
 
nietodCommented:
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now