Filename | /home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/x86_64-linux/Time/HiRes.pm |
Statements | Executed 28 statements in 546µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
25001 | 2 | 1 | 68.4ms | 68.4ms | time (xsub) | Time::HiRes::
1 | 1 | 1 | 52µs | 52µs | bootstrap (xsub) | Time::HiRes::
2 | 2 | 2 | 46µs | 516µs | import | Time::HiRes::
1 | 1 | 1 | 24µs | 29µs | BEGIN@3 | Time::HiRes::
1 | 1 | 1 | 16µs | 20µs | tv_interval | Time::HiRes::
1 | 1 | 1 | 13µs | 162µs | BEGIN@4 | Time::HiRes::
1 | 1 | 1 | 12µs | 37µs | BEGIN@42 | Time::HiRes::
2 | 2 | 2 | 10µs | 10µs | gettimeofday (xsub) | Time::HiRes::
0 | 0 | 0 | 0s | 0s | AUTOLOAD | Time::HiRes::
0 | 0 | 0 | 0s | 0s | __ANON__[:43] | Time::HiRes::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Time::HiRes; | ||||
2 | |||||
3 | 2 | 32µs | 2 | 34µs | # spent 29µs (24+5) within Time::HiRes::BEGIN@3 which was called:
# once (24µs+5µs) by Term::Sk::BEGIN@6 at line 3 # spent 29µs making 1 call to Time::HiRes::BEGIN@3
# spent 5µs making 1 call to strict::import |
4 | 2 | 175µs | 2 | 311µs | # spent 162µs (13+149) within Time::HiRes::BEGIN@4 which was called:
# once (13µs+149µs) by Term::Sk::BEGIN@6 at line 4 # spent 162µs making 1 call to Time::HiRes::BEGIN@4
# spent 149µs making 1 call to vars::import |
5 | |||||
6 | 1 | 2µs | require Exporter; | ||
7 | 1 | 2µs | require DynaLoader; | ||
8 | |||||
9 | 1 | 10µs | @ISA = qw(Exporter DynaLoader); | ||
10 | |||||
11 | 1 | 800ns | @EXPORT = qw( ); | ||
12 | 1 | 6µs | @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 | 1µs | $VERSION = '1.9721'; | ||
27 | 1 | 1µs | $XS_VERSION = $VERSION; | ||
28 | 1 | 14µs | $VERSION = eval $VERSION; # spent 3µs executing statements in string eval | ||
29 | |||||
30 | sub AUTOLOAD { | ||||
31 | my $constname; | ||||
32 | ($constname = $AUTOLOAD) =~ s/.*:://; | ||||
33 | # print "AUTOLOAD: constname = $constname ($AUTOLOAD)\n"; | ||||
34 | die "&Time::HiRes::constant not defined" if $constname eq 'constant'; | ||||
35 | my ($error, $val) = constant($constname); | ||||
36 | # print "AUTOLOAD: error = $error, val = $val\n"; | ||||
37 | if ($error) { | ||||
38 | my (undef,$file,$line) = caller; | ||||
39 | die "$error at $file line $line.\n"; | ||||
40 | } | ||||
41 | { | ||||
42 | 2 | 226µs | 2 | 62µs | # spent 37µs (12+25) within Time::HiRes::BEGIN@42 which was called:
# once (12µs+25µs) by Term::Sk::BEGIN@6 at line 42 # spent 37µs making 1 call to Time::HiRes::BEGIN@42
# spent 25µs making 1 call to strict::unimport |
43 | *$AUTOLOAD = sub { $val }; | ||||
44 | } | ||||
45 | goto &$AUTOLOAD; | ||||
46 | } | ||||
47 | |||||
48 | # spent 516µs (46+469) within Time::HiRes::import which was called 2 times, avg 258µs/call:
# once (22µs+331µs) by Term::Sk::BEGIN@6 at line 6 of Term/Sk.pm
# once (24µs+138µs) by Hailo::Command::__ANON__[lib/Hailo/Command.pm:307] at line 305 of lib/Hailo/Command.pm | ||||
49 | 6 | 29µs | my $this = shift; | ||
50 | for my $i (@_) { | ||||
51 | 3 | 9µs | if (($i eq 'clock_getres' && !&d_clock_getres) || | ||
52 | ($i eq 'clock_gettime' && !&d_clock_gettime) || | ||||
53 | ($i eq 'clock_nanosleep' && !&d_clock_nanosleep) || | ||||
54 | ($i eq 'clock' && !&d_clock) || | ||||
55 | ($i eq 'nanosleep' && !&d_nanosleep) || | ||||
56 | ($i eq 'usleep' && !&d_usleep) || | ||||
57 | ($i eq 'ualarm' && !&d_ualarm)) { | ||||
58 | require Carp; | ||||
59 | Carp::croak("Time::HiRes::$i(): unimplemented in this platform"); | ||||
60 | } | ||||
61 | } | ||||
62 | 2 | 57µs | Time::HiRes->export_to_level(1, $this, @_); # spent 57µs making 2 calls to Exporter::export_to_level, avg 28µs/call | ||
63 | } | ||||
64 | |||||
65 | 1 | 9µs | 1 | 380µs | bootstrap Time::HiRes; # spent 380µs making 1 call to DynaLoader::bootstrap |
66 | |||||
67 | # Preloaded methods go here. | ||||
68 | |||||
69 | # spent 20µs (16+3) within Time::HiRes::tv_interval which was called:
# once (16µs+3µs) by Hailo::Command::train_progress at line 340 of lib/Hailo/Command.pm | ||||
70 | # probably could have been done in C | ||||
71 | 3 | 21µs | my ($a, $b) = @_; | ||
72 | 1 | 4µs | $b = [gettimeofday()] unless defined($b); # spent 4µs making 1 call to Time::HiRes::gettimeofday | ||
73 | (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000); | ||||
74 | } | ||||
75 | |||||
76 | # Autoload methods go after =cut, and are processed by the autosplit program. | ||||
77 | |||||
78 | 1 | 8µs | 1; | ||
79 | __END__ | ||||
# spent 52µs within Time::HiRes::bootstrap which was called:
# once (52µs+0s) by DynaLoader::bootstrap at line 219 of DynaLoader.pm | |||||
# spent 10µs within Time::HiRes::gettimeofday which was called 2 times, avg 5µs/call:
# once (6µs+0s) by Hailo::Command::train_progress at line 329 of lib/Hailo/Command.pm
# once (4µs+0s) by Time::HiRes::tv_interval at line 72 | |||||
# spent 68.4ms within Time::HiRes::time which was called 25001 times, avg 3µs/call:
# 25000 times (68.4ms+0s) by Term::Sk::show_maybe at line 161 of Term/Sk.pm, avg 3µs/call
# once (14µs+0s) by Term::Sk::new at line 112 of Term/Sk.pm |