line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::timestamp; |
2
|
2
|
|
|
2
|
|
737
|
use Catmandu::Sane; |
|
2
|
|
|
|
|
109322
|
|
|
2
|
|
|
|
|
9
|
|
3
|
2
|
|
|
2
|
|
1167
|
use Time::HiRes; |
|
2
|
|
|
|
|
1991
|
|
|
2
|
|
|
|
|
7
|
|
4
|
2
|
|
|
2
|
|
133
|
use Moo; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
9
|
|
5
|
2
|
|
|
2
|
|
725
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
597
|
|
|
2
|
|
|
|
|
10
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = "0.0130"; |
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 |