| Filename | /usr/lib/x86_64-linux-gnu/perl/5.26/Time/HiRes.pm |
| Statements | Executed 25 statements in 5.23ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1.89ms | 2.05ms | Time::HiRes::BEGIN@4 |
| 1 | 1 | 1 | 65µs | 65µs | Time::HiRes::BEGIN@3 |
| 1 | 1 | 1 | 57µs | 57µs | Time::HiRes::bootstrap (xsub) |
| 1 | 1 | 1 | 29µs | 80µs | Time::HiRes::BEGIN@48 |
| 1 | 1 | 1 | 17µs | 2.54ms | Time::HiRes::import |
| 2 | 2 | 2 | 11µs | 11µs | Time::HiRes::gettimeofday (xsub) |
| 1 | 1 | 1 | 10µs | 12µs | Time::HiRes::tv_interval |
| 0 | 0 | 0 | 0s | 0s | Time::HiRes::AUTOLOAD |
| 0 | 0 | 0 | 0s | 0s | Time::HiRes::__ANON__[:49] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Time::HiRes; | ||||
| 2 | |||||
| 3 | 2 | 186µs | 1 | 65µs | # spent 65µs within Time::HiRes::BEGIN@3 which was called:
# once (65µs+0s) by main::BEGIN@27 at line 3 # spent 65µs making 1 call to Time::HiRes::BEGIN@3 |
| 4 | 3 | 1.89ms | 2 | 2.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 # spent 2.05ms making 1 call to Time::HiRes::BEGIN@4
# spent 14µs making 1 call to strict::import |
| 5 | |||||
| 6 | 1 | 1.74ms | require Exporter; | ||
| 7 | 1 | 210µs | require DynaLoader; | ||
| 8 | |||||
| 9 | 1 | 16µs | our @ISA = qw(Exporter DynaLoader); | ||
| 10 | |||||
| 11 | 1 | 200ns | our @EXPORT = qw( ); | ||
| 12 | 1 | 6µ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 | 400ns | our $VERSION = '1.9741'; | ||
| 32 | 1 | 300ns | our $XS_VERSION = $VERSION; | ||
| 33 | 1 | 26µs | $VERSION = eval $VERSION; # spent 3µ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 | 1.12ms | 2 | 131µ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 # 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 | ||||
| 55 | 1 | 700ns | my $this = shift; | ||
| 56 | 1 | 1µs | for my $i (@_) { | ||
| 57 | 2 | 3µ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 | } | ||||
| 69 | 1 | 7µs | 1 | 2.34ms | Time::HiRes->export_to_level(1, $this, @_); # spent 2.34ms making 1 call to Exporter::export_to_level |
| 70 | } | ||||
| 71 | |||||
| 72 | 1 | 9µs | 1 | 342µs | bootstrap 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 | ||||
| 77 | # probably could have been done in C | ||||
| 78 | 1 | 400ns | my ($a, $b) = @_; | ||
| 79 | 1 | 6µs | 1 | 2µs | $b = [gettimeofday()] unless defined($b); # spent 2µs making 1 call to Time::HiRes::gettimeofday |
| 80 | 1 | 6µ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 | |||||
| 85 | 1 | 16µs | 1; | ||
| 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 | |||||
# 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 |