blib/lib/Dancer/Timer.pm

filter: Statementstmt 100% 27 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 3 / 3 totaltotal 100% 38 / 38 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Dancer/Session/Simple.pm ↑ Summary blib/lib/HTTP/Tiny/NoProxy.pm »
1 package Dancer::Timer;
2 223 our $AUTHORITY = 'cpan:SUKRIA';
3 #ABSTRACT: a timer for Dancer
4 223 $Dancer::Timer::VERSION = '1.3520';
5 223 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 223 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 223 ▶use base 'Dancer::Object';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 223 ▶use Time::HiRes 'gettimeofday', 'tv_interval';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 223 ▶use Dancer::ModuleLoader;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 223 Dancer::Timer->attributes('start_time');
12  
13 sub init {
14 528 ▶ my ($self) = @_;
Subroutine init: called CC=1 SCAR=0.0
Pod documented
15 528 $self->start_time([gettimeofday()]);
16 }
17  
18 sub tick {
19 38 ▶ my ($self) = @_;
Subroutine tick: called CC=1 SCAR=0.0
Pod documented
20 38 my $now = [gettimeofday()];
21 38 my $delay = tv_interval($self->start_time, $now);
22 38 return sprintf('%0f', $delay);
23 }
24  
25 sub to_string {
26 1 ▶ my ($self) = @_;
Subroutine to_string: called CC=1 SCAR=0.0
Pod documented
27 1 $self->tick;
28 }
29  
30 223 1;
31  
32 __END__
« blib/lib/Dancer/Session/Simple.pm ↑ Summary blib/lib/HTTP/Tiny/NoProxy.pm »