Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/x86_64-linux/Time/HiRes.pm |
Statements | Executed 26 statements in 640µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2002 | 2 | 1 | 3.82ms | 3.82ms | time (xsub) | Time::HiRes::
1 | 1 | 1 | 100µs | 100µs | BEGIN@3 | Time::HiRes::
1 | 1 | 1 | 43µs | 43µs | bootstrap (xsub) | Time::HiRes::
2 | 2 | 2 | 23µs | 256µs | import | Time::HiRes::
1 | 1 | 1 | 11µs | 16µs | BEGIN@4 | Time::HiRes::
1 | 1 | 1 | 11µs | 40µs | BEGIN@43 | Time::HiRes::
0 | 0 | 0 | 0s | 0s | AUTOLOAD | Time::HiRes::
0 | 0 | 0 | 0s | 0s | __ANON__[:44] | 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 | 135µs | 1 | 100µs | # spent 100µs within Time::HiRes::BEGIN@3 which was called:
# once (100µs+0s) by Search::Elasticsearch::Role::CxnPool::BEGIN@7 at line 3 # spent 100µs making 1 call to Time::HiRes::BEGIN@3 |
4 | 3 | 218µs | 2 | 21µs | # spent 16µs (11+5) within Time::HiRes::BEGIN@4 which was called:
# once (11µs+5µs) by Search::Elasticsearch::Role::CxnPool::BEGIN@7 at line 4 # spent 16µs making 1 call to Time::HiRes::BEGIN@4
# spent 5µs making 1 call to strict::import |
5 | |||||
6 | 1 | 400ns | require Exporter; | ||
7 | 1 | 200ns | require DynaLoader; | ||
8 | |||||
9 | 1 | 13µs | our @ISA = qw(Exporter DynaLoader); | ||
10 | |||||
11 | 1 | 300ns | our @EXPORT = qw( ); | ||
12 | 1 | 3µ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 lstat | ||||
24 | ); | ||||
25 | |||||
26 | 1 | 200ns | our $VERSION = '1.9726'; | ||
27 | 1 | 100ns | our $XS_VERSION = $VERSION; | ||
28 | 1 | 12µs | $VERSION = eval $VERSION; # spent 2µs executing statements in string eval | ||
29 | |||||
30 | 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 | 222µs | 2 | 69µs | # spent 40µs (11+29) within Time::HiRes::BEGIN@43 which was called:
# once (11µs+29µs) by Search::Elasticsearch::Role::CxnPool::BEGIN@7 at line 43 # spent 40µs making 1 call to Time::HiRes::BEGIN@43
# spent 29µs making 1 call to strict::unimport |
44 | *$AUTOLOAD = sub { $val }; | ||||
45 | } | ||||
46 | goto &$AUTOLOAD; | ||||
47 | } | ||||
48 | |||||
49 | # spent 256µs (23+233) within Time::HiRes::import which was called 2 times, avg 128µs/call:
# once (13µs+166µs) by Search::Elasticsearch::Role::CxnPool::BEGIN@7 at line 7 of Search/Elasticsearch/Role/CxnPool.pm
# once (10µs+67µs) by Search::Elasticsearch::Transport::BEGIN@6 at line 6 of Search/Elasticsearch/Transport.pm | ||||
50 | 2 | 900ns | my $this = shift; | ||
51 | 2 | 2µs | for my $i (@_) { | ||
52 | 3 | 5µ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 | 2 | 11µs | 2 | 50µs | Time::HiRes->export_to_level(1, $this, @_); # spent 50µs making 2 calls to Exporter::export_to_level, avg 25µs/call |
64 | } | ||||
65 | |||||
66 | 1 | 9µs | 1 | 417µs | bootstrap Time::HiRes; # spent 417µ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 43µs within Time::HiRes::bootstrap which was called:
# once (43µs+0s) by DynaLoader::bootstrap at line 216 of DynaLoader.pm | |||||
# spent 3.82ms within Time::HiRes::time which was called 2002 times, avg 2µs/call:
# 1001 times (1.92ms+0s) by Search::Elasticsearch::Transport::try {...} at line 31 of Search/Elasticsearch/Transport.pm, avg 2µs/call
# 1001 times (1.90ms+0s) by Search::Elasticsearch::Transport::try {...} at line 26 of Search/Elasticsearch/Transport.pm, avg 2µs/call |