line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DateTime::HiRes; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
102454
|
use strict; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
904
|
use DateTime; |
|
1
|
|
|
|
|
510228
|
|
|
1
|
|
|
|
|
52
|
|
9
|
1
|
|
|
1
|
|
26
|
use Time::HiRes; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
9
|
|
10
|
|
|
|
|
|
|
|
11
|
5
|
|
|
5
|
1
|
4833
|
sub now { shift; DateTime->from_epoch( epoch => Time::HiRes::time, @_ ) } |
|
5
|
|
|
|
|
32
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
1; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# ABSTRACT: Create DateTime objects with sub-second current time resolution |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
__END__ |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=pod |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=encoding UTF-8 |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
DateTime::HiRes - Create DateTime objects with sub-second current time resolution |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 VERSION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
version 0.03 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SYNOPSIS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
use DateTime::HiRes; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my $dt = DateTime::HiRes->now; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
This module enables you to generate DateTime objects that represent the current |
40
|
|
|
|
|
|
|
time with sub-second resolution. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 METHODS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This class provides the following methods: |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 DateTime::HiRes->now( ... ) |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Similar to C<DateTime-E<gt>now> but uses C<Time::HiRes::time()> instead of |
49
|
|
|
|
|
|
|
Perl's C<CORE::time()> to determine the current time. The returned object will |
50
|
|
|
|
|
|
|
have fractional second information stored as nanoseconds. The sub-second |
51
|
|
|
|
|
|
|
precision of C<Time::HiRes> is highly system dependent and will vary from one |
52
|
|
|
|
|
|
|
platform to the next. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Just like C<DateTime-E<gt>now> it accepts "time_zone" and "locale" parameters. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 CREDITS |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Everyone at the DateTime C<Asylum>. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 SEE ALSO |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
L<DateTime>, L<Time::HiRes> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SUPPORT |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Bugs may be submitted at L<https://github.com/houseabsolute/DateTime-HiRes/issues>. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 SOURCE |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
The source code repository for DateTime-HiRes can be found at L<https://github.com/houseabsolute/DateTime-HiRes>. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 AUTHORS |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=over 4 |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Joshua Hoblitt <jhoblitt@cpan.org> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=back |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 CONTRIBUTOR |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=for stopwords Roy Ivy III |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Roy Ivy III <rivy.dev@gmail.com> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This software is Copyright (c) 2020 by Joshua Hoblitt. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
This is free software, licensed under: |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
The full text of the license can be found in the |
103
|
|
|
|
|
|
|
F<LICENSE> file included with this distribution. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |