← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Wed Dec 14 15:33:55 2022
Reported on Wed Dec 14 15:40:03 2022

Filename/Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/darwin-2level/Time/HiRes.pm
StatementsExecuted 27 statements in 1.78ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11136µs36µsTime::HiRes::::BEGIN@3Time::HiRes::BEGIN@3
11121µs33µsTime::HiRes::::AUTOLOADTime::HiRes::AUTOLOAD
11116µs20µsTime::HiRes::::BEGIN@4Time::HiRes::BEGIN@4
11113µs13µsTime::HiRes::::clock_gettimeTime::HiRes::clock_gettime (xsub)
1119µs16µsTime::HiRes::::BEGIN@70Time::HiRes::BEGIN@70
1118µs8µsTime::HiRes::::CORE:substTime::HiRes::CORE:subst (opcode)
1114µs4µsTime::HiRes::::constantTime::HiRes::constant (xsub)
1113µs3µsTime::HiRes::::BEGIN@7Time::HiRes::BEGIN@7
1111µs1µsTime::HiRes::::__ANON__[:71]Time::HiRes::__ANON__[:71]
0000s0sTime::HiRes::::importTime::HiRes::import
0000s0sTime::HiRes::::tv_intervalTime::HiRes::tv_interval
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Time::HiRes;
2
3250µs136µs
# spent 36µs within Time::HiRes::BEGIN@3 which was called: # once (36µs+0s) by Mojo::Util::BEGIN@21 at line 3
{ use 5.006; }
# spent 36µs making 1 call to Time::HiRes::BEGIN@3
4342µs224µs
# spent 20µs (16+4) within Time::HiRes::BEGIN@4 which was called: # once (16µs+4µs) by Mojo::Util::BEGIN@21 at line 4
use strict;
# spent 20µs making 1 call to Time::HiRes::BEGIN@4 # spent 4µs making 1 call to strict::import
5
611µsrequire Exporter;
72219µs13µs
# spent 3µs within Time::HiRes::BEGIN@7 which was called: # once (3µs+0s) by Mojo::Util::BEGIN@21 at line 7
use XSLoader ();
# spent 3µs making 1 call to Time::HiRes::BEGIN@7
8
919µsour @ISA = qw(Exporter);
10
1110sour @EXPORT = qw( );
12# More or less this same list is in Makefile.PL. Should unify.
1314µsour @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
5310sour $VERSION = '1.9770';
5410sour $XS_VERSION = $VERSION;
55132µs$VERSION = eval $VERSION;
# spent 3µs executing statements in string eval
56
57our $AUTOLOAD;
58
# spent 33µs (21+12) within Time::HiRes::AUTOLOAD which was called: # once (21µs+12µs) by Mojo::Util::BEGIN@25 at line 25 of Mojo/Util.pm
sub AUTOLOAD {
5910s my $constname;
60115µs18µs ($constname = $AUTOLOAD) =~ s/.*:://;
# spent 8µs making 1 call to Time::HiRes::CORE:subst
61 # print "AUTOLOAD: constname = $constname ($AUTOLOAD)\n";
6211µs die "&Time::HiRes::constant not defined" if $constname eq 'constant';
6318µs14µs my ($error, $val) = constant($constname);
# spent 4µs making 1 call to Time::HiRes::constant
64 # print "AUTOLOAD: error = $error, val = $val\n";
6510s if ($error) {
66 my (undef,$file,$line) = caller;
67 die "$error at $file line $line.\n";
68 }
69 {
703303µs223µs
# spent 16µs (9+7) within Time::HiRes::BEGIN@70 which was called: # once (9µs+7µs) by Mojo::Util::BEGIN@21 at line 70
no strict 'refs';
# spent 16µs making 1 call to Time::HiRes::BEGIN@70 # spent 7µs making 1 call to strict::unimport
7127µs
# spent 1µ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 (1µs+0s) by Mojo::Util::BEGIN@25 at line 73
*$AUTOLOAD = sub { $val };
72 }
7314µs11µs goto &$AUTOLOAD;
# spent 1µs making 1 call to Time::HiRes::__ANON__[Time/HiRes.pm:71]
74}
75
76sub 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
9411.07ms11.07msXSLoader::load( 'Time::HiRes', $XS_VERSION );
# spent 1.07ms making 1 call to XSLoader::load
95
96# Preloaded methods go here.
97
98sub 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
107112µs1;
108__END__
 
# spent 8µs within Time::HiRes::CORE:subst which was called: # once (8µs+0s) by Time::HiRes::AUTOLOAD at line 60
sub Time::HiRes::CORE:subst; # opcode
# spent 13µs within Time::HiRes::clock_gettime which was called: # once (13µs+0s) by Mojo::Util::BEGIN@25 at line 25 of Mojo/Util.pm
sub Time::HiRes::clock_gettime; # xsub
# spent 4µs within Time::HiRes::constant which was called: # once (4µs+0s) by Time::HiRes::AUTOLOAD at line 63
sub Time::HiRes::constant; # xsub