Filename | /Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/darwin-2level/Time/HiRes.pm |
Statements | Executed 27 statements in 4.30ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 33µs | 33µs | BEGIN@3 | Time::HiRes::
1 | 1 | 1 | 16µs | 27µs | AUTOLOAD | Time::HiRes::
1 | 1 | 1 | 11µs | 11µs | clock_gettime (xsub) | Time::HiRes::
1 | 1 | 1 | 7µs | 14µs | BEGIN@70 | Time::HiRes::
1 | 1 | 1 | 7µs | 7µs | CORE:subst (opcode) | Time::HiRes::
1 | 1 | 1 | 5µs | 10µs | BEGIN@4 | Time::HiRes::
1 | 1 | 1 | 4µs | 4µs | constant (xsub) | Time::HiRes::
1 | 1 | 1 | 2µs | 2µs | BEGIN@7 | Time::HiRes::
1 | 1 | 1 | 2µs | 2µs | __ANON__[:71] | 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 | 44µs | 1 | 33µs | # spent 33µs within Time::HiRes::BEGIN@3 which was called:
# once (33µs+0s) by Mojo::Util::BEGIN@21 at line 3 # spent 33µs making 1 call to Time::HiRes::BEGIN@3 |
4 | 3 | 27µs | 2 | 15µs | # spent 10µs (5+5) within Time::HiRes::BEGIN@4 which was called:
# once (5µs+5µs) by Mojo::Util::BEGIN@21 at line 4 # spent 10µs making 1 call to Time::HiRes::BEGIN@4
# spent 5µs making 1 call to strict::import |
5 | |||||
6 | 1 | 0s | require Exporter; | ||
7 | 2 | 172µs | 1 | 2µs | # spent 2µs within Time::HiRes::BEGIN@7 which was called:
# once (2µs+0s) by Mojo::Util::BEGIN@21 at line 7 # spent 2µs making 1 call to Time::HiRes::BEGIN@7 |
8 | |||||
9 | 1 | 8µs | our @ISA = qw(Exporter); | ||
10 | |||||
11 | 1 | 0s | our @EXPORT = qw( ); | ||
12 | # More or less this same list is in Makefile.PL. Should unify. | ||||
13 | 1 | 2µs | our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval | ||
14 | getitimer setitimer nanosleep clock_gettime clock_getres | ||||
15 | clock clock_nanosleep | ||||
16 | CLOCKS_PER_SEC | ||||
17 | CLOCK_BOOTTIME | ||||
18 | CLOCK_HIGHRES | ||||
19 | CLOCK_MONOTONIC | ||||
20 | CLOCK_MONOTONIC_COARSE | ||||
21 | CLOCK_MONOTONIC_FAST | ||||
22 | CLOCK_MONOTONIC_PRECISE | ||||
23 | CLOCK_MONOTONIC_RAW | ||||
24 | CLOCK_PROCESS_CPUTIME_ID | ||||
25 | CLOCK_PROF | ||||
26 | CLOCK_REALTIME | ||||
27 | CLOCK_REALTIME_COARSE | ||||
28 | CLOCK_REALTIME_FAST | ||||
29 | CLOCK_REALTIME_PRECISE | ||||
30 | CLOCK_REALTIME_RAW | ||||
31 | CLOCK_SECOND | ||||
32 | CLOCK_SOFTTIME | ||||
33 | CLOCK_THREAD_CPUTIME_ID | ||||
34 | CLOCK_TIMEOFDAY | ||||
35 | CLOCK_UPTIME | ||||
36 | CLOCK_UPTIME_COARSE | ||||
37 | CLOCK_UPTIME_FAST | ||||
38 | CLOCK_UPTIME_PRECISE | ||||
39 | CLOCK_UPTIME_RAW | ||||
40 | CLOCK_VIRTUAL | ||||
41 | ITIMER_PROF | ||||
42 | ITIMER_REAL | ||||
43 | ITIMER_REALPROF | ||||
44 | ITIMER_VIRTUAL | ||||
45 | TIMER_ABSTIME | ||||
46 | d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer | ||||
47 | d_nanosleep d_clock_gettime d_clock_getres | ||||
48 | d_clock d_clock_nanosleep d_hires_stat | ||||
49 | d_futimens d_utimensat d_hires_utime | ||||
50 | stat lstat utime | ||||
51 | ); | ||||
52 | |||||
53 | 1 | 0s | our $VERSION = '1.9770'; | ||
54 | 1 | 0s | our $XS_VERSION = $VERSION; | ||
55 | 1 | 25µs | $VERSION = eval $VERSION; # spent 2µs executing statements in string eval | ||
56 | |||||
57 | our $AUTOLOAD; | ||||
58 | # spent 27µs (16+11) within Time::HiRes::AUTOLOAD which was called:
# once (16µs+11µs) by Mojo::Util::BEGIN@25 at line 25 of Mojo/Util.pm | ||||
59 | 1 | 0s | my $constname; | ||
60 | 1 | 13µs | 1 | 7µs | ($constname = $AUTOLOAD) =~ s/.*:://; # spent 7µs making 1 call to Time::HiRes::CORE:subst |
61 | # print "AUTOLOAD: constname = $constname ($AUTOLOAD)\n"; | ||||
62 | 1 | 1µs | die "&Time::HiRes::constant not defined" if $constname eq 'constant'; | ||
63 | 1 | 7µs | 1 | 4µs | my ($error, $val) = constant($constname); # spent 4µs making 1 call to Time::HiRes::constant |
64 | # print "AUTOLOAD: error = $error, val = $val\n"; | ||||
65 | 1 | 0s | if ($error) { | ||
66 | my (undef,$file,$line) = caller; | ||||
67 | die "$error at $file line $line.\n"; | ||||
68 | } | ||||
69 | { | ||||
70 | 3 | 232µs | 2 | 21µs | # spent 14µs (7+7) within Time::HiRes::BEGIN@70 which was called:
# once (7µs+7µs) by Mojo::Util::BEGIN@21 at line 70 # spent 14µs making 1 call to Time::HiRes::BEGIN@70
# spent 7µs making 1 call to strict::unimport |
71 | 2 | 6µs | # spent 2µs within Time::HiRes::__ANON__[/Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/darwin-2level/Time/HiRes.pm:71] which was called:
# once (2µs+0s) by Mojo::Util::BEGIN@25 at line 73 | ||
72 | } | ||||
73 | 1 | 4µs | 1 | 2µs | goto &$AUTOLOAD; # spent 2µs making 1 call to Time::HiRes::__ANON__[Time/HiRes.pm:71] |
74 | } | ||||
75 | |||||
76 | sub import { | ||||
77 | my $this = shift; | ||||
78 | for my $i (@_) { | ||||
79 | if (($i eq 'clock_getres' && !&d_clock_getres) || | ||||
80 | ($i eq 'clock_gettime' && !&d_clock_gettime) || | ||||
81 | ($i eq 'clock_nanosleep' && !&d_clock_nanosleep) || | ||||
82 | ($i eq 'clock' && !&d_clock) || | ||||
83 | ($i eq 'nanosleep' && !&d_nanosleep) || | ||||
84 | ($i eq 'usleep' && !&d_usleep) || | ||||
85 | ($i eq 'utime' && !&d_hires_utime) || | ||||
86 | ($i eq 'ualarm' && !&d_ualarm)) { | ||||
87 | require Carp; | ||||
88 | Carp::croak("Time::HiRes::$i(): unimplemented in this platform"); | ||||
89 | } | ||||
90 | } | ||||
91 | Time::HiRes->export_to_level(1, $this, @_); | ||||
92 | } | ||||
93 | |||||
94 | 1 | 3.74ms | 1 | 3.73ms | XSLoader::load( 'Time::HiRes', $XS_VERSION ); # spent 3.73ms making 1 call to XSLoader::load |
95 | |||||
96 | # Preloaded methods go here. | ||||
97 | |||||
98 | sub tv_interval { | ||||
99 | # probably could have been done in C | ||||
100 | my ($a, $b) = @_; | ||||
101 | $b = [gettimeofday()] unless defined($b); | ||||
102 | (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000); | ||||
103 | } | ||||
104 | |||||
105 | # Autoload methods go after =cut, and are processed by the autosplit program. | ||||
106 | |||||
107 | 1 | 19µs | 1; | ||
108 | __END__ | ||||
# spent 7µs within Time::HiRes::CORE:subst which was called:
# once (7µs+0s) by Time::HiRes::AUTOLOAD at line 60 | |||||
# spent 11µs within Time::HiRes::clock_gettime which was called:
# once (11µs+0s) by Mojo::Util::BEGIN@25 at line 25 of Mojo/Util.pm | |||||
# spent 4µs within Time::HiRes::constant which was called:
# once (4µs+0s) by Time::HiRes::AUTOLOAD at line 63 |