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 | 18µs | 22µs | BEGIN@2 | DateTime::Format::Builder::Parser::Quick::
1 | 1 | 1 | 17µs | 98µs | BEGIN@5 | DateTime::Format::Builder::Parser::Quick::
1 | 1 | 1 | 12µs | 72µs | BEGIN@4 | DateTime::Format::Builder::Parser::Quick::
1 | 1 | 1 | 9µs | 50µ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 | 33µs | 2 | 27µs | # spent 22µs (18+4) within DateTime::Format::Builder::Parser::Quick::BEGIN@2 which was called:
# once (18µs+4µs) by DateTime::Format::Builder::Parser::BEGIN@1.5 at line 2 # spent 22µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@2
# spent 4µs making 1 call to strict::import |
3 | 3 | 39µs | 2 | 92µs | # spent 50µs (9+42) within DateTime::Format::Builder::Parser::Quick::BEGIN@3 which was called:
# once (9µs+42µs) by DateTime::Format::Builder::Parser::BEGIN@1.5 at line 3 # spent 50µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@3
# spent 42µs making 1 call to vars::import |
4 | 3 | 34µs | 2 | 132µs | # spent 72µs (12+60) within DateTime::Format::Builder::Parser::Quick::BEGIN@4 which was called:
# once (12µs+60µs) by DateTime::Format::Builder::Parser::BEGIN@1.5 at line 4 # spent 72µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@4
# spent 60µs making 1 call to Exporter::import |
5 | 3 | 244µs | 2 | 178µs | # spent 98µs (17+81) within DateTime::Format::Builder::Parser::Quick::BEGIN@5 which was called:
# once (17µs+81µs) by DateTime::Format::Builder::Parser::BEGIN@1.5 at line 5 # spent 98µs making 1 call to DateTime::Format::Builder::Parser::Quick::BEGIN@5
# spent 81µ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 | 14µs | method => { # spent 14µ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 | 5µs | 1; | ||
96 | |||||
97 | __END__ |