line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
2
|
|
|
2
|
|
89585
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
28
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2019'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
2
|
|
|
2
|
|
12
|
use Time::HiRes; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
15
|
|
8
|
2
|
|
|
2
|
|
731
|
use namespace::clean; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
23
|
|
9
|
2
|
|
|
2
|
|
152
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
15
|
|
10
|
2
|
|
|
2
|
|
993
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
14
|
|
11
|
|
|
|
|
|
|
with 'Catmandu::Fix::Inlineable'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has seconds => (fix_arg => 1); |
14
|
|
|
|
|
|
|
has units => (fix_arg => 1); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my ($self, $data) = @_; |
17
|
|
|
|
|
|
|
|
18
|
4
|
|
|
4
|
0
|
31
|
my $sleep = $self->seconds; |
19
|
|
|
|
|
|
|
my $units = $self->units; |
20
|
4
|
|
|
|
|
16
|
|
21
|
4
|
|
|
|
|
16
|
if ($units =~ /^microsecond(s)?$/i) { } |
22
|
|
|
|
|
|
|
elsif ($units =~ /^millisecond(s)$/i) { |
23
|
4
|
50
|
|
|
|
40
|
$sleep *= 1000; |
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
24
|
|
|
|
|
|
|
} |
25
|
0
|
|
|
|
|
0
|
elsif ($units =~ /^second(s)?$/i) { |
26
|
|
|
|
|
|
|
$sleep *= 1000000; |
27
|
|
|
|
|
|
|
} |
28
|
3
|
|
|
|
|
13
|
elsif ($units =~ /^minute(s)?$/i) { |
29
|
|
|
|
|
|
|
$sleep *= 60 * 1000000; |
30
|
|
|
|
|
|
|
} |
31
|
0
|
|
|
|
|
0
|
elsif ($units =~ /^hour(s)?$/i) { |
32
|
|
|
|
|
|
|
$sleep *= 3600 * 1000000; |
33
|
|
|
|
|
|
|
} |
34
|
0
|
|
|
|
|
0
|
else { |
35
|
|
|
|
|
|
|
$sleep *= 1000000; |
36
|
|
|
|
|
|
|
} |
37
|
1
|
|
|
|
|
3
|
|
38
|
|
|
|
|
|
|
Time::HiRes::usleep($sleep); |
39
|
|
|
|
|
|
|
|
40
|
4
|
|
|
|
|
2500986
|
$data; |
41
|
|
|
|
|
|
|
} |
42
|
4
|
|
|
|
|
476
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=pod |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 NAME |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Catmandu::Fix::sleep - Do nothing for a specified amount of time |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 SYNOPSIS |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sleep(10,MICROSECONDS) |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sleep(3,MILLISECONDS) |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sleep(1,SECOND) |
59
|
|
|
|
|
|
|
sleep(2,SECONDS) |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sleep(5,MINUTES) |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sleep(1,HOURS) |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SEE ALSO |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
L<Catmandu::Fix> |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |