line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#line 1 |
2
|
|
|
|
|
|
|
package Time::HiRes; |
3
|
1
|
|
|
1
|
|
27851
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
52
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
341
|
|
5
|
|
|
|
|
|
|
use vars qw($VERSION $XS_VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
require DynaLoader; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
@ISA = qw(Exporter DynaLoader); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
@EXPORT = qw( ); |
13
|
|
|
|
|
|
|
@EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval |
14
|
|
|
|
|
|
|
getitimer setitimer nanosleep clock_gettime clock_getres |
15
|
|
|
|
|
|
|
clock clock_nanosleep |
16
|
|
|
|
|
|
|
CLOCK_HIGHRES CLOCK_MONOTONIC CLOCK_PROCESS_CPUTIME_ID |
17
|
|
|
|
|
|
|
CLOCK_REALTIME CLOCK_SOFTTIME CLOCK_THREAD_CPUTIME_ID |
18
|
|
|
|
|
|
|
CLOCK_TIMEOFDAY CLOCKS_PER_SEC |
19
|
|
|
|
|
|
|
ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF |
20
|
|
|
|
|
|
|
TIMER_ABSTIME |
21
|
|
|
|
|
|
|
d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer |
22
|
|
|
|
|
|
|
d_nanosleep d_clock_gettime d_clock_getres |
23
|
|
|
|
|
|
|
d_clock d_clock_nanosleep |
24
|
|
|
|
|
|
|
stat |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$VERSION = '1.9719'; |
28
|
|
|
|
|
|
|
$XS_VERSION = $VERSION; |
29
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
|
|
sub AUTOLOAD { |
32
|
0
|
|
|
|
|
|
my $constname; |
33
|
|
|
|
|
|
|
($constname = $AUTOLOAD) =~ s/.*:://; |
34
|
0
|
0
|
|
|
|
|
# print "AUTOLOAD: constname = $constname ($AUTOLOAD)\n"; |
35
|
0
|
|
|
|
|
|
die "&Time::HiRes::constant not defined" if $constname eq 'constant'; |
36
|
|
|
|
|
|
|
my ($error, $val) = constant($constname); |
37
|
0
|
0
|
|
|
|
|
# print "AUTOLOAD: error = $error, val = $val\n"; |
38
|
0
|
|
|
|
|
|
if ($error) { |
39
|
0
|
|
|
|
|
|
my (undef,$file,$line) = caller; |
40
|
|
|
|
|
|
|
die "$error at $file line $line.\n"; |
41
|
|
|
|
|
|
|
} |
42
|
1
|
|
|
1
|
|
7
|
{ |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
439
|
|
|
0
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
|
|
no strict 'refs'; |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
*$AUTOLOAD = sub { $val }; |
45
|
0
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
goto &$AUTOLOAD; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
0
|
|
|
sub import { |
50
|
0
|
|
|
|
|
|
my $this = shift; |
51
|
0
|
0
|
0
|
|
|
|
for my $i (@_) { |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
52
|
|
|
|
|
|
|
if (($i eq 'clock_getres' && !&d_clock_getres) || |
53
|
|
|
|
|
|
|
($i eq 'clock_gettime' && !&d_clock_gettime) || |
54
|
|
|
|
|
|
|
($i eq 'clock_nanosleep' && !&d_clock_nanosleep) || |
55
|
|
|
|
|
|
|
($i eq 'clock' && !&d_clock) || |
56
|
|
|
|
|
|
|
($i eq 'nanosleep' && !&d_nanosleep) || |
57
|
|
|
|
|
|
|
($i eq 'usleep' && !&d_usleep) || |
58
|
0
|
|
|
|
|
|
($i eq 'ualarm' && !&d_ualarm)) { |
59
|
0
|
|
|
|
|
|
require Carp; |
60
|
|
|
|
|
|
|
Carp::croak("Time::HiRes::$i(): unimplemented in this platform"); |
61
|
|
|
|
|
|
|
} |
62
|
0
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
Time::HiRes->export_to_level(1, $this, @_); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
bootstrap Time::HiRes; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# Preloaded methods go here. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub tv_interval { |
71
|
0
|
|
|
0
|
|
|
# probably could have been done in C |
72
|
0
|
0
|
|
|
|
|
my ($a, $b) = @_; |
73
|
0
|
|
|
|
|
|
$b = [gettimeofday()] unless defined($b); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
(${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |
80
|
|
|
|
|
|
|
__END__ |