Filename | /usr/local/perls/perl-5.26.1/lib/5.26.1/darwin-2level/Time/HiRes.pm |
Statements | Executed 17 statements in 1.63ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 480µs | 480µs | bootstrap (xsub) | Time::HiRes::
1 | 1 | 1 | 40µs | 40µs | BEGIN@3 | Time::HiRes::
4 | 1 | 1 | 29µs | 29µs | time (xsub) | Time::HiRes::
1 | 1 | 1 | 18µs | 29µs | BEGIN@4 | Time::HiRes::
1 | 1 | 1 | 16µs | 48µs | BEGIN@48 | Time::HiRes::
0 | 0 | 0 | 0s | 0s | AUTOLOAD | Time::HiRes::
0 | 0 | 0 | 0s | 0s | __ANON__[:49] | Time::HiRes::
0 | 0 | 0 | 0s | 0s | import | Time::HiRes::
0 | 0 | 0 | 0s | 0s | tv_interval | Time::HiRes::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Time::HiRes; | ||||
2 | |||||
3 | 2 | 99µs | 1 | 40µs | # spent 40µs within Time::HiRes::BEGIN@3 which was called:
# once (40µs+0s) by CPAN::has_inst at line 3 # spent 40µs making 1 call to Time::HiRes::BEGIN@3 |
4 | 3 | 358µs | 2 | 40µs | # spent 29µs (18+11) within Time::HiRes::BEGIN@4 which was called:
# once (18µs+11µs) by CPAN::has_inst at line 4 # spent 29µs making 1 call to Time::HiRes::BEGIN@4
# spent 11µs making 1 call to strict::import |
5 | |||||
6 | 1 | 2µs | require Exporter; | ||
7 | 1 | 598µs | require DynaLoader; | ||
8 | |||||
9 | 1 | 25µs | our @ISA = qw(Exporter DynaLoader); | ||
10 | |||||
11 | 1 | 1µs | our @EXPORT = qw( ); | ||
12 | 1 | 13µs | our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval | ||
13 | getitimer setitimer nanosleep clock_gettime clock_getres | ||||
14 | clock clock_nanosleep | ||||
15 | CLOCK_BOOTTIME CLOCK_HIGHRES | ||||
16 | CLOCK_MONOTONIC CLOCK_MONOTONIC_COARSE | ||||
17 | CLOCK_MONOTONIC_PRECISE CLOCK_MONOTONIC_RAW | ||||
18 | CLOCK_PROCESS_CPUTIME_ID | ||||
19 | CLOCK_REALTIME CLOCK_REALTIME_COARSE | ||||
20 | CLOCK_REALTIME_FAST CLOCK_REALTIME_PRECISE | ||||
21 | CLOCK_SECOND CLOCK_SOFTTIME CLOCK_THREAD_CPUTIME_ID | ||||
22 | CLOCK_TIMEOFDAY CLOCKS_PER_SEC | ||||
23 | ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF | ||||
24 | TIMER_ABSTIME | ||||
25 | d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer | ||||
26 | d_nanosleep d_clock_gettime d_clock_getres d_hires_utime | ||||
27 | d_clock d_clock_nanosleep | ||||
28 | stat lstat utime | ||||
29 | ); | ||||
30 | |||||
31 | 1 | 1µs | our $VERSION = '1.9741'; | ||
32 | 1 | 0s | our $XS_VERSION = $VERSION; | ||
33 | 1 | 48µs | $VERSION = eval $VERSION; # spent 4µs executing statements in string eval | ||
34 | |||||
35 | our $AUTOLOAD; | ||||
36 | sub AUTOLOAD { | ||||
37 | my $constname; | ||||
38 | ($constname = $AUTOLOAD) =~ s/.*:://; | ||||
39 | # print "AUTOLOAD: constname = $constname ($AUTOLOAD)\n"; | ||||
40 | die "&Time::HiRes::constant not defined" if $constname eq 'constant'; | ||||
41 | my ($error, $val) = constant($constname); | ||||
42 | # print "AUTOLOAD: error = $error, val = $val\n"; | ||||
43 | if ($error) { | ||||
44 | my (undef,$file,$line) = caller; | ||||
45 | die "$error at $file line $line.\n"; | ||||
46 | } | ||||
47 | { | ||||
48 | 2 | 443µs | 2 | 80µs | # spent 48µs (16+32) within Time::HiRes::BEGIN@48 which was called:
# once (16µs+32µs) by CPAN::has_inst at line 48 # spent 48µs making 1 call to Time::HiRes::BEGIN@48
# spent 32µs making 1 call to strict::unimport |
49 | *$AUTOLOAD = sub { $val }; | ||||
50 | } | ||||
51 | goto &$AUTOLOAD; | ||||
52 | } | ||||
53 | |||||
54 | sub import { | ||||
55 | my $this = shift; | ||||
56 | for my $i (@_) { | ||||
57 | if (($i eq 'clock_getres' && !&d_clock_getres) || | ||||
58 | ($i eq 'clock_gettime' && !&d_clock_gettime) || | ||||
59 | ($i eq 'clock_nanosleep' && !&d_clock_nanosleep) || | ||||
60 | ($i eq 'clock' && !&d_clock) || | ||||
61 | ($i eq 'nanosleep' && !&d_nanosleep) || | ||||
62 | ($i eq 'usleep' && !&d_usleep) || | ||||
63 | ($i eq 'utime' && !&d_hires_utime) || | ||||
64 | ($i eq 'ualarm' && !&d_ualarm)) { | ||||
65 | require Carp; | ||||
66 | Carp::croak("Time::HiRes::$i(): unimplemented in this platform"); | ||||
67 | } | ||||
68 | } | ||||
69 | Time::HiRes->export_to_level(1, $this, @_); | ||||
70 | } | ||||
71 | |||||
72 | 1 | 14µs | 1 | 2.40ms | bootstrap Time::HiRes; # spent 2.40ms making 1 call to DynaLoader::bootstrap |
73 | |||||
74 | # Preloaded methods go here. | ||||
75 | |||||
76 | sub tv_interval { | ||||
77 | # probably could have been done in C | ||||
78 | my ($a, $b) = @_; | ||||
79 | $b = [gettimeofday()] unless defined($b); | ||||
80 | (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000); | ||||
81 | } | ||||
82 | |||||
83 | # Autoload methods go after =cut, and are processed by the autosplit program. | ||||
84 | |||||
85 | 1 | 32µs | 1; | ||
86 | __END__ | ||||
# spent 480µs within Time::HiRes::bootstrap which was called:
# once (480µs+0s) by DynaLoader::bootstrap at line 214 of DynaLoader.pm | |||||
# spent 29µs within Time::HiRes::time which was called 4 times, avg 7µs/call:
# 4 times (29µs+0s) by CPAN::FTP::_mytime at line 77 of CPAN/FTP.pm, avg 7µs/call |