line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::timestamp; |
2
|
2
|
|
|
2
|
|
1046
|
use Catmandu::Sane; |
|
2
|
|
|
|
|
114767
|
|
|
2
|
|
|
|
|
10
|
|
3
|
2
|
|
|
2
|
|
1255
|
use Time::HiRes; |
|
2
|
|
|
|
|
1989
|
|
|
2
|
|
|
|
|
6
|
|
4
|
2
|
|
|
2
|
|
136
|
use Moo; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
11
|
|
5
|
2
|
|
|
2
|
|
800
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
951
|
|
|
2
|
|
|
|
|
11
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = "0.0131"; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Catmandu::Fix::Base'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has path => ( fix_arg => 1 ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub emit { |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
0
|
|
my($self,$fixer) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $path = $fixer->split_path($self->path); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$fixer->emit_create_path($fixer->var,$path,sub{ |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
0
|
|
|
my $var = shift; |
22
|
0
|
|
|
|
|
|
"${var} = Time::HiRes::time;"; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
}); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
__END__ |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Catmandu::Fix::timestamp - Catmandu fix that stores the current unix time, in high resolution |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 SYNOPSIS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
#set the key 'timestamp' to the current time (unix timestamp) |
38
|
|
|
|
|
|
|
timestamp('timestamp') |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 AUTHOR |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Nicolas Franck, C<< <nicolas.franck at ugent.be> >> |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SEE ALSO |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
L<Catmandu::Fix> |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |