| Processors(3pm) | User Contributed Perl Documentation | Processors(3pm) |
Unix::Processors - Interface to processor (CPU) information
use Unix::Processors;
my $procs = new Unix::Processors;
print "There are ", $procs->max_online, " CPUs at ", $procs->max_clock, "\n";
if ($procs->max_online != $procs->max_physical) {
print "Hyperthreading between ",$procs->max_physical," physical CPUs.\n";
}
(my $FORMAT = "%2s %-8s %4s \n") =~ s/\s\s+/ /g;
printf($FORMAT, "#", "STATE", "CLOCK", "TYPE", );
foreach my $proc (@{$procs->processors}) {
printf ($FORMAT, $proc->id, $proc->state, $proc->clock, $proc->type);
}
This package provides accessors to per-processor (CPU) information. The object is obtained with the Unix::Processors::processors call. the operating system in a OS independent manner.
The latest version is available from CPAN and from <http://www.veripool.org/>.
Copyright 1999-2017 by Wilson Snyder. This package is free software; you you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.
Wilson Snyder <wsnyder@wsnyder.org>
Unix::Processors::Info, Sys::Sysconf
| 2024-03-31 | perl v5.38.2 |