line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package autobox::Numeric::Time; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
881
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
81
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
227
|
|
5
|
2
|
|
|
2
|
|
11
|
use Carp; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
202
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
13
|
use base qw(autobox); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1162
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import { |
12
|
18
|
|
|
18
|
|
88
|
shift->SUPER::import(NUMBER => 'autobox::Numeric::Time::Impl', @_); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package # hide from pause |
16
|
|
|
|
|
|
|
autobox::Numeric::Time::Impl; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub seconds { |
19
|
2
|
|
|
2
|
|
13
|
return $_[0]; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
*second = \&seconds; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub minutes { |
24
|
2
|
|
|
2
|
|
17
|
return $_[0] * 60; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
*minute = \&minutes; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub hours { |
29
|
2
|
|
|
2
|
|
16
|
return $_[0] * 3600; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
*hour = \&hours; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub days { |
34
|
2
|
|
|
2
|
|
18
|
return $_[0] * 3600 * 24; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
*day = \&days; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub weeks { |
39
|
2
|
|
|
2
|
|
18
|
return $_[0] * 3600 * 24 * 7; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
*week = \&weeks; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub fortnights { |
44
|
2
|
|
|
2
|
|
16
|
return $_[0] * 3600 * 24 * 7 * 2; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
*fortnight = \&fortnights; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub months { |
49
|
2
|
|
|
2
|
|
15
|
return $_[0] * 3600 * 24 * 30; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
*month = \&months; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub years { |
54
|
2
|
|
|
2
|
|
25
|
return $_[0] * 3600 * 24 * 365.25; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
*year = \&years; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |