1CPU(3) User Contributed Perl Documentation CPU(3)
2
3
4
6 Sys::CPU - Perl extension for getting CPU information. Currently only
7 number of CPU's supported.
8
10 use Sys::CPU;
11
12 $number_of_cpus = Sys::CPU::cpu_count();
13 printf("I have %d CPU's\n",$number_of_cpus);
14 print " Speed : ",Sys::CPU::cpu_clock(),"\n";
15 print " Type : ",Sys::CPU::cpu_type(),"\n";
16
18 In responce to a post on perlmonks.org, a module for counting the
19 number of CPU's on a system. Support has now also been added for type
20 of CPU and clock speed. While much of the code is from
21 UNIX::Processors, win32 support has been added (but not tested).
22
23 v0.45 - Corrected solaris support (Thanks Cloyce)
24
25 v0.60 - Added FreeBSD support (Thanks Johan & SREZIC) v0.61 - Fix test
26 numbering issue
27
28 EXPORT
29 None by default.
30
32 Matt Sanford
33
35 Marc Koderer
36
39 perl(1), sysconf(3)
40
41
42
43perl v5.32.1 2021-01-27 CPU(3)