Filename | /usr/share/perl5/DateTime/Format/Builder/Parser/Quick.pm |
Statements | Executed 15 statements in 368µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 19µs | 23µs | BEGIN@2 | DateTime::Format::Builder::Parser::Quick::
1 | 1 | 1 | 16µs | 94µs | BEGIN@5 | DateTime::Format::Builder::Parser::Quick::
1 | 1 | 1 | 12µs | 132µs | BEGIN@4 | DateTime::Format::Builder::Parser::Quick::
1 | 1 | 1 | 8µs | 45µs | BEGIN@3 | DateTime::Format::Builder::Parser::Quick::
0 | 0 | 0 | 0s | 0s | __ANON__[:68] | DateTime::Format::Builder::Parser::Quick::
0 | 0 | 0 | 0s | 0s | __ANON__[:92] | DateTime::Format::Builder::Parser::Quick::
0 | 0 | 0 | 0s | 0s | create_parser | DateTime::Format::Builder::Parser::Quick::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package DateTime::Format::Builder::Parser::Quick; | ||||
2 | 3 | 31µs | 2 | 28µs | # spent 23µs (19+4) within DateTime::Format::Builder::Parser::Quick::BEGIN@2 which was called:
# once (19µs+4µs) by DateTime::Format::Builder::Parser::BEGIN@1.3 at line 2 # spent 23µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@2
# spent 4µs making 1 call to strict::import |
3 | 3 | 32µs | 2 | 83µs | # spent 45µs (8+37) within DateTime::Format::Builder::Parser::Quick::BEGIN@3 which was called:
# once (8µs+37µs) by DateTime::Format::Builder::Parser::BEGIN@1.3 at line 3 # spent 45µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@3
# spent 37µs making 1 call to vars::import |
4 | 3 | 39µs | 2 | 252µs | # spent 132µs (12+120) within DateTime::Format::Builder::Parser::Quick::BEGIN@4 which was called:
# once (12µs+120µs) by DateTime::Format::Builder::Parser::BEGIN@1.3 at line 4 # spent 132µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@4
# spent 120µs making 1 call to Exporter::import |
5 | 3 | 244µs | 2 | 173µs | # spent 94µs (16+78) within DateTime::Format::Builder::Parser::Quick::BEGIN@5 which was called:
# once (16µs+78µs) by DateTime::Format::Builder::Parser::BEGIN@1.3 at line 5 # spent 94µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@5
# spent 79µs making 1 call to base::import |
6 | |||||
7 | =head1 NAME | ||||
8 | |||||
- - | |||||
60 | 1 | 700ns | $VERSION = '0.77'; | ||
61 | |||||
62 | __PACKAGE__->valid_params( | ||||
63 | Quick => { | ||||
64 | type => SCALAR|OBJECT, | ||||
65 | callbacks => { | ||||
66 | good_classname => sub { | ||||
67 | (ref $_[0]) or ( $_[0] =~ /^\w+[:'\w+]*\w+/ ) | ||||
68 | }, | ||||
69 | } | ||||
70 | }, | ||||
71 | 1 | 12µs | 1 | 22µs | method => { # spent 22µs making 1 call to DateTime::Format::Builder::Parser::valid_params |
72 | optional => 1, | ||||
73 | type => SCALAR|CODEREF, | ||||
74 | }, | ||||
75 | ); | ||||
76 | |||||
77 | sub create_parser | ||||
78 | { | ||||
79 | my ($self, %args) = @_; | ||||
80 | my $class = $args{Quick}; | ||||
81 | my $method = $args{method}; | ||||
82 | $method = 'parse_datetime' unless defined $method; | ||||
83 | eval "use $class"; | ||||
84 | die $@ if $@; | ||||
85 | |||||
86 | return sub { | ||||
87 | my ($self, $date) = @_; | ||||
88 | return unless defined $date; | ||||
89 | my $rv = eval { $class->$method( $date ) }; | ||||
90 | return $rv if defined $rv; | ||||
91 | return; | ||||
92 | }; | ||||
93 | } | ||||
94 | |||||
95 | 1 | 9µs | 1; | ||
96 | |||||
97 | __END__ |