eg/MyTimer.pm

filter: Statementstmt 100% 26 / 26 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 3 / 3 totaltotal 97.4% 38 / 39 CC 2 SCAR 2.0
CC
2
Cov
96%
initialize
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Devel/Timer.pm ↑ Summary
1 package MyTimer;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 ##
6 ## This is an example of how to subclass Devel::Timer
7 ##
8  
9 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Devel::Timer;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 @ISA = ("Devel::Timer");
14  
15 1 ▶sub initialize {
Subroutine initialize: called CC=2 SCAR=7.0
Pod documented
16 1 my ($self) = @_;
17  
18 1 my $log = "timer.log";
19 1 ▶ open(my $fh, '>>', $log) or die("Unable to open [$log] for writing.");
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, ">>", $log or die "Unable to open [$log] for writing." 1 0 1
20 1 $self->{MyTimer_fh} = $fh;
21 }
22  
23 7 ▶sub print {
Subroutine print: called CC=1 SCAR=0.0
Pod documented
24 7 my($self, $msg) = @_;
25 7 print {$self->{MyTimer_fh}} $msg . "\n";
26 }
27  
28 2 ▶sub shutdown {
Subroutine shutdown: called CC=1 SCAR=0.0
Pod documented
29 2 my ($self) = @_;
30 2 close $self->{MyTimer_fh};
31 }
32  
33 1 1;
34  
« blib/lib/Devel/Timer.pm ↑ Summary