Re: Hello,

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Pedro,

This is not the correct forum for your question, as it is off-topic from GCC issues & questions.

For multitasking OS's (pretty much all modern OS's), to use "spare cycles" from the CPU, just make sure your background application is running at a lower priority than other processes (but one step higher priority than the "idle CPU" process!).

If you really want to understand CPU cycles and load, use Google to find pages that describe the "uptime" command, "load average" and the three load numbers (1, 5 and 15 minute loads). Get the source code for uptime, and use the same logic it uses.

Here's one such page:
http://www.luv.asn.au/overheads/NJG_LUV_2002/luvSlides.html

If you want a quick-and-dirty hack, periodically (once a minute?) run uptime, and scrape out the first load number.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux