| Filename | /usr/libdata/perl5/amd64-openbsd/OpenBSD/MkTemp.pm |
| Statements | Executed 23 statements in 746µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 3 | 1 | 1 | 194µs | 194µs | OpenBSD::MkTemp::mkstemps_real (xsub) |
| 3 | 1 | 1 | 42µs | 235µs | OpenBSD::MkTemp::mkstemp |
| 1 | 1 | 1 | 21µs | 21µs | OpenBSD::MkTemp::BEGIN@3 |
| 1 | 1 | 1 | 10µs | 14µs | OpenBSD::MkTemp::BEGIN@4 |
| 1 | 1 | 1 | 10µs | 20µs | OpenBSD::MkTemp::BEGIN@7 |
| 1 | 1 | 1 | 8µs | 16µs | OpenBSD::MkTemp::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | OpenBSD::MkTemp::mkstemps |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package OpenBSD::MkTemp; | ||||
| 2 | |||||
| 3 | 2 | 54µs | 1 | 21µs | # spent 21µs within OpenBSD::MkTemp::BEGIN@3 which was called:
# once (21µs+0s) by OpenBSD::Temp::BEGIN@23 at line 3 # spent 21µs making 1 call to OpenBSD::MkTemp::BEGIN@3 |
| 4 | 2 | 30µs | 2 | 17µs | # spent 14µs (10+4) within OpenBSD::MkTemp::BEGIN@4 which was called:
# once (10µs+4µs) by OpenBSD::Temp::BEGIN@23 at line 4 # spent 14µs making 1 call to OpenBSD::MkTemp::BEGIN@4
# spent 4µs making 1 call to strict::import |
| 5 | 2 | 25µs | 2 | 23µs | # spent 16µs (8+7) within OpenBSD::MkTemp::BEGIN@5 which was called:
# once (8µs+7µs) by OpenBSD::Temp::BEGIN@23 at line 5 # spent 16µs making 1 call to OpenBSD::MkTemp::BEGIN@5
# spent 7µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 2 | 174µs | 2 | 30µs | # spent 20µs (10+10) within OpenBSD::MkTemp::BEGIN@7 which was called:
# once (10µs+10µs) by OpenBSD::Temp::BEGIN@23 at line 7 # spent 20µs making 1 call to OpenBSD::MkTemp::BEGIN@7
# spent 10µs making 1 call to Exporter::import |
| 8 | |||||
| 9 | 1 | 2µs | our @EXPORT_OK = qw( mkstemps mkstemp mkdtemp ); | ||
| 10 | 1 | 1µs | our @EXPORT = qw( mkstemp mkdtemp ); | ||
| 11 | 1 | 700ns | our $VERSION = '0.02'; | ||
| 12 | |||||
| 13 | 1 | 900ns | require XSLoader; | ||
| 14 | 1 | 216µs | 1 | 207µs | XSLoader::load('OpenBSD::MkTemp', $VERSION); # spent 207µs making 1 call to XSLoader::load |
| 15 | |||||
| 16 | sub mkstemp($) | ||||
| 17 | # spent 235µs (42+194) within OpenBSD::MkTemp::mkstemp which was called 3 times, avg 78µs/call:
# 3 times (42µs+194µs) by OpenBSD::Temp::permanent_file at line 104 of OpenBSD/Temp.pm, avg 78µs/call | ||||
| 18 | 3 | 3µs | my $template = shift; | ||
| 19 | 3 | 216µs | 3 | 194µs | my $fh = mkstemps_real($template, 0) || return; # spent 194µs making 3 calls to OpenBSD::MkTemp::mkstemps_real, avg 65µs/call |
| 20 | 3 | 17µs | return wantarray() ? ($fh, $template) : $fh; | ||
| 21 | } | ||||
| 22 | |||||
| 23 | sub mkstemps($$) | ||||
| 24 | { | ||||
| 25 | my($template, $suffix) = @_; | ||||
| 26 | $template .= $suffix; | ||||
| 27 | my $fh = mkstemps_real($template, length($suffix)) || return; | ||||
| 28 | return wantarray() ? ($fh, $template) : $fh; | ||||
| 29 | } | ||||
| 30 | |||||
| 31 | |||||
| 32 | 1 | 7µs | 1; | ||
| 33 | __END__ | ||||
# spent 194µs within OpenBSD::MkTemp::mkstemps_real which was called 3 times, avg 65µs/call:
# 3 times (194µs+0s) by OpenBSD::MkTemp::mkstemp at line 19, avg 65µs/call |