CPU stands for 'central processing unit' and is, in the most basic terms, the part of the computer that makes things happen - its heart. CPU time is an important measure for any machine as it shows the user the amount of their CPU's computational power that is being used and how it is being shared among all the programs they may have running. It is measured either in clock 'ticks' or 'seconds' (people often speak of CPU clock cycles) or via the percentage of the CPU's maximum capacity which is in use at the given time.
Intel Sandy Bridges CPU core circa 2009
CPU time is how long a CPU took in the actual processing of a computer program's instructions, not including the time taken up waiting to input and receive output for operations. In cases where a machine is running multiple processors simultaneously using a parallel processing schedule, this measure is calculated over the total CPU time used between them by the program.
Elapsed real time is how long a computer program takes from its initial state to the end, including waiting for input and output as well as any interrupts and other waits. This is measure using time from an ordinary clock and is always at least equal to CPU time (though often larger).
CPU utilisation can be an excellent measure of the performance of a piece of code you have written. The less percentage of the total CPU capacity a a program uses, the more efficient it is in terms of both power and processor use. A program may take up slightly different CPU times on different machines due to architect discrepancies but a huge increase on one machine may indicate a bug.
Photo credit Eric Gaba
© BrainMass Inc. brainmass.com March 28, 2024, 10:12 pm ad1c9bdddf