← Index
NYTProf Performance Profile   « line view »
For scripts/bench.pl
  Run on Mon Oct 22 16:48:56 2018
Reported on Mon Oct 22 16:49:10 2018

Filename/usr/lib/x86_64-linux-gnu/perl/5.26/Time/HiRes.pm
StatementsExecuted 25 statements in 5.23ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.89ms2.05msTime::HiRes::::BEGIN@4Time::HiRes::BEGIN@4
11165µs65µsTime::HiRes::::BEGIN@3Time::HiRes::BEGIN@3
11157µs57µsTime::HiRes::::bootstrapTime::HiRes::bootstrap (xsub)
11129µs80µsTime::HiRes::::BEGIN@48Time::HiRes::BEGIN@48
11117µs2.54msTime::HiRes::::importTime::HiRes::import
22211µs11µsTime::HiRes::::gettimeofdayTime::HiRes::gettimeofday (xsub)
11110µs12µsTime::HiRes::::tv_intervalTime::HiRes::tv_interval
0000s0sTime::HiRes::::AUTOLOADTime::HiRes::AUTOLOAD
0000s0sTime::HiRes::::__ANON__[:49]Time::HiRes::__ANON__[:49]
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
32186µs165µs
# spent 65µs within Time::HiRes::BEGIN@3 which was called: # once (65µs+0s) by main::BEGIN@27 at line 3
{ use 5.006; }
# spent 65µs making 1 call to Time::HiRes::BEGIN@3
431.89ms22.06ms
# spent 2.05ms (1.89+158µs) within Time::HiRes::BEGIN@4 which was called: # once (1.89ms+158µs) by main::BEGIN@27 at line 4
use strict;
# spent 2.05ms making 1 call to Time::HiRes::BEGIN@4 # spent 14µs making 1 call to strict::import
5
611.74msrequire Exporter;
71210µsrequire DynaLoader;
8
9116µsour @ISA = qw(Exporter DynaLoader);
10
111200nsour @EXPORT = qw( );
1216µsour @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
311400nsour $VERSION = '1.9741';
321300nsour $XS_VERSION = $VERSION;
33126µs$VERSION = eval $VERSION;
# spent 3µs executing statements in string eval
34
35our $AUTOLOAD;
36sub 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 {
4821.12ms2131µs
# spent 80µs (29+51) within Time::HiRes::BEGIN@48 which was called: # once (29µs+51µs) by main::BEGIN@27 at line 48
no strict 'refs';
# spent 80µs making 1 call to Time::HiRes::BEGIN@48 # spent 51µs making 1 call to strict::unimport
49 *$AUTOLOAD = sub { $val };
50 }
51 goto &$AUTOLOAD;
52}
53
54
# spent 2.54ms (17µs+2.52) within Time::HiRes::import which was called: # once (17µs+2.52ms) by main::BEGIN@27 at line 27 of /home/tmurray/proj/Game-Collisions/scripts/bench.pl
sub import {
551700ns my $this = shift;
5611µs for my $i (@_) {
5723µs 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 }
6917µs12.34ms Time::HiRes->export_to_level(1, $this, @_);
# spent 2.34ms making 1 call to Exporter::export_to_level
70}
71
7219µs1342µsbootstrap Time::HiRes;
# spent 342µs making 1 call to DynaLoader::bootstrap
73
74# Preloaded methods go here.
75
76
# spent 12µs (10+2) within Time::HiRes::tv_interval which was called: # once (10µs+2µs) by main::RUNTIME at line 6043 of /home/tmurray/proj/Game-Collisions/scripts/bench.pl
sub tv_interval {
77 # probably could have been done in C
781400ns my ($a, $b) = @_;
7916µs12µs $b = [gettimeofday()] unless defined($b);
# spent 2µs making 1 call to Time::HiRes::gettimeofday
8016µs (${$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
85116µs1;
86__END__
 
# spent 57µs within Time::HiRes::bootstrap which was called: # once (57µs+0s) by DynaLoader::bootstrap at line 204 of DynaLoader.pm
sub Time::HiRes::bootstrap; # xsub
# spent 11µs within Time::HiRes::gettimeofday which was called 2 times, avg 5µs/call: # once (9µs+0s) by main::RUNTIME at line 6041 of /home/tmurray/proj/Game-Collisions/scripts/bench.pl # once (2µs+0s) by Time::HiRes::tv_interval at line 79
sub Time::HiRes::gettimeofday; # xsub