CPU Usage Vs. Processor Timeby Al Heurung
Central processing unit (CPU) usage and processor time are valuable indicators of a program's efficiency of operation. They can be used to not only enhance and optimize a program by developers but to diagnose what may be causing system slowdowns by users. In Microsoft Windows, there are included tools with which system performance can be monitored. Using the Performance Monitor tool included with Windows allows an overall snapshot of CPU usage as well as statistics to analyze how the CPU is being used.
Monitoring the Information
This information can be accessed by clicking "Start," typing "Perfmon" in the search box and hitting "Enter." This will bring up the Performance Monitor tool. Along the left side will be a list of tools available in the Performance Monitor. Click "Monitoring Tools" and then "Performance Monitor" to bring up a real-time graph of system processor time. Right-clicking "Monitoring Tools" and selecting "Resource Monitor" will also bring up a more conventional Windows resource-monitoring tool that can display CPU usage. This data can be added into the Performance Monitor via the "+" button at the top.
CPU usage is a measure of how much overall processor is used at any given time. With multicore processors now the standard, it can create some confusion regarding totals. Processes are queued up and then fed to the multiple cores on the CPU to be processed in parallel. As each core is independently processing the data that is sent to it, the results are then averaged across the processor cores and the overall output is rated from 0 to 100 percent.
Processor time is a measure of how much time the processor spends on any particular process, expressed in a ratio. The amount of time a processor is occupied by the data it is processing is figured as a percentage of overall time that the processor is active. Each processor has an idle thread it runs when not processing other data. The amount of time the processor spends running the idle thread is measured in intervals and then subtracted from 100 percent.
How They Integrate
CPU usage and processor time are used together to measure efficiency of programming, especially with multicore processors. When examining how each process is queued and then handled by each core, and for how long each process triggers the processor time of each core, developers can optimize programs so as not to lock up CPUs with multiple function calls coming all at once and thus temporarily freezing a computer. They can also optimize instructions to load in a more orderly fashion, letting the processor cores handle the instructions in the most efficient manner possible.