line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Time::HR; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5694
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
5
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
85
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
|
|
|
|
|
|
require DynaLoader; |
10
|
1
|
|
|
1
|
|
937
|
use AutoLoader; |
|
1
|
|
|
|
|
1573
|
|
|
1
|
|
|
|
|
5
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @ISA = qw(Exporter DynaLoader); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
15
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
16
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# This allows declaration use Time::HR ':all'; |
19
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
20
|
|
|
|
|
|
|
# will save memory. |
21
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
22
|
|
|
|
|
|
|
gethrtime |
23
|
|
|
|
|
|
|
) ] ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
our @EXPORT = qw( |
28
|
|
|
|
|
|
|
gethrtime |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub AUTOLOAD { |
33
|
|
|
|
|
|
|
# This AUTOLOAD is used to 'autoload' constants from the constant() |
34
|
|
|
|
|
|
|
# XS function. If a constant is not found then control is passed |
35
|
|
|
|
|
|
|
# to the AUTOLOAD in AutoLoader. |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
|
|
my $constname; |
38
|
0
|
|
|
|
|
|
our $AUTOLOAD; |
39
|
0
|
|
|
|
|
|
($constname = $AUTOLOAD) =~ s/.*:://; |
40
|
0
|
0
|
|
|
|
|
croak "& not defined" if $constname eq 'constant'; |
41
|
0
|
0
|
|
|
|
|
my $val = constant($constname, @_ ? $_[0] : 0); |
42
|
0
|
0
|
|
|
|
|
if ($! != 0) { |
43
|
1
|
0
|
0
|
1
|
|
1198
|
if ($! =~ /Invalid/ || $!{EINVAL}) { |
|
1
|
|
|
|
|
1285
|
|
|
1
|
|
|
|
|
58
|
|
|
0
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
$AutoLoader::AUTOLOAD = $AUTOLOAD; |
45
|
0
|
|
|
|
|
|
goto &AutoLoader::AUTOLOAD; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
else { |
48
|
0
|
|
|
|
|
|
croak "Your vendor has not defined Time::HR macro $constname"; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
{ |
52
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
143
|
|
|
0
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# Fixed between 5.005_53 and 5.005_61 |
54
|
0
|
0
|
|
|
|
|
if ($] >= 5.00561) { |
55
|
0
|
|
|
0
|
|
|
*$AUTOLOAD = sub () { $val }; |
|
0
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
else { |
58
|
0
|
|
|
0
|
|
|
*$AUTOLOAD = sub { $val }; |
|
0
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
0
|
|
|
|
|
|
goto &$AUTOLOAD; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
bootstrap Time::HR $VERSION; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# Preloaded methods go here. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
71
|
|
|
|
|
|
|
__END__ |