WMI Top Sample
http://www.alexfedotov.com/samples/wmitop.asp
http://www.alexfedotov.com/samples/wmitop.asp
WMI provides per-process processor usage information via the Win32_Process class. The KernelModeTime and UserModeTime properties of this class show the amount of time spent by a process in kernel and user modes respectively. These values show the time spent by the process from its beginning, and therefore cannot be used as a processor usage indicator directly. We have to make two snapshots of these values and then use some simple arithmetic to get processor usage.
http://www.alexfedotov.com/samples/wmitop.asp
浙公网安备 33010602011771号