Output:use strict; use warnings; use Win32::Process::Info; use Data::Dumper; my $pio_2 = Win32::Process::Info->new (); my @pids = $pio_2->ListPids (); my @proc_info; my @wantedInfoTypes = qw{ Name WorkingSetSize UserModeTime KernelModeTime }; my @InterestingExecutables = qw{ VISIO.exe cmd.exe notepad.exe skype.exe GoogleDesktop.exe wmplayer.exe }; for my $pid (@pids) { @proc_info = $pio_2->GetProcInfo($pid); for my $info (@proc_info) { grep /$info->{Name}/i, @InterestingExecutables or next; for my $infoType ( @wantedInfoTypes ) { print qq{\n$infoType => \n}, q{-} x length $infoType, qq{$info->{$infoType}\n}; } } }
Note - there ARE INDEED multiple instances of googledesktop running on my PC.Name => ----GoogleDesktop.exe WorkingSetSize => --------------7118848 UserModeTime => ------------90.5117802 KernelModeTime => --------------149.3085571 Name => ----GoogleDesktop.exe WorkingSetSize => --------------3760128 UserModeTime => ------------62.3379996 KernelModeTime => --------------115.8931429 Name => ----wmplayer.exe WorkingSetSize => --------------45211648 UserModeTime => ------------87.5009609 KernelModeTime => --------------72.3532638 Name => ----GoogleDesktop.exe WorkingSetSize => --------------7290880 UserModeTime => ------------367.5071558 KernelModeTime => --------------239.1651331 Name => ----Skype.exe WorkingSetSize => --------------45948928 UserModeTime => ------------3.8376246 KernelModeTime => --------------2.7144174 Name => ----VISIO.EXE WorkingSetSize => --------------56135680 --snip---
Update:Ignore my hack - BrowserUk (++) posted much better code while I was hacking.
"An undefined problem has an infinite number of solutions." - Robert A. Humphrey "If you're not part of the solution, you're part of the precipitate." - Henry J. Tillman
In reply to Re: Win32... CPU/RAM usage
by NetWallah
in thread Win32... CPU/RAM usage
by mikejones
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |