WE_Frontend/Plugin/Benchmark.pm

filter: Statementstmt 66.6% 14 / 21 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 66.6% 4 / 6 Podpod 50.0% 1 / 2 totaltotal 59.3% 19 / 32 CC 2 SCAR 9.4
CC
2
Cov
61%
stop
6.0
new
2.0
BEGIN
1.0
CRAP 2.6
« WE_Sample/HW.pm ↑ Summary WE_Frontend/Plugin/JS.pm »
1 # -*- perl -*-
2  
3 #
4 # $Id: Benchmark.pm,v 1.7 2004/10/27 13:25:30 eserte Exp $
5 # Author: Slaven Rezic
6 #
7 # Copyright (C) 2002 Slaven Rezic. All rights reserved.
8 # This package is free software; you can redistribute it and/or
9 # modify it under the same terms as Perl itself.
10 #
11 # Mail: slaven@rezic.de
12 # WWW: http://www.rezic.de/eserte/
13 #
14  
15 package WE_Frontend::Plugin::Benchmark;
16 1 ▶use base qw(Template::Plugin);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 $VERSION = sprintf("%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/);
21  
22 1 ▶use Time::HiRes qw(gettimeofday tv_interval);
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
25 0 my ($class, $context, @params) = @_;
26 0 bless {
27 _CONTEXT => $context,
28 _START => [gettimeofday],
29 }, $class;
30 }
31  
32 0 ▶sub stop {
Subroutine stop: not called CC=2 SCAR=17.9
Pod undocumented
33 0 my $self = shift;
34 0 ▶ my $arg = shift || "";
Condition0%0/2
shift() || ''
l!l
00
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
35 0 $arg .= " " . tv_interval($self->{_START}, [gettimeofday]) . "s";
36 0 warn "$arg\n";
37 0 "";
38 }
39  
40 1 1;
41  
42 __END__
« WE_Sample/HW.pm ↑ Summary WE_Frontend/Plugin/JS.pm »