File Coverage

blib/lib/Event/Stats.pm
Criterion Covered Total %
statement 17 18 94.4
branch 2 4 50.0
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 26 29 89.6


line stmt bran cond sub pod time code
1 4     4   47285 use strict;
  4         5  
  4         118  
2             package Event::Stats;
3 4     4   11 use Carp;
  4         4  
  4         170  
4 4     4   12 use Event 0.53;
  4         50  
  4         15  
5 4     4   238 use base ('Exporter', 'DynaLoader');
  4         3  
  4         647  
6             our $VERSION = '1.01';
7             our @EXPORT_OK = qw(round_seconds idle_time total_time);
8              
9             __PACKAGE__->bootstrap($VERSION);
10              
11             sub enforce_max_callback_time {
12             # a bit kludged
13 1 50   1 1 463 if (@_) {
14 1         1 my ($yes) = @_;
15 1 50   1   17 $SIG{ALRM} = sub { Carp::confess("Event timed out") } if $yes;
  1         3595655  
16 1         11 _enforce_max_callback_time($yes);
17             } else {
18 0           _enforcing_max_callback_time()
19             }
20             }
21              
22             1;
23             __END__