← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:47 2015

Filename/usr/share/perl5/DateTime/TimeZone/OffsetOnly.pm
StatementsExecuted 16 statements in 2.04ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.14ms12.0msDateTime::TimeZone::OffsetOnly::::BEGIN@9DateTime::TimeZone::OffsetOnly::BEGIN@9
111916µs988µsDateTime::TimeZone::OffsetOnly::::BEGIN@8DateTime::TimeZone::OffsetOnly::BEGIN@8
11112µs24µsDateTime::TimeZone::OffsetOnly::::BEGIN@3DateTime::TimeZone::OffsetOnly::BEGIN@3
1117µs11µsDateTime::TimeZone::OffsetOnly::::BEGIN@4DateTime::TimeZone::OffsetOnly::BEGIN@4
1116µs33µsDateTime::TimeZone::OffsetOnly::::BEGIN@6DateTime::TimeZone::OffsetOnly::BEGIN@6
4213µs3µsDateTime::TimeZone::OffsetOnly::::is_utcDateTime::TimeZone::OffsetOnly::is_utc
0000s0sDateTime::TimeZone::OffsetOnly::::STORABLE_freezeDateTime::TimeZone::OffsetOnly::STORABLE_freeze
0000s0sDateTime::TimeZone::OffsetOnly::::STORABLE_thawDateTime::TimeZone::OffsetOnly::STORABLE_thaw
0000s0sDateTime::TimeZone::OffsetOnly::::categoryDateTime::TimeZone::OffsetOnly::category
0000s0sDateTime::TimeZone::OffsetOnly::::is_dst_for_datetimeDateTime::TimeZone::OffsetOnly::is_dst_for_datetime
0000s0sDateTime::TimeZone::OffsetOnly::::newDateTime::TimeZone::OffsetOnly::new
0000s0sDateTime::TimeZone::OffsetOnly::::offset_for_datetimeDateTime::TimeZone::OffsetOnly::offset_for_datetime
0000s0sDateTime::TimeZone::OffsetOnly::::offset_for_local_datetimeDateTime::TimeZone::OffsetOnly::offset_for_local_datetime
0000s0sDateTime::TimeZone::OffsetOnly::::short_name_for_datetimeDateTime::TimeZone::OffsetOnly::short_name_for_datetime
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package DateTime::TimeZone::OffsetOnly;
21500ns$DateTime::TimeZone::OffsetOnly::VERSION = '1.75';
3224µs235µs
# spent 24µs (12+12) within DateTime::TimeZone::OffsetOnly::BEGIN@3 which was called: # once (12µs+12µs) by parent::import at line 3
use strict;
# spent 24µs making 1 call to DateTime::TimeZone::OffsetOnly::BEGIN@3 # spent 12µs making 1 call to strict::import
4223µs216µs
# spent 11µs (7+4) within DateTime::TimeZone::OffsetOnly::BEGIN@4 which was called: # once (7µs+4µs) by parent::import at line 4
use warnings;
# spent 11µs making 1 call to DateTime::TimeZone::OffsetOnly::BEGIN@4 # spent 4µs making 1 call to warnings::import
5
6228µs233µs
# spent 33µs (6+27) within DateTime::TimeZone::OffsetOnly::BEGIN@6 which was called: # once (6µs+27µs) by parent::import at line 6
use parent 'DateTime::TimeZone';
# spent 33µs making 1 call to DateTime::TimeZone::OffsetOnly::BEGIN@6 # spent 27µs making 1 call to parent::import, recursion: max depth 1, sum of overlapping time 27µs
7
82782µs1988µs
# spent 988µs (916+73) within DateTime::TimeZone::OffsetOnly::BEGIN@8 which was called: # once (916µs+73µs) by parent::import at line 8
use DateTime::TimeZone::UTC;
# spent 988µs making 1 call to DateTime::TimeZone::OffsetOnly::BEGIN@8
921.17ms212.1ms
# spent 12.0ms (1.14+10.9) within DateTime::TimeZone::OffsetOnly::BEGIN@9 which was called: # once (1.14ms+10.9ms) by parent::import at line 9
use Params::Validate qw( validate SCALAR );
# spent 12.0ms making 1 call to DateTime::TimeZone::OffsetOnly::BEGIN@9 # spent 53µs making 1 call to Exporter::import
10
11sub new {
12 my $class = shift;
13 my %p = validate(
14 @_, {
15 offset => { type => SCALAR },
16 }
17 );
18
19 my $offset = DateTime::TimeZone::offset_as_seconds( $p{offset} );
20
21 die "Invalid offset: $p{offset}\n" unless defined $offset;
22
23 return DateTime::TimeZone::UTC->new unless $offset;
24
25 my $self = {
26 name => DateTime::TimeZone::offset_as_string($offset),
27 offset => $offset,
28 };
29
30 return bless $self, $class;
31}
32
33sub is_dst_for_datetime {0}
34
35sub offset_for_datetime { $_[0]->{offset} }
36sub offset_for_local_datetime { $_[0]->{offset} }
37
3848µs
# spent 3µs within DateTime::TimeZone::OffsetOnly::is_utc which was called 4 times, avg 700ns/call: # 2 times (2µs+0s) by DateTime::_calc_utc_rd at line 389 of DateTime.pm, avg 950ns/call # 2 times (900ns+0s) by DateTime::_calc_local_rd at line 436 of DateTime.pm, avg 450ns/call
sub is_utc {0}
39
40sub short_name_for_datetime { $_[0]->name }
41
42sub category {undef}
43
44sub STORABLE_freeze {
45 my $self = shift;
46
47 return $self->name;
48}
49
50sub STORABLE_thaw {
51 my $self = shift;
52 my $cloning = shift;
53 my $serialized = shift;
54
55 my $class = ref $self || $self;
56
57 my $obj;
58 if ( $class->isa(__PACKAGE__) ) {
59 $obj = __PACKAGE__->new( offset => $serialized );
60 }
61 else {
62 $obj = $class->new( offset => $serialized );
63 }
64
65 %$self = %$obj;
66
67 return $self;
68}
69
7012µs1;
71
72# ABSTRACT: A DateTime::TimeZone object that just contains an offset
73
74__END__