| 1 | =head1 NAME | ||
| 2 | |||
| 3 | Probe::MachineInfo::ClockSpeed - Clock Speed | ||
| 4 | |||
| 5 | =head1 SYNOPSIS | ||
| 6 | |||
| 7 | blah | ||
| 8 | |||
| 9 | =head1 DESCRIPTION | ||
| 10 | |||
| 11 | blah | ||
| 12 | |||
| 13 | =head1 PUBLIC INTERFACE | ||
| 14 | |||
| 15 | =cut | ||
| 16 | |||
| 17 | package Probe::MachineInfo::ClockSpeed; | ||
| 18 | |||
| 19 | |||
| 20 | # pragmata | ||
| 21 | use base qw(Probe::MachineInfo::Metric); | ||
| 22 | use strict; | ||
| 23 | use warnings; | ||
| 24 | |||
| 25 | |||
| 26 | # Standard Perl Library and CPAN modules | ||
| 27 | use English; | ||
| 28 | use Unix::Processors; | ||
| 29 | |||
| 30 | # | ||
| 31 | # CLASS ATTRIBUTES | ||
| 32 | # | ||
| 33 | |||
| 34 | # | ||
| 35 | # CONSTRUCTOR | ||
| 36 | # | ||
| 37 | |||
| 38 | |||
| 39 | =head2 get | ||
| 40 | |||
| 41 | get() | ||
| 42 | |||
| 43 | Uses Unix::Processors to return the number of processors on the machine. If | ||
| 44 | possible it returns undef. | ||
| 45 | |||
| 46 | =cut | ||
| 47 | |||
| 48 | sub get { | ||
| 49 | my ($self) = @_; | ||
| 50 | |||
| 51 | my $proc = Unix::Processors->new(); | ||
| 52 | my $speed; | ||
| 53 | eval { | ||
| 54 | $speed = $proc->max_clock(); | ||
| 55 | }; | ||
| 56 | return $speed; | ||
| 57 | } | ||
| 58 | |||
| 59 | =head2 units | ||
| 60 | |||
| 61 | units() | ||
| 62 | |||
| 63 | mins | ||
| 64 | |||
| 65 | =cut | ||
| 66 | |||
| 67 | sub units { | ||
| 68 | my ($self) = @_; | ||
| 69 | |||
| 70 | return "MHz"; | ||
| 71 | } | ||
| 72 | |||
| 73 | 1; | ||
| 74 | |||
| 75 | =head1 AUTHOR | ||
| 76 | |||
| 77 | Sagar R. Shah | ||
| 78 | |||
| 79 | =cut |