line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MyTimer; |
2
|
1
|
|
|
1
|
|
623
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
## |
6
|
|
|
|
|
|
|
## This is an example of how to subclass Devel::Timer |
7
|
|
|
|
|
|
|
## |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
2
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
13
|
|
10
|
1
|
|
|
1
|
|
338
|
use Devel::Timer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
11
|
1
|
|
|
1
|
|
4
|
use vars qw(@ISA); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
135
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
@ISA = ("Devel::Timer"); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub initialize { |
16
|
1
|
|
|
1
|
1
|
1
|
my ($self) = @_; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
1
|
my $log = "timer.log"; |
19
|
1
|
50
|
|
|
|
57
|
open(my $fh, '>>', $log) or die("Unable to open [$log] for writing."); |
20
|
1
|
|
|
|
|
7
|
$self->{MyTimer_fh} = $fh; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub print { |
24
|
7
|
|
|
7
|
1
|
18
|
my($self, $msg) = @_; |
25
|
7
|
|
|
|
|
7
|
print {$self->{MyTimer_fh}} $msg . "\n"; |
|
7
|
|
|
|
|
57
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub shutdown { |
29
|
2
|
|
|
2
|
1
|
4
|
my ($self) = @_; |
30
|
2
|
|
|
|
|
84
|
close $self->{MyTimer_fh}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|