Filename | /usr/share/perl/5.20/SelectSaver.pm |
Statements | Executed 7 statements in 199µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 19µs | 67µs | BEGIN@6 | SelectSaver::
1 | 1 | 1 | 9µs | 48µs | BEGIN@7 | SelectSaver::
0 | 0 | 0 | 0s | 0s | DESTROY | SelectSaver::
0 | 0 | 0 | 0s | 0s | new | SelectSaver::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package SelectSaver; | ||||
2 | |||||
3 | 1 | 500ns | our $VERSION = '1.02'; | ||
4 | |||||
5 | 1 | 11µs | require 5.000; | ||
6 | 2 | 36µs | 2 | 114µs | # spent 67µs (19+47) within SelectSaver::BEGIN@6 which was called:
# once (19µs+47µs) by IO::File::BEGIN@10 at line 6 # spent 67µs making 1 call to SelectSaver::BEGIN@6
# spent 47µs making 1 call to Exporter::import |
7 | 2 | 148µs | 2 | 88µs | # spent 48µs (9+39) within SelectSaver::BEGIN@7 which was called:
# once (9µs+39µs) by IO::File::BEGIN@10 at line 7 # spent 48µs making 1 call to SelectSaver::BEGIN@7
# spent 39µs making 1 call to Exporter::import |
8 | |||||
9 | sub new { | ||||
10 | @_ >= 1 && @_ <= 2 or croak 'usage: SelectSaver->new( [FILEHANDLE] )'; | ||||
11 | my $fh = select; | ||||
12 | my $self = bless \$fh, $_[0]; | ||||
13 | select qualify($_[1], caller) if @_ > 1; | ||||
14 | $self; | ||||
15 | } | ||||
16 | |||||
17 | sub DESTROY { | ||||
18 | my $self = $_[0]; | ||||
19 | select $$self; | ||||
20 | } | ||||
21 | |||||
22 | 1 | 4µs | 1; |