MachineInfo/ClockSpeed.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 32 CC 1 SCAR 6.9
CC
1
Cov
0%
get
2.0
units
2.0
BEGIN
2.0
CRAP 2.0
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