| Filename | /usr/libdata/perl5/amd64-openbsd/OpenBSD/MkTemp.pm |
| Statements | Executed 137 statements in 4.01ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 41 | 1 | 1 | 2.60ms | 2.60ms | OpenBSD::MkTemp::mkstemps_real (xsub) |
| 40 | 1 | 1 | 1.95ms | 1.95ms | OpenBSD::MkTemp::mkdtemp (xsub) |
| 41 | 1 | 1 | 702µs | 3.30ms | OpenBSD::MkTemp::mkstemp |
| 1 | 1 | 1 | 57µs | 57µs | OpenBSD::MkTemp::BEGIN@3 |
| 1 | 1 | 1 | 12µs | 31µs | OpenBSD::MkTemp::BEGIN@7 |
| 1 | 1 | 1 | 12µs | 18µs | OpenBSD::MkTemp::BEGIN@4 |
| 1 | 1 | 1 | 11µs | 22µ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 | 60µs | 1 | 57µs | # spent 57µs within OpenBSD::MkTemp::BEGIN@3 which was called:
# once (57µs+0s) by OpenBSD::Temp::BEGIN@23 at line 3 # spent 57µs making 1 call to OpenBSD::MkTemp::BEGIN@3 |
| 4 | 2 | 39µs | 2 | 23µs | # spent 18µs (12+6) within OpenBSD::MkTemp::BEGIN@4 which was called:
# once (12µs+6µs) by OpenBSD::Temp::BEGIN@23 at line 4 # spent 18µs making 1 call to OpenBSD::MkTemp::BEGIN@4
# spent 6µs making 1 call to strict::import |
| 5 | 2 | 31µs | 2 | 34µs | # spent 22µs (11+11) within OpenBSD::MkTemp::BEGIN@5 which was called:
# once (11µs+11µs) by OpenBSD::Temp::BEGIN@23 at line 5 # spent 22µs making 1 call to OpenBSD::MkTemp::BEGIN@5
# spent 11µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 2 | 234µs | 2 | 49µs | # spent 31µs (12+18) within OpenBSD::MkTemp::BEGIN@7 which was called:
# once (12µs+18µs) by OpenBSD::Temp::BEGIN@23 at line 7 # spent 31µs making 1 call to OpenBSD::MkTemp::BEGIN@7
# spent 18µ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 | 1µs | require XSLoader; | ||
| 14 | 1 | 297µs | 1 | 286µs | XSLoader::load('OpenBSD::MkTemp', $VERSION); # spent 286µs making 1 call to XSLoader::load |
| 15 | |||||
| 16 | sub mkstemp($) | ||||
| 17 | # spent 3.30ms (702µs+2.60) within OpenBSD::MkTemp::mkstemp which was called 41 times, avg 81µs/call:
# 41 times (702µs+2.60ms) by OpenBSD::Temp::permanent_file at line 104 of OpenBSD/Temp.pm, avg 81µs/call | ||||
| 18 | 41 | 44µs | my $template = shift; | ||
| 19 | 41 | 2.91ms | 41 | 2.60ms | my $fh = mkstemps_real($template, 0) || return; # spent 2.60ms making 41 calls to OpenBSD::MkTemp::mkstemps_real, avg 63µs/call |
| 20 | 41 | 376µ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 | 9µs | 1; | ||
| 33 | __END__ | ||||
# spent 1.95ms within OpenBSD::MkTemp::mkdtemp which was called 40 times, avg 49µs/call:
# 40 times (1.95ms+0s) by OpenBSD::Temp::permanent_dir at line 114 of OpenBSD/Temp.pm, avg 49µs/call | |||||
# spent 2.60ms within OpenBSD::MkTemp::mkstemps_real which was called 41 times, avg 63µs/call:
# 41 times (2.60ms+0s) by OpenBSD::MkTemp::mkstemp at line 19, avg 63µs/call |