| Filename | /usr/lib/x86_64-linux-gnu/perl5/5.20/DateTime/Infinite.pm |
| Statements | Executed 69 statements in 1.38ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 13µs | 28µs | DateTime::Infinite::BEGIN@3 |
| 1 | 1 | 1 | 8µs | 73µs | DateTime::Infinite::BEGIN@9 |
| 1 | 1 | 1 | 8µs | 18µs | FakeLocale::BEGIN@132 |
| 1 | 1 | 1 | 8µs | 17µs | DateTime::Infinite::BEGIN@4 |
| 2 | 2 | 1 | 8µs | 5.84ms | FakeLocale::instance |
| 1 | 1 | 1 | 7µs | 16µs | DateTime::Infinite::BEGIN@12 |
| 1 | 1 | 1 | 6µs | 16µs | DateTime::Infinite::Future::BEGIN@38 |
| 1 | 1 | 1 | 6µs | 16µs | FakeLocale::BEGIN@89 |
| 1 | 1 | 1 | 6µs | 12µs | FakeLocale::BEGIN@90 |
| 1 | 1 | 1 | 6µs | 14µs | DateTime::Infinite::Future::BEGIN@39 |
| 1 | 1 | 1 | 6µs | 12µs | DateTime::Infinite::Past::BEGIN@64 |
| 1 | 1 | 1 | 6µs | 51µs | DateTime::Infinite::Future::BEGIN@41 |
| 1 | 1 | 1 | 6µs | 15µs | DateTime::Infinite::Past::BEGIN@63 |
| 1 | 1 | 1 | 6µs | 46µs | DateTime::Infinite::Past::BEGIN@66 |
| 1 | 1 | 1 | 4µs | 4µs | DateTime::Infinite::BEGIN@6 |
| 1 | 1 | 1 | 4µs | 4µs | DateTime::Infinite::BEGIN@7 |
| 2 | 1 | 1 | 4µs | 4µs | DateTime::Infinite::_rd2ymd |
| 1 | 1 | 1 | 4µs | 4µs | FakeLocale::BEGIN@92 |
| 2 | 1 | 1 | 2µs | 2µs | DateTime::Infinite::_seconds_as_components |
| 0 | 0 | 0 | 0s | 0s | DateTime::Infinite::Future::new |
| 0 | 0 | 0 | 0s | 0s | DateTime::Infinite::Past::new |
| 0 | 0 | 0 | 0s | 0s | DateTime::Infinite::STORABLE_freeze |
| 0 | 0 | 0 | 0s | 0s | DateTime::Infinite::STORABLE_thaw |
| 0 | 0 | 0 | 0s | 0s | DateTime::Infinite::__ANON__[:13] |
| 0 | 0 | 0 | 0s | 0s | DateTime::Infinite::_stringify |
| 0 | 0 | 0 | 0s | 0s | DateTime::Infinite::is_finite |
| 0 | 0 | 0 | 0s | 0s | DateTime::Infinite::is_infinite |
| 0 | 0 | 0 | 0s | 0s | FakeLocale::AUTOLOAD |
| 0 | 0 | 0 | 0s | 0s | FakeLocale::__ANON__[:133] |
| 0 | 0 | 0 | 0s | 0s | FakeLocale::first_day_of_week |
| 0 | 0 | 0 | 0s | 0s | FakeLocale::id |
| 0 | 0 | 0 | 0s | 0s | FakeLocale::language |
| 0 | 0 | 0 | 0s | 0s | FakeLocale::language_id |
| 0 | 0 | 0 | 0s | 0s | FakeLocale::name |
| 0 | 0 | 0 | 0s | 0s | FakeLocale::prefers_24_hour_time |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package DateTime::Infinite; | ||||
| 2 | 1 | 500ns | $DateTime::Infinite::VERSION = '1.12'; | ||
| 3 | 2 | 25µs | 2 | 42µs | # spent 28µs (13+15) within DateTime::Infinite::BEGIN@3 which was called:
# once (13µs+15µs) by C4::Circulation::BEGIN@24 at line 3 # spent 28µs making 1 call to DateTime::Infinite::BEGIN@3
# spent 15µs making 1 call to strict::import |
| 4 | 2 | 22µs | 2 | 26µs | # spent 17µs (8+9) within DateTime::Infinite::BEGIN@4 which was called:
# once (8µs+9µs) by C4::Circulation::BEGIN@24 at line 4 # spent 17µs making 1 call to DateTime::Infinite::BEGIN@4
# spent 9µs making 1 call to warnings::import |
| 5 | |||||
| 6 | 2 | 19µs | 1 | 4µs | # spent 4µs within DateTime::Infinite::BEGIN@6 which was called:
# once (4µs+0s) by C4::Circulation::BEGIN@24 at line 6 # spent 4µs making 1 call to DateTime::Infinite::BEGIN@6 |
| 7 | 2 | 22µs | 1 | 4µs | # spent 4µs within DateTime::Infinite::BEGIN@7 which was called:
# once (4µs+0s) by C4::Circulation::BEGIN@24 at line 7 # spent 4µs making 1 call to DateTime::Infinite::BEGIN@7 |
| 8 | |||||
| 9 | 2 | 33µs | 2 | 138µs | # spent 73µs (8+65) within DateTime::Infinite::BEGIN@9 which was called:
# once (8µs+65µs) by C4::Circulation::BEGIN@24 at line 9 # spent 73µs making 1 call to DateTime::Infinite::BEGIN@9
# spent 65µs making 1 call to base::import |
| 10 | |||||
| 11 | 1 | 700ns | foreach my $m (qw( set set_time_zone truncate )) { | ||
| 12 | 2 | 167µs | 2 | 26µs | # spent 16µs (7+10) within DateTime::Infinite::BEGIN@12 which was called:
# once (7µs+10µs) by C4::Circulation::BEGIN@24 at line 12 # spent 16µs making 1 call to DateTime::Infinite::BEGIN@12
# spent 10µs making 1 call to strict::unimport |
| 13 | 3 | 13µs | *{"DateTime::Infinite::$m"} = sub { return $_[0] }; | ||
| 14 | } | ||||
| 15 | |||||
| 16 | sub is_finite {0} | ||||
| 17 | sub is_infinite {1} | ||||
| 18 | |||||
| 19 | # spent 4µs within DateTime::Infinite::_rd2ymd which was called 2 times, avg 2µs/call:
# 2 times (4µs+0s) by DateTime::_calc_local_components at line 462 of DateTime.pm, avg 2µs/call | ||||
| 20 | 2 | 7µs | return $_[2] ? ( $_[1] ) x 7 : ( $_[1] ) x 3; | ||
| 21 | } | ||||
| 22 | |||||
| 23 | # spent 2µs within DateTime::Infinite::_seconds_as_components which was called 2 times, avg 1µs/call:
# 2 times (2µs+0s) by DateTime::_calc_local_components at line 467 of DateTime.pm, avg 1µs/call | ||||
| 24 | 2 | 5µs | return ( $_[1] ) x 3; | ||
| 25 | } | ||||
| 26 | |||||
| 27 | sub _stringify { | ||||
| 28 | $_[0]->{utc_rd_days} == DateTime::INFINITY | ||||
| 29 | ? DateTime::INFINITY . '' | ||||
| 30 | : DateTime::NEG_INFINITY . ''; | ||||
| 31 | } | ||||
| 32 | |||||
| 33 | sub STORABLE_freeze {return} | ||||
| 34 | sub STORABLE_thaw {return} | ||||
| 35 | |||||
| 36 | package DateTime::Infinite::Future; | ||||
| 37 | 1 | 200ns | $DateTime::Infinite::Future::VERSION = '1.12'; | ||
| 38 | 2 | 20µs | 2 | 26µs | # spent 16µs (6+10) within DateTime::Infinite::Future::BEGIN@38 which was called:
# once (6µs+10µs) by C4::Circulation::BEGIN@24 at line 38 # spent 16µs making 1 call to DateTime::Infinite::Future::BEGIN@38
# spent 10µs making 1 call to strict::import |
| 39 | 2 | 22µs | 2 | 22µs | # spent 14µs (6+8) within DateTime::Infinite::Future::BEGIN@39 which was called:
# once (6µs+8µs) by C4::Circulation::BEGIN@24 at line 39 # spent 14µs making 1 call to DateTime::Infinite::Future::BEGIN@39
# spent 8µs making 1 call to warnings::import |
| 40 | |||||
| 41 | 2 | 94µs | 2 | 96µs | # spent 51µs (6+45) within DateTime::Infinite::Future::BEGIN@41 which was called:
# once (6µs+45µs) by C4::Circulation::BEGIN@24 at line 41 # spent 51µs making 1 call to DateTime::Infinite::Future::BEGIN@41
# spent 45µs making 1 call to base::import |
| 42 | |||||
| 43 | { | ||||
| 44 | 2 | 8µs | 2 | 5.89ms | my $Pos = bless { # spent 5.83ms making 1 call to FakeLocale::instance
# spent 55µs making 1 call to DateTime::TimeZone::new |
| 45 | utc_rd_days => DateTime::INFINITY, | ||||
| 46 | utc_rd_secs => DateTime::INFINITY, | ||||
| 47 | local_rd_days => DateTime::INFINITY, | ||||
| 48 | local_rd_secs => DateTime::INFINITY, | ||||
| 49 | rd_nanosecs => DateTime::INFINITY, | ||||
| 50 | tz => DateTime::TimeZone->new( name => 'floating' ), | ||||
| 51 | locale => FakeLocale->instance(), | ||||
| 52 | }, | ||||
| 53 | __PACKAGE__; | ||||
| 54 | |||||
| 55 | 1 | 3µs | 1 | 72µs | $Pos->_calc_utc_rd; # spent 72µs making 1 call to DateTime::_calc_utc_rd |
| 56 | 1 | 3µs | 1 | 36µs | $Pos->_calc_local_rd; # spent 36µs making 1 call to DateTime::_calc_local_rd |
| 57 | |||||
| 58 | sub new {$Pos} | ||||
| 59 | } | ||||
| 60 | |||||
| 61 | package DateTime::Infinite::Past; | ||||
| 62 | 1 | 200ns | $DateTime::Infinite::Past::VERSION = '1.12'; | ||
| 63 | 2 | 19µs | 2 | 24µs | # spent 15µs (6+9) within DateTime::Infinite::Past::BEGIN@63 which was called:
# once (6µs+9µs) by C4::Circulation::BEGIN@24 at line 63 # spent 15µs making 1 call to DateTime::Infinite::Past::BEGIN@63
# spent 9µs making 1 call to strict::import |
| 64 | 2 | 21µs | 2 | 17µs | # spent 12µs (6+6) within DateTime::Infinite::Past::BEGIN@64 which was called:
# once (6µs+6µs) by C4::Circulation::BEGIN@24 at line 64 # spent 12µs making 1 call to DateTime::Infinite::Past::BEGIN@64
# spent 6µs making 1 call to warnings::import |
| 65 | |||||
| 66 | 2 | 168µs | 2 | 86µs | # spent 46µs (6+40) within DateTime::Infinite::Past::BEGIN@66 which was called:
# once (6µs+40µs) by C4::Circulation::BEGIN@24 at line 66 # spent 46µs making 1 call to DateTime::Infinite::Past::BEGIN@66
# spent 40µs making 1 call to base::import |
| 67 | |||||
| 68 | { | ||||
| 69 | 2 | 6µs | 2 | 34µs | my $Neg = bless { # spent 31µs making 1 call to DateTime::TimeZone::new
# spent 3µs making 1 call to FakeLocale::instance |
| 70 | utc_rd_days => DateTime::NEG_INFINITY, | ||||
| 71 | utc_rd_secs => DateTime::NEG_INFINITY, | ||||
| 72 | local_rd_days => DateTime::NEG_INFINITY, | ||||
| 73 | local_rd_secs => DateTime::NEG_INFINITY, | ||||
| 74 | rd_nanosecs => DateTime::NEG_INFINITY, | ||||
| 75 | tz => DateTime::TimeZone->new( name => 'floating' ), | ||||
| 76 | locale => FakeLocale->instance(), | ||||
| 77 | }, | ||||
| 78 | __PACKAGE__; | ||||
| 79 | |||||
| 80 | 1 | 2µs | 1 | 48µs | $Neg->_calc_utc_rd; # spent 48µs making 1 call to DateTime::_calc_utc_rd |
| 81 | 1 | 2µs | 1 | 20µs | $Neg->_calc_local_rd; # spent 20µs making 1 call to DateTime::_calc_local_rd |
| 82 | |||||
| 83 | sub new {$Neg} | ||||
| 84 | } | ||||
| 85 | |||||
| 86 | package # hide from PAUSE | ||||
| 87 | FakeLocale; | ||||
| 88 | |||||
| 89 | 2 | 21µs | 2 | 27µs | # spent 16µs (6+10) within FakeLocale::BEGIN@89 which was called:
# once (6µs+10µs) by C4::Circulation::BEGIN@24 at line 89 # spent 16µs making 1 call to FakeLocale::BEGIN@89
# spent 10µs making 1 call to strict::import |
| 90 | 2 | 18µs | 2 | 17µs | # spent 12µs (6+5) within FakeLocale::BEGIN@90 which was called:
# once (6µs+5µs) by C4::Circulation::BEGIN@24 at line 90 # spent 12µs making 1 call to FakeLocale::BEGIN@90
# spent 5µs making 1 call to warnings::import |
| 91 | |||||
| 92 | 2 | 451µs | 1 | 4µs | # spent 4µs within FakeLocale::BEGIN@92 which was called:
# once (4µs+0s) by C4::Circulation::BEGIN@24 at line 92 # spent 4µs making 1 call to FakeLocale::BEGIN@92 |
| 93 | |||||
| 94 | 1 | 100ns | my $Instance; | ||
| 95 | |||||
| 96 | sub instance { | ||||
| 97 | 2 | 9µs | 1 | 5.83ms | return $Instance ||= bless { locale => DateTime::Locale->load('en_US') }, # spent 5.83ms making 1 call to DateTime::Locale::load |
| 98 | __PACKAGE__; | ||||
| 99 | } | ||||
| 100 | |||||
| 101 | sub id { | ||||
| 102 | return 'infinite'; | ||||
| 103 | } | ||||
| 104 | |||||
| 105 | sub language_id { | ||||
| 106 | return 'infinite'; | ||||
| 107 | } | ||||
| 108 | |||||
| 109 | sub name { | ||||
| 110 | 'Fake locale for Infinite DateTime objects'; | ||||
| 111 | } | ||||
| 112 | |||||
| 113 | sub language { | ||||
| 114 | 'Fake locale for Infinite DateTime objects'; | ||||
| 115 | } | ||||
| 116 | |||||
| 117 | 1 | 1µs | my @methods = qw( | ||
| 118 | script_id | ||||
| 119 | territory_id | ||||
| 120 | variant_id | ||||
| 121 | script | ||||
| 122 | territory | ||||
| 123 | variant | ||||
| 124 | native_name | ||||
| 125 | native_language | ||||
| 126 | native_script | ||||
| 127 | native_territory | ||||
| 128 | native_variant | ||||
| 129 | ); | ||||
| 130 | |||||
| 131 | 1 | 700ns | for my $meth (@methods) { | ||
| 132 | 2 | 166µs | 2 | 27µs | # spent 18µs (8+9) within FakeLocale::BEGIN@132 which was called:
# once (8µs+9µs) by C4::Circulation::BEGIN@24 at line 132 # spent 18µs making 1 call to FakeLocale::BEGIN@132
# spent 9µs making 1 call to strict::unimport |
| 133 | 11 | 21µs | *{$meth} = sub { undef }; | ||
| 134 | } | ||||
| 135 | |||||
| 136 | # Totally arbitrary | ||||
| 137 | sub first_day_of_week { | ||||
| 138 | return 1; | ||||
| 139 | } | ||||
| 140 | |||||
| 141 | sub prefers_24_hour_time { | ||||
| 142 | return 0; | ||||
| 143 | } | ||||
| 144 | |||||
| 145 | 1 | 100ns | our $AUTOLOAD; | ||
| 146 | sub AUTOLOAD { | ||||
| 147 | my $self = shift; | ||||
| 148 | |||||
| 149 | my ($meth) = $AUTOLOAD =~ /::(\w+)$/; | ||||
| 150 | |||||
| 151 | if ( $meth =~ /format/ && $meth !~ /^(?:day|month|quarter)/ ) { | ||||
| 152 | return $self->{locale}->$meth(@_); | ||||
| 153 | } | ||||
| 154 | |||||
| 155 | return []; | ||||
| 156 | } | ||||
| 157 | |||||
| 158 | 1 | 10µs | 1; | ||
| 159 | |||||
| 160 | # ABSTRACT: Infinite past and future DateTime objects | ||||
| 161 | |||||
| 162 | __END__ |