Acme-ProgressBar

 view release on metacpan or  search on metacpan

lib/Acme/ProgressBar.pm  view on Meta::CPAN

#pod itself.
#pod
#pod =func progress
#pod
#pod  progress { unlink $_ for <*> };
#pod  progress { while (<>) { $ua->get($_) } };
#pod  progress { sleep 5; }
#pod
#pod There is only one function exported by default, C<progress>.  This function
#pod takes a coderef as its lone argument.  It will execute this code and display a
#pod simple progress bar indicating the time required for ten iterations through the
#pod code.
#pod
#pod =cut

sub progress(&) { ## no critic Prototype
  my ($code) = @_;
  local $| = 1; ## no critic
  _overprint(_message(0,10,undef));

  my $begun = Time::HiRes::time;

lib/Acme/ProgressBar.pm  view on Meta::CPAN

=head1 FUNCTIONS

=head2 progress

 progress { unlink $_ for <*> };
 progress { while (<>) { $ua->get($_) } };
 progress { sleep 5; }

There is only one function exported by default, C<progress>.  This function
takes a coderef as its lone argument.  It will execute this code and display a
simple progress bar indicating the time required for ten iterations through the
code.

=head1 TODO

=over 4

=item *

allow other divisions of time (other than ten)



( run in 2.973 seconds using v1.01-cache-2.11-cpan-96521ef73a4 )