🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1659

QueryPerformanceFrequency changes?

#1659
From: 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? 
Technical Details
Message-ID: <4682904a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.news-service.com!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f4affa0656eef7ca,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "poojo hackma" <poojo.com/mail>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: QueryPerformanceFrequency changes?
Date: Wed, 27 Jun 2007 11:28:59 -0500
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-Antivirus: avast! (VPS 000752-1, 06/26/2007), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 12.191.89.68
Message-ID: <4682904a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1182961738 12.191.89.68 (27 Jun 2007 09:28:58 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.news-service.com!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail