NAME

cs::Progress - progress reporting


SYNOPSIS

use cs::Progress;

$P = new cs::Progress;


DESCRIPTION

This module implements a progress reporting facility giving ETA for completion. By default it reports to STDERR using the cs::Upd module.


GENERAL FUNCTIONS


OBJECT CREATION

new(tag, callback)

Create a new cs::Progress object to reflect progress on something named ``tag''. If supplied, the subroutine reference callback will be called on each update with the arguments (this, when, sofar, eta, context). otherwise the cs::Upd module will be used to report progress on STDERR.


OBJECT METHODS

Size(total)

Set or return the expected size for the task.

Report(sofar,when)

Report that we have come sofar units through the file. The sofar parameter may also be an arrayref of the form [sofar,context] where context is a string to be presented in the progress report. If supplied, when specifies the time this progress was made. otherwise the current time is used.

The callback function will then be called with the arguments (this, when, sofar, eta, context).


SEE ALSO

cs::Upd(3)


AUTHOR

Cameron Simpson <cs@zip.com.au>