Filename | /usr/lib/perl/5.14/Time/HiRes.pm |
Statements | Executed 24 statements in 2.74ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 857µs | 1.69ms | BEGIN@4 | Time::HiRes::
1 | 1 | 1 | 93µs | 93µs | bootstrap (xsub) | Time::HiRes::
2 | 2 | 2 | 39µs | 3.65ms | import | Time::HiRes::
1 | 1 | 1 | 29µs | 35µs | BEGIN@3 | Time::HiRes::
1 | 1 | 1 | 16µs | 52µs | BEGIN@42 | Time::HiRes::
2 | 2 | 1 | 7µs | 7µs | time (xsub) | Time::HiRes::
0 | 0 | 0 | 0s | 0s | AUTOLOAD | Time::HiRes::
0 | 0 | 0 | 0s | 0s | __ANON__[:43] | 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 | 61µs | 2 | 42µs | # spent 35µs (29+7) within Time::HiRes::BEGIN@3 which was called:
# once (29µs+7µs) by main::BEGIN@6 at line 3 # spent 35µs making 1 call to Time::HiRes::BEGIN@3
# spent 7µs making 1 call to strict::import |
4 | 2 | 479µs | 2 | 1.88ms | # spent 1.69ms (857µs+831µs) within Time::HiRes::BEGIN@4 which was called:
# once (857µs+831µs) by main::BEGIN@6 at line 4 # spent 1.69ms making 1 call to Time::HiRes::BEGIN@4
# spent 191µs making 1 call to vars::import |
5 | |||||
6 | 1 | 1.29ms | require Exporter; | ||
7 | 1 | 171µs | require DynaLoader; | ||
8 | |||||
9 | 1 | 16µs | @ISA = qw(Exporter DynaLoader); | ||
10 | |||||
11 | 1 | 600ns | @EXPORT = qw( ); | ||
12 | 1 | 11µ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 | 500ns | $VERSION = '1.9721_01'; | ||
27 | 1 | 500ns | $XS_VERSION = $VERSION; | ||
28 | 1 | 59µs | $VERSION = eval $VERSION; # spent 5µ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 | 572µs | 2 | 88µs | # spent 52µs (16+36) within Time::HiRes::BEGIN@42 which was called:
# once (16µs+36µs) by main::BEGIN@6 at line 42 # spent 52µs making 1 call to Time::HiRes::BEGIN@42
# spent 36µs making 1 call to strict::unimport |
43 | *$AUTOLOAD = sub { $val }; | ||||
44 | } | ||||
45 | goto &$AUTOLOAD; | ||||
46 | } | ||||
47 | |||||
48 | # spent 3.65ms (39µs+3.62) within Time::HiRes::import which was called 2 times, avg 1.83ms/call:
# once (28µs+3.55ms) by main::BEGIN@6 at line 6 of mentat.storage.mongo.pl
# once (10µs+65µs) by Mentat::Storage::Mongo::BEGIN@153 at line 153 of Mentat/Storage/Mongo.pm | ||||
49 | 8 | 29µs | my $this = shift; | ||
50 | for my $i (@_) { | ||||
51 | 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 | 3.23ms | Time::HiRes->export_to_level(1, $this, @_); # spent 3.23ms making 2 calls to Exporter::export_to_level, avg 1.62ms/call | ||
63 | } | ||||
64 | |||||
65 | 1 | 17µs | 1 | 481µs | bootstrap Time::HiRes; # spent 481µs making 1 call to DynaLoader::bootstrap |
66 | |||||
67 | # Preloaded methods go here. | ||||
68 | |||||
69 | sub tv_interval { | ||||
70 | # probably could have been done in C | ||||
71 | my ($a, $b) = @_; | ||||
72 | $b = [gettimeofday()] unless defined($b); | ||||
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 | 36µs | 1; | ||
79 | __END__ | ||||
# spent 93µs within Time::HiRes::bootstrap which was called:
# once (93µs+0s) by DynaLoader::bootstrap at line 207 of DynaLoader.pm | |||||
# spent 7µs within Time::HiRes::time which was called 2 times, avg 4µs/call:
# once (4µs+0s) by main::RUNTIME at line 27 of mentat.storage.mongo.pl
# once (3µs+0s) by main::RUNTIME at line 45 of mentat.storage.mongo.pl |