Re: CPU/Memory usage of a process on Windows machine




You have to add UserModeTime and KernelModeTime then
divide by 10,000,000.

See:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept05/hey0922.mspx

use Win32::Process::Info;
use Data::Dumper;

my $pi = Win32::Process::Info->new ();
my @process_information = $pi->GetProcInfo(3692);


foreach my $info (@process_information) {
foreach my $key (keys %{$info}) {
if ($key eq "Name" or $key eq
"WorkingSetSize" or
$key eq "UserModeTime" or $key eq
"KernelModeTime") {
my $value = ${$info}{$key};
print "\n$key: => $value \n";
}
}
}

~




____________________________________________________________________________________
Got a little couch potato?
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
.