🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages Started by poojo hackma Wed, 27 Jun 2007 16:28
QueryPerformanceFrequency changes?
#1659
Author: poojo hackma
Date: Wed, 27 Jun 2007 16:28
18 lines
1899 bytes
Does the QueryPerformanceFrequency value on a system change often?

I am currently editing some code that is about 10 years old, and the first 
few lines of each section in many parts of the code call 
QueryPerformanceFrequency and return if the result is zero.

From what I understand, QueryPerformanceFrequency will return zero only when 
the hardware does not support the high-resolution performance counter.

So, whenever my class initializes, I'd like to call 
QueryPerformanceFrequency and store the value in a class variable so that it 
does not have to be called again and again.

But, is there any reason for a system to return different values at 
different times? I don't understand why the old code calls this API so often 
if it just returns the same LARGE_INTEGER value every time.

Could someone explain? Was this bad coding years ago, or was there a reason? 
Re: QueryPerformanceFrequency changes?
#1669
Author: Bob Gonder
Date: Thu, 28 Jun 2007 02:47
9 lines
1319 bytes
poojo hackma wrote:

>Does the QueryPerformanceFrequency value on a system change often?

From the help on that function:

The QueryPerformanceFrequency function retrieves the frequency of the high-resolution
performance counter, if one exists. The frequency cannot change while the system is
running
Re: QueryPerformanceFrequency changes?
#1674
Author: poojo hackma
Date: Thu, 28 Jun 2007 13:00
11 lines
1323 bytes
So, bad coding years ago.

That's what I thought, but I wanted to make sure.

"Bob Gonder" wrote:
>
> From the help on that function:
>
> The frequency cannot change while the system is running
>
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads