Profile of Time/HiRes.pm

← Index
NYTProf Performance Profile «line view»
For examples/benchmark4.pl
Run on Thu Aug 28 19:01:43 2014
Reported on Thu Aug 28 19:02:42 2014

Filename | /usr/lib/perl/5.18/Time/HiRes.pm
Statements | Executed 22 statements in 641µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 36µs | 36µs | Time::HiRes::::bootstrapTime::HiRes::bootstrap (xsub)
1 | 1 | 1 | 15µs | 15µs | Time::HiRes::::BEGIN@3Time::HiRes::BEGIN@3
1 | 1 | 1 | 12µs | 1.66ms | Time::HiRes::::importTime::HiRes::import
1 | 1 | 1 | 7µs | 17µs | Time::HiRes::::BEGIN@43Time::HiRes::BEGIN@43
1 | 1 | 1 | 6µs | 18µs | Time::HiRes::::BEGIN@4Time::HiRes::BEGIN@4
0 | 0 | 0 | 0s | 0s | Time::HiRes::::AUTOLOADTime::HiRes::AUTOLOAD
0 | 0 | 0 | 0s | 0s | Time::HiRes::::__ANON__[:44]Time::HiRes::__ANON__[:44]
0 | 0 | 0 | 0s | 0s | Time::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
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Time::HiRes;
2 |  |  |  |  |
3 | 3 | 49µs | 1 | 15µs | # spent 15µs within Time::HiRes::BEGIN@3 which was called: # once (15µs+0s) by Benchmark::BEGIN@453 at line 3 { use 5.006; } # spent 15µs making 1 call to Time::HiRes::BEGIN@3
4 | 2 | 191µs | 2 | 30µs | # spent 18µs (6+12) within Time::HiRes::BEGIN@4 which was called: # once (6µs+12µs) by Benchmark::BEGIN@453 at line 4 use strict; # spent 18µs making 1 call to Time::HiRes::BEGIN@4 # spent 12µs making 1 call to strict::import
5 |  |  |  |  |
6 | 1 | 600ns |  |  | require Exporter;
7 | 1 | 88µs |  |  | require DynaLoader;
8 |  |  |  |  |
9 | 1 | 9µs |  |  | our @ISA = qw(Exporter DynaLoader);
10 |  |  |  |  |
11 | 1 | 200ns |  |  | our @EXPORT = qw( );
12 | 1 | 5µ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_HIGHRES CLOCK_MONOTONIC CLOCK_PROCESS_CPUTIME_ID
16 |  |  |  |  | CLOCK_REALTIME CLOCK_SOFTTIME CLOCK_THREAD_CPUTIME_ID
17 |  |  |  |  | CLOCK_TIMEOFDAY CLOCKS_PER_SEC
18 |  |  |  |  | ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF
19 |  |  |  |  | TIMER_ABSTIME
20 |  |  |  |  | d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer
21 |  |  |  |  | d_nanosleep d_clock_gettime d_clock_getres
22 |  |  |  |  | d_clock d_clock_nanosleep
23 |  |  |  |  | stat
24 |  |  |  |  | );
25 |  |  |  |  |
26 | 1 | 200ns |  |  | our $VERSION = '1.9725';
27 | 1 | 200ns |  |  | our $XS_VERSION = $VERSION;
28 | 1 | 14µs |  |  | $VERSION = eval $VERSION; # spent 2µs executing statements in string eval
29 |  |  |  |  |
30 | 1 | 100ns |  |  | our $AUTOLOAD;
31 |  |  |  |  | sub AUTOLOAD {
32 |  |  |  |  | my $constname;
33 |  |  |  |  | ($constname = $AUTOLOAD) =~ s/.*:://;
34 |  |  |  |  | # print "AUTOLOAD: constname = $constname ($AUTOLOAD)\n";
35 |  |  |  |  | die "&Time::HiRes::constant not defined" if $constname eq 'constant';
36 |  |  |  |  | my ($error, $val) = constant($constname);
37 |  |  |  |  | # print "AUTOLOAD: error = $error, val = $val\n";
38 |  |  |  |  | if ($error) {
39 |  |  |  |  | my (undef,$file,$line) = caller;
40 |  |  |  |  | die "$error at $file line $line.\n";
41 |  |  |  |  | }
42 |  |  |  |  | {
43 | 2 | 261µs | 2 | 28µs | # spent 17µs (7+10) within Time::HiRes::BEGIN@43 which was called: # once (7µs+10µs) by Benchmark::BEGIN@453 at line 43 no strict 'refs'; # spent 17µs making 1 call to Time::HiRes::BEGIN@43 # spent 10µs making 1 call to strict::unimport
44 |  |  |  |  | *$AUTOLOAD = sub { $val };
45 |  |  |  |  | }
46 |  |  |  |  | goto &$AUTOLOAD;
47 |  |  |  |  | }
48 |  |  |  |  |
49 |  |  |  |  | # spent 1.66ms (12µs+1.65) within Time::HiRes::import which was called: # once (12µs+1.65ms) by Benchmark::BEGIN@453 at line 455 of Benchmark.pm sub import {
50 | 1 | 400ns |  |  | my $this = shift;
51 | 1 | 800ns |  |  | for my $i (@_) {
52 | 1 | 2µs |  |  | if (($i eq 'clock_getres' && !&d_clock_getres) ||
53 |  |  |  |  | ($i eq 'clock_gettime' && !&d_clock_gettime) ||
54 |  |  |  |  | ($i eq 'clock_nanosleep' && !&d_clock_nanosleep) ||
55 |  |  |  |  | ($i eq 'clock' && !&d_clock) ||
56 |  |  |  |  | ($i eq 'nanosleep' && !&d_nanosleep) ||
57 |  |  |  |  | ($i eq 'usleep' && !&d_usleep) ||
58 |  |  |  |  | ($i eq 'ualarm' && !&d_ualarm)) {
59 |  |  |  |  | require Carp;
60 |  |  |  |  | Carp::croak("Time::HiRes::$i(): unimplemented in this platform");
61 |  |  |  |  | }
62 |  |  |  |  | }
63 | 1 | 6µs | 1 | 1.51ms | Time::HiRes->export_to_level(1, $this, @_); # spent 1.51ms making 1 call to Exporter::export_to_level
64 |  |  |  |  | }
65 |  |  |  |  |
66 | 1 | 6µs | 1 | 212µs | bootstrap Time::HiRes; # spent 212µs making 1 call to DynaLoader::bootstrap
67 |  |  |  |  |
68 |  |  |  |  | # Preloaded methods go here.
69 |  |  |  |  |
70 |  |  |  |  | sub tv_interval {
71 |  |  |  |  | # probably could have been done in C
72 |  |  |  |  | my ($a, $b) = @_;
73 |  |  |  |  | $b = [gettimeofday()] unless defined($b);
74 |  |  |  |  | (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000);
75 |  |  |  |  | }
76 |  |  |  |  |
77 |  |  |  |  | # Autoload methods go after =cut, and are processed by the autosplit program.
78 |  |  |  |  |
79 | 1 | 8µs |  |  | 1;
80 |  |  |  |  | __END__
|  |  |  |  | # spent 36µs within Time::HiRes::bootstrap which was called: # once (36µs+0s) by DynaLoader::bootstrap at line 207 of DynaLoader.pm sub Time::HiRes::bootstrap; # xsub