| Filename | /usr/share/perl5/DateTime/Format/Builder/Parser/Quick.pm |
| Statements | Executed 14 statements in 309µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 12µs | 22µs | DateTime::Format::Builder::Parser::Quick::BEGIN@5 |
| 1 | 1 | 1 | 9µs | 76µs | DateTime::Format::Builder::Parser::Quick::BEGIN@9 |
| 1 | 1 | 1 | 7µs | 14µs | DateTime::Format::Builder::Parser::Quick::BEGIN@6 |
| 1 | 1 | 1 | 7µs | 41µs | DateTime::Format::Builder::Parser::Quick::BEGIN@8 |
| 1 | 1 | 1 | 6µs | 24µs | DateTime::Format::Builder::Parser::Quick::BEGIN@7 |
| 0 | 0 | 0 | 0s | 0s | DateTime::Format::Builder::Parser::Quick::__ANON__[:19] |
| 0 | 0 | 0 | 0s | 0s | DateTime::Format::Builder::Parser::Quick::__ANON__[:42] |
| 0 | 0 | 0 | 0s | 0s | DateTime::Format::Builder::Parser::Quick::create_parser |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package DateTime::Format::Builder::Parser::Quick; | ||||
| 2 | { | ||||
| 3 | 2 | 700ns | $DateTime::Format::Builder::Parser::Quick::VERSION = '0.81'; | ||
| 4 | } | ||||
| 5 | 2 | 22µs | 2 | 32µs | # spent 22µs (12+10) within DateTime::Format::Builder::Parser::Quick::BEGIN@5 which was called:
# once (12µs+10µs) by DateTime::Format::Builder::Parser::BEGIN@1.1 at line 5 # spent 22µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@5
# spent 10µs making 1 call to strict::import |
| 6 | 2 | 21µs | 2 | 20µs | # spent 14µs (7+6) within DateTime::Format::Builder::Parser::Quick::BEGIN@6 which was called:
# once (7µs+6µs) by DateTime::Format::Builder::Parser::BEGIN@1.1 at line 6 # spent 14µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@6
# spent 6µs making 1 call to warnings::import |
| 7 | 2 | 23µs | 2 | 41µs | # spent 24µs (6+18) within DateTime::Format::Builder::Parser::Quick::BEGIN@7 which was called:
# once (6µs+18µs) by DateTime::Format::Builder::Parser::BEGIN@1.1 at line 7 # spent 24µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@7
# spent 18µs making 1 call to vars::import |
| 8 | 2 | 23µs | 2 | 75µs | # spent 41µs (7+34) within DateTime::Format::Builder::Parser::Quick::BEGIN@8 which was called:
# once (7µs+34µs) by DateTime::Format::Builder::Parser::BEGIN@1.1 at line 8 # spent 41µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@8
# spent 34µs making 1 call to Exporter::import |
| 9 | 2 | 207µs | 2 | 143µs | # spent 76µs (9+67) within DateTime::Format::Builder::Parser::Quick::BEGIN@9 which was called:
# once (9µs+67µs) by DateTime::Format::Builder::Parser::BEGIN@1.1 at line 9 # spent 76µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@9
# spent 67µs making 1 call to base::import |
| 10 | |||||
| - - | |||||
| 13 | __PACKAGE__->valid_params( | ||||
| 14 | Quick => { | ||||
| 15 | type => SCALAR | OBJECT, | ||||
| 16 | callbacks => { | ||||
| 17 | good_classname => sub { | ||||
| 18 | ( ref $_[0] ) or ( $_[0] =~ /^\w+[:'\w+]*\w+/ ); | ||||
| 19 | }, | ||||
| 20 | } | ||||
| 21 | }, | ||||
| 22 | 1 | 8µs | 1 | 8µs | method => { # spent 8µs making 1 call to DateTime::Format::Builder::Parser::valid_params |
| 23 | optional => 1, | ||||
| 24 | type => SCALAR | CODEREF, | ||||
| 25 | }, | ||||
| 26 | ); | ||||
| 27 | |||||
| 28 | sub create_parser { | ||||
| 29 | my ( $self, %args ) = @_; | ||||
| 30 | my $class = $args{Quick}; | ||||
| 31 | my $method = $args{method}; | ||||
| 32 | $method = 'parse_datetime' unless defined $method; | ||||
| 33 | eval "use $class"; | ||||
| 34 | die $@ if $@; | ||||
| 35 | |||||
| 36 | return sub { | ||||
| 37 | my ( $self, $date ) = @_; | ||||
| 38 | return unless defined $date; | ||||
| 39 | my $rv = eval { $class->$method($date) }; | ||||
| 40 | return $rv if defined $rv; | ||||
| 41 | return; | ||||
| 42 | }; | ||||
| 43 | } | ||||
| 44 | |||||
| 45 | 1 | 3µs | 1; | ||
| 46 | |||||
| 47 | # ABSTRACT: Use another formatter, simply | ||||
| 48 | |||||
| 49 | __END__ |