Greetings
I am trying to find CPU and memory usage on a windows machine and i
was able to get through memory usage using Win32::Process::Info
module's GetProcInfo function.
This code may be helpfull to others which calculate the memory usage
of a particular process on windows
#!c:/perl/bin/perl.exe
# This is a test scrip
use Win32::Process::Info;
use warnings;
use strict;
my $pi = Win32::Process::Info-new ();
my @process_information = $pi-GetProcInfo(4488);
## 4488 is pid of a
particular process.
foreach $info (@process_information) {
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);