Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2005

Tip: Looking for answers? Try searching our database.

Cpu Usage (Second Posting)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paulo Eduardo - 26 Jun 2005 22:13 GMT
Hi, all!

Thanks a lot for your responses.  We are using the GetProcessTimes  for
calculation of cpu usage.  We are using the following calcution for get cpu
usage:

(((NUserTime - OUserTime) + (NKernelTime - OKernelTime))*100) /  (NTime -
OTime)/NumProcessors,
where
 NUserTime - is the user time during process execution
 OUserTime - is the last user time  during process execution
 NKernelTime - is the kernel time during process execution
 OKernelTime- is the kernel time during process execution
  NTime - is the current time
  OTime - is the last time
  NumProcessors - is the number of processors.

Are we right?

Thanks a lot in advance.

Best regards,
Paulo Eduardo

 
Hendrik Schober - 27 Jun 2005 12:07 GMT
> [...]
> Are we right?

 That depends on what you want to do.
 From what I read in the other thread, you want
 your thread/process to never use more than 20%
 of the CPU time. Actually, as a user, I wouldn't
 want this. What I wanted instead is that it uses
 all idle time. Why throttle it back if my machine
 sits around idly?
 Which is where setting priorities comes in. If my
 machine is busy, it will prevent a low-priority
 thread/process from getting much CPU time. if my
 machine is idle, it will even give CPU time to
 the low-priority threads/processes.
 That's what the OS' scheduler is for.

> Thanks a lot in advance.
>
> Best regards,
> Paulo Eduardo

 Schobi

Signature

SpamTrap@gmx.de is never read
I'm Schobi at suespammers dot org

"Coming back to where you started is not the same as never leaving"
Terry Pratchett


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.