Monitor and display CPU state information in C #

Source: Internet
Author: User

in C # monitor and display CPU status information


         Brief Introduction
         This article describes an easy way to display CPU state information, and demonstrates how to display the percentage of processor time consumed by the CPU by configuring a performance counter and periodically polling the processor time percentage with a standard progress bar control and a label control.


Figure 1: Show CPU Processor Time

         This example can also be used to monitor multiple processors on a single computer, simply by getting the number of CPUs at run time (System.Environment.ProcessorCount can return this value) and dynamically adding performance Monitor controls. Let them monitor a CPU on their own.
         You can also extend the methods in this article, such as the following screenshot of a program that uses the Dundas. NET Gauge Control and displays the Intel Centrino Duo processor, although this example is not included in the article, but the idea is the same.


Figure 2: Monitoring each processor in a dual-core system


         Start Engineering
&nbs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.