← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Sun Aug 5 15:24:32 2012
Reported on Sun Aug 5 15:25:01 2012

Filename/usr/lib/perl5/site_perl/5.12.4/i686-linux/DateTime/Infinite.pm
StatementsExecuted 47 statements in 4.31ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11194µs122µsDateTime::Infinite::::BEGIN@6 DateTime::Infinite::BEGIN@6
11159µs439µsDateTime::Infinite::Future::::BEGIN@44DateTime::Infinite::Future::BEGIN@44
11158µs408µsDateTime::Infinite::::BEGIN@12 DateTime::Infinite::BEGIN@12
11156µs156µsDateTime::Infinite::::BEGIN@7 DateTime::Infinite::BEGIN@7
11153µs416µsDateTime::Infinite::Past::::BEGIN@68 DateTime::Infinite::Past::BEGIN@68
11152µs138µsDateTime::Infinite::::BEGIN@15 DateTime::Infinite::BEGIN@15
21142µs42µsDateTime::Infinite::::_rd2ymd DateTime::Infinite::_rd2ymd
11138µs38µsDateTime::Infinite::::BEGIN@9 DateTime::Infinite::BEGIN@9
11135µs35µsDateTime::Infinite::::BEGIN@10 DateTime::Infinite::BEGIN@10
21134µs34µsDateTime::Infinite::::_seconds_as_components DateTime::Infinite::_seconds_as_components
0000s0sDateTime::Infinite::Future::::newDateTime::Infinite::Future::new
0000s0sDateTime::Infinite::Past::::new DateTime::Infinite::Past::new
0000s0sDateTime::Infinite::::STORABLE_freeze DateTime::Infinite::STORABLE_freeze
0000s0sDateTime::Infinite::::STORABLE_thaw DateTime::Infinite::STORABLE_thaw
0000s0sDateTime::Infinite::::__ANON__[:16] DateTime::Infinite::__ANON__[:16]
0000s0sDateTime::Infinite::::_stringify DateTime::Infinite::_stringify
0000s0sDateTime::Infinite::::is_finite DateTime::Infinite::is_finite
0000s0sDateTime::Infinite::::is_infinite DateTime::Infinite::is_infinite
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package DateTime::Infinite;
2{
3211µs $DateTime::Infinite::VERSION = '0.76';
4}
5
63180µs2149µs
# spent 122µs (94+28) within DateTime::Infinite::BEGIN@6 which was called: # once (94µs+28µs) by main::BEGIN@1 at line 6
use strict;
# spent 122µs making 1 call to DateTime::Infinite::BEGIN@6 # spent 28µs making 1 call to strict::import
73139µs2255µs
# spent 156µs (56+100) within DateTime::Infinite::BEGIN@7 which was called: # once (56µs+100µs) by main::BEGIN@1 at line 7
use warnings;
# spent 156µs making 1 call to DateTime::Infinite::BEGIN@7 # spent 100µs making 1 call to warnings::import
8
93130µs138µs
# spent 38µs within DateTime::Infinite::BEGIN@9 which was called: # once (38µs+0s) by main::BEGIN@1 at line 9
use DateTime;
# spent 38µs making 1 call to DateTime::Infinite::BEGIN@9
103146µs135µs
# spent 35µs within DateTime::Infinite::BEGIN@10 which was called: # once (35µs+0s) by main::BEGIN@1 at line 10
use DateTime::TimeZone;
# spent 35µs making 1 call to DateTime::Infinite::BEGIN@10
11
123210µs2758µs
# spent 408µs (58+350) within DateTime::Infinite::BEGIN@12 which was called: # once (58µs+350µs) by main::BEGIN@1 at line 12
use base qw(DateTime);
# spent 408µs making 1 call to DateTime::Infinite::BEGIN@12 # spent 350µs making 1 call to base::import
13
1419µsforeach my $m (qw( set set_time_zone truncate )) {
1531.15ms2223µs
# spent 138µs (52+85) within DateTime::Infinite::BEGIN@15 which was called: # once (52µs+85µs) by main::BEGIN@1 at line 15
no strict 'refs';
# spent 138µs making 1 call to DateTime::Infinite::BEGIN@15 # spent 85µs making 1 call to strict::unimport
163108µs *{"DateTime::Infinite::$m"} = sub { return $_[0] };
17}
18
19sub is_finite {0}
20sub is_infinite {1}
21
22
# spent 42µs within DateTime::Infinite::_rd2ymd which was called 2 times, avg 21µs/call: # 2 times (42µs+0s) by DateTime::_calc_local_components at line 435 of DateTime.pm, avg 21µs/call
sub _rd2ymd {
23258µs return $_[2] ? ( $_[1] ) x 7 : ( $_[1] ) x 3;
24}
25
26
# spent 34µs within DateTime::Infinite::_seconds_as_components which was called 2 times, avg 17µs/call: # 2 times (34µs+0s) by DateTime::_calc_local_components at line 440 of DateTime.pm, avg 17µs/call
sub _seconds_as_components {
27247µs return ( $_[1] ) x 3;
28}
29
30sub _stringify {
31 $_[0]->{utc_rd_days} == DateTime::INFINITY
32 ? DateTime::INFINITY . ''
33 : DateTime::NEG_INFINITY . '';
34}
35
36sub STORABLE_freeze {return}
37sub STORABLE_thaw {return}
38
39package DateTime::Infinite::Future;
40{
41210µs $DateTime::Infinite::Future::VERSION = '0.76';
42}
43
443600µs2820µs
# spent 439µs (59+381) within DateTime::Infinite::Future::BEGIN@44 which was called: # once (59µs+381µs) by main::BEGIN@1 at line 44
use base qw(DateTime::Infinite);
# spent 439µs making 1 call to DateTime::Infinite::Future::BEGIN@44 # spent 380µs making 1 call to base::import
45
46{
472341µs1391µs my $Pos = bless {
# spent 391µs making 1 call to DateTime::TimeZone::new
48 utc_rd_days => DateTime::INFINITY,
49 utc_rd_secs => DateTime::INFINITY,
50 local_rd_days => DateTime::INFINITY,
51 local_rd_secs => DateTime::INFINITY,
52 rd_nanosecs => DateTime::INFINITY,
53 tz => DateTime::TimeZone->new( name => 'floating' ),
54 },
55 __PACKAGE__;
56
57147µs1176µs $Pos->_calc_utc_rd;
# spent 176µs making 1 call to DateTime::_calc_utc_rd
58132µs1309µs $Pos->_calc_local_rd;
# spent 309µs making 1 call to DateTime::_calc_local_rd
59
60 sub new {$Pos}
61}
62
63package DateTime::Infinite::Past;
64{
65211µs $DateTime::Infinite::Past::VERSION = '0.76';
66}
67
683619µs2779µs
# spent 416µs (53+363) within DateTime::Infinite::Past::BEGIN@68 which was called: # once (53µs+363µs) by main::BEGIN@1 at line 68
use base qw(DateTime::Infinite);
# spent 416µs making 1 call to DateTime::Infinite::Past::BEGIN@68 # spent 363µs making 1 call to base::import
69
70{
712337µs1329µs my $Neg = bless {
# spent 329µs making 1 call to DateTime::TimeZone::new
72 utc_rd_days => DateTime::NEG_INFINITY,
73 utc_rd_secs => DateTime::NEG_INFINITY,
74 local_rd_days => DateTime::NEG_INFINITY,
75 local_rd_secs => DateTime::NEG_INFINITY,
76 rd_nanosecs => DateTime::NEG_INFINITY,
77 tz => DateTime::TimeZone->new( name => 'floating' ),
78 },
79 __PACKAGE__;
80
81124µs1128µs $Neg->_calc_utc_rd;
# spent 128µs making 1 call to DateTime::_calc_utc_rd
82130µs1283µs $Neg->_calc_local_rd;
# spent 283µs making 1 call to DateTime::_calc_local_rd
83
84 sub new {$Neg}
85}
86
87168µs1;
88
89# ABSTRACT: Infinite past and future DateTime objects
90
- -
93=pod
94
95=head1 NAME
96
97DateTime::Infinite - Infinite past and future DateTime objects
98
99=head1 VERSION
100
101version 0.76
102
103=head1 SYNOPSIS
104
105 my $future = DateTime::Infinite::Future->new();
106 my $past = DateTime::Infinite::Past->new();
107
108=head1 DESCRIPTION
109
110This module provides two L<DateTime.pm|DateTime> subclasses,
111C<DateTime::Infinite::Future> and C<DateTime::Infinite::Past>.
112
113The objects are in the "floating" timezone, and this cannot be
114changed.
115
116=head1 BUGS
117
118There seem to be lots of problems when dealing with infinite numbers
119on Win32. This may be a problem with this code, Perl, or Win32's IEEE
120math implementation. Either way, the module may not be well-behaved
121on Win32 operating systems.
122
123=head1 METHODS
124
125The only constructor for these two classes is the C<new()> method, as
126shown in the L<SYNOPSIS|/SYNOPSIS>. This method takes no parameters.
127
128All "get" methods in this module simply return infinity, positive or
129negative. If the method is expected to return a string, it return the
130string representation of positive or negative infinity used by your
131system. For example, on my system calling C<year()> returns a number
132which when printed appears either "inf" or "-inf".
133
134The object is not mutable, so the C<set()>, C<set_time_zone()>, and
135C<truncate()> methods are all do-nothing methods that simply return
136the object they are called with.
137
138Obviously, the C<is_finite()> method returns false and the
139C<is_infinite()> method returns true.
140
141=head1 SEE ALSO
142
143datetime@perl.org mailing list
144
145http://datetime.perl.org/
146
147=head1 AUTHOR
148
149Dave Rolsky <autarch@urth.org>
150
151=head1 COPYRIGHT AND LICENSE
152
153This software is Copyright (c) 2012 by Dave Rolsky.
154
155This is free software, licensed under:
156
157 The Artistic License 2.0 (GPL Compatible)
158
159=cut
160
161
162__END__