Article View: borland.public.cppbuilder.nativeapi
Article #11671Re: Performance
From: Detlef
Date: Thu, 29 Jan 2004 08:27
Date: Thu, 29 Jan 2004 08:27
37 lines
1911 bytes
1911 bytes
Hi John,
what happens if you use a thread with priority idle and check the time
between the calls?
::Execute()
{
LARGE_INTEGER StartT�me, EndTime;
while ( !Terminated)
{
QueryPerformanceCounter( &StartTime);
Sleep( 0);
QueryPerformanceCounter( &EndTime);
if( EndTime - StartTime < ATestedValue)
StartYourProcess
}
}
I don't know if there is a straight way to check the processor's load.
Detlef
"Johan Elms�ter" <johan.elmsater@bulletinboard.nu> schrieb im Newsbeitrag
news:401812c3@newsgroups.borland.com...
> Hi all,
>
> I would like to do a little short program that checks the cpu usage of the
> processor,
> for example it could check the process usage for the System idle process
> and if that
> is 99 percent the computer is not working and it's ok to run a program
that
> is dependent
> on a low processor load.
>
> Does anyone know how to solve this problem?
>
> Regards Johan
>
>
Technical Details
Message-ID:
<4018c3df@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<401812c3@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10cc67,1db9d2e0b85e8a9a X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-01-29 00:39:36 PST Reply-To: "Detlef" <detlef.stute@seatec-gmbh.com> From: "Detlef" <detlef.stute@seatec-gmbh.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <401812c3@newsgroups.borland.com> Subject: Re: Performance Date: Thu, 29 Jan 2004 09:27:45 +0100 Lines: 39 Organization: SEATEC GmbH X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 80.134.78.149 Message-ID: <4018c3df@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1075364831 80.134.78.149 (29 Jan 2004 00:27:11 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail