Article View: borland.public.delphi.nativeapi
Article #12196QueryPerformanceFrequency Can Fail
From: Wim van der Vegt
Date: Sat, 23 Nov 2002 10:46
Date: Sat, 23 Nov 2002 10:46
32 lines
2153 bytes
2153 bytes
Hi,
Please be ware that the QueryPerformanceCounter api mentioned FAILS big time
on mobile pentiums (at least it does on my toshiba portege 7200). The reason
is that if you don't do a thing the clock speed is lowered so the cpu meters
show a 25Mhz machine. Moving the mouse raises the speed to 30-35 Mhz. Only
when something eats all cpu power i get the full rate of 650Mhz. This tends
to happen only when a application hangs. I think above also holds for
counting cpu cycles as thats clearly what happens inside the api too.
So depending on this api doesn't make it portable ;-)
----------------
Wim van der Vegt
"John Herbster (TeamB)" <herb-sci at novus-tele.net> wrote in message
news:3dde56cf$2@newsgroups.borland.com...
> "judy" <benny@chrysanth.com> wrote
> > Anyone use the QueryPerformanceCounter( ) ...
>
> I prefer to use the CPU clock count for most timing uses.
> It counts the CPU clock cycles (1 GHz or whatever) and
> never <g> rolls over. Regards, JohnH
>
> function GetCpuClockCycleCount: Int64;
> { Reads 64-bit TSC counter running at
> CPU clock speed. From Torjei Kvinen }
> asm
> dw $310F // opcode for RDTSC
> end;
>
>
>
Technical Details
Message-ID:
<3ddf5c91$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-08!supernews.com!iad-peer.news.verio.net!news.verio.net!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mailReferences:
<3dddc45c@newsgroups.borland.com> <3dde56cf$2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f94dd,64862bd85e1470d9 X-Google-Attributes: gidf94dd,public X-Google-ArrivalTime: 2002-11-23 03:15:33 PST From: "Wim van der Vegt" <wvd_vegt@knoware.nl> Newsgroups: borland.public.delphi.nativeapi References: <3dddc45c@newsgroups.borland.com> <3dde56cf$2@newsgroups.borland.com> Subject: QueryPerformanceFrequency Can Fail Date: Sat, 23 Nov 2002 11:46:38 +0100 Lines: 34 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 145.20.176.143 Message-ID: <3ddf5c91$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1038048401 145.20.176.143 (23 Nov 2002 02:46:41 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-08!supernews.com!iad-peer.news.verio.net!news.verio.net!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail