← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 17:10:45 2013
Reported on Tue Oct 15 17:11:56 2013

Filename/usr/share/perl5/DateTime/Format/Builder/Parser/Strptime.pm
StatementsExecuted 16 statements in 386µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11120µs25µsDateTime::Format::Builder::Parser::Strptime::::BEGIN@27DateTime::Format::Builder::Parser::Strptime::BEGIN@27
11120µs66µsDateTime::Format::Builder::Parser::Strptime::::BEGIN@28DateTime::Format::Builder::Parser::Strptime::BEGIN@28
11112µs61µsDateTime::Format::Builder::Parser::Strptime::::BEGIN@29DateTime::Format::Builder::Parser::Strptime::BEGIN@29
11111µs14µsDateTime::Format::Builder::Parser::Strptime::::BEGIN@32DateTime::Format::Builder::Parser::Strptime::BEGIN@32
0000s0sDateTime::Format::Builder::Parser::Strptime::::create_parserDateTime::Format::Builder::Parser::Strptime::create_parser
0000s0sDateTime::Format::Builder::Parser::Strptime::::do_matchDateTime::Format::Builder::Parser::Strptime::do_match
0000s0sDateTime::Format::Builder::Parser::Strptime::::post_matchDateTime::Format::Builder::Parser::Strptime::post_match
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package DateTime::Format::Builder::Parser::Strptime;
2
3=head1 NAME
4
- -
27342µs231µs
# spent 25µs (20+5) within DateTime::Format::Builder::Parser::Strptime::BEGIN@27 which was called: # once (20µs+5µs) by DateTime::Format::Builder::Parser::BEGIN@1.7 at line 27
use strict;
# spent 25µs making 1 call to DateTime::Format::Builder::Parser::Strptime::BEGIN@27 # spent 5µs making 1 call to strict::import
28335µs2112µs
# spent 66µs (20+46) within DateTime::Format::Builder::Parser::Strptime::BEGIN@28 which was called: # once (20µs+46µs) by DateTime::Format::Builder::Parser::BEGIN@1.7 at line 28
use vars qw( $VERSION @ISA );
# spent 66µs making 1 call to DateTime::Format::Builder::Parser::Strptime::BEGIN@28 # spent 46µs making 1 call to vars::import
29345µs2111µs
# spent 61µs (12+50) within DateTime::Format::Builder::Parser::Strptime::BEGIN@29 which was called: # once (12µs+50µs) by DateTime::Format::Builder::Parser::BEGIN@1.7 at line 29
use Params::Validate qw( validate SCALAR HASHREF );
# spent 61µs making 1 call to DateTime::Format::Builder::Parser::Strptime::BEGIN@29 # spent 50µs making 1 call to Exporter::import
30
311600ns$VERSION = '0.77';
323240µs216µs
# spent 14µs (11+2) within DateTime::Format::Builder::Parser::Strptime::BEGIN@32 which was called: # once (11µs+2µs) by DateTime::Format::Builder::Parser::BEGIN@1.7 at line 32
use DateTime::Format::Builder::Parser::generic;
# spent 14µs making 1 call to DateTime::Format::Builder::Parser::Strptime::BEGIN@32 # spent 2µs making 1 call to UNIVERSAL::import
33110µs@ISA = qw( DateTime::Format::Builder::Parser::generic );
34
3518µs112µs__PACKAGE__->valid_params(
36 strptime => {
37 type => SCALAR|HASHREF, # straight pattern or options to DTF::Strptime
38 },
39);
40
41sub create_parser
42{
43 my ($self, %args) = @_;
44
45 # Arguments to DTF::Strptime
46 my $pattern = $args{strptime};
47
48 # Create our strptime parser
49 require DateTime::Format::Strptime;
50 my $strptime = DateTime::Format::Strptime->new(
51 ( ref $pattern ? %$pattern : ( pattern => $pattern ) ),
52 );
53 unless (ref $self)
54 {
55 $self = $self->new( %args );
56 }
57 $self->{strptime} = $strptime;
58
59 # Create our parser
60 return $self->generic_parser(
61 ( map { exists $args{$_} ? ( $_ => $args{$_} ) : () } qw(
62 on_match on_fail preprocess postprocess
63 ) ),
64 label => $args{label},
65 );
66}
67
68sub do_match
69{
70 my $self = shift;
71 my $date = shift;
72 local $^W; # bizarre bug
73 # Do the match!
74 my $dt = eval { $self->{strptime}->parse_datetime( $date ) };
75 return $@ ? undef : $dt;
76}
77
78sub post_match
79{
80 return $_[2];
81}
82
8315µs1;
84
85__END__