Article View: borland.public.cppbuilder.nativeapi
Article #4405Re: CPU load - How can I measure it?
From: Bob Gonder
Date: Sun, 05 Feb 2006 16:55
Date: Sun, 05 Feb 2006 16:55
14 lines
1486 bytes
1486 bytes
Alberto wrote: >I would like, using some Windows API, to measure constantly how much CPU >load my program is imposing on the processor, with the goal of reducing some >functionalities if the load is approaching 100%, all in a manner transparent >to the user. The simplest way to do that is to let Windows do it for you. Do your processing in threads, and set their priority one step down from normal. SetThreadPriority() If you are really set on knowing exactly how much time you are using, take a look at GetProcessTimes()
Technical Details
Message-ID:
<40bcu1hlup9hqfr2qfnl6ob26jaudlqvmt@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<43e53514@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e1eea742f875d72d X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: CPU load - How can I measure it? Date: Sun, 05 Feb 2006 08:55:59 -0800 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <40bcu1hlup9hqfr2qfnl6ob26jaudlqvmt@4ax.com> References: <43e53514@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 69.69.80.93 X-Trace: newsgroups.borland.com 1139158347 69.69.80.93 (5 Feb 2006 08:52:27 -0700) Lines: 17 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail