in reply to Finding CPU stats on Win32?
use Win32::SystemInfo; # Get Memory Information print("Memory Info:\n"); my %mHash; Win32::SystemInfo::MemoryStatus(%mHash,"MB"); foreach (sort(keys(%mHash))) { print("$_\[$mHash{$_}M\]\n"); } print("\n"); # Get Processor Information my %pHash; my $proc = Win32::SystemInfo::ProcessorInfo(%pHash); print("Number of Processors[$pHash{NumProcessors}]\n"); foreach my $Processor (keys(%pHash)) { if($Processor ne 'NumProcessors') { print("Processor[$Processor]\n"); foreach (sort(keys(%{$pHash{$Processor}}))) { print("$_\[" . $pHash{$Processor}->{$_} . "\]\n"); } print("\n"); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Finding CPU stats on Win32?
by sona (Initiate) on Apr 23, 2007 at 15:37 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |