Skip Menu |
 

This queue is for tickets about the Time-Progress CPAN distribution.

Report information
The Basics
Id: 33619
Status: new
Priority: 0/
Queue: Time-Progress

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.3
Fixed in: (no value)



Subject: Wishes: default report format, Time::Progress::File
Download (untitled) / with headers
text/plain 1.3k
Some suggestions for your nice module: - It would be nice for lazy developers to have a default report format. - It would be nice if the frequency of report updates could be specified. I think it's more performant to check for the current time, the time of the last report, and output the report only once a second or so. Currently I am doing it like this: my $tp = Time::Progress->new(...); my $last_report = time-1; while(...) { if ($last_report+1 < time) { print STDERR $tp->report(undef, $c); $last_report = time; } } It would be nicer if this could be done by Time::Progress, e.g. my $tp = Time::Progress->new(..., report_update => 2); while(...) { $tp->print_report(\*STDERR, undef, $c); # would only output the report every two seconds } - I think a common operation is showing progress while iterating over a file. Currently I do this using $tp = Time::Progress->new(min => 0, max => -s $filename, format => ...); open my $fh, $filename or die; while(<$fh>) { $tp->report(undef, tell($fh)); } It would be nice if this could be written like this: open my $fh, $filename or die; $tp = Time::Progress::File->new(fh => $fh); while(<$fh>) { $tp->report; # would use the default format and tell($fh) } If you don't think that the latter fits into your distribution, then I would create it myself. Regards, Slaven


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.