Next: Strings Up: Programming Utilities Previous: Higher Level Array

Progress Reports

In order to provide simple monitoring of the progress of a particular processing task, a progress reporting module is available. While a task is in progress, the progress report prints dots across the line indicating how close to finished the task is. If the task is going to take very long, (greater than 2 minutes), the progress report periodically prints the current percentage done and the estimated time remaining. An example of usage, followed by function descriptions, is presented:

            int                 i, n_slices;
            progress_struct     progress;

            n_slices = 100;

            initialize_progress_report( &progress, FALSE,
                        n_slices, "Processing Slices" );

            for( i = 0;  i < n_slices;  ++i )
                process_slice( i );

                update_progress_report( &progress, i + 1 );

            terminate_progress_report( &progress );

public  void  initialize_progress_report(
    progress_struct   *progress,
    BOOLEAN           one_line_only,
    int               n_steps,
    char              title[] )

Initializes a progress report struct, specifying the number of steps that will occur in the processing, and the title to print out for the progress report. During progress report, the display will automatically switch from the short-job mode of printing a single row of dots across a line to the long-job mode of periodically printing the percentage done and estimated time remaining. If the one_line_only flag is TRUE, this is disabled and only a single row of dots will be displayed.

public  void  update_progress_report(
    progress_struct   *progress,
    int               current_step )

Tells the progress reporting module how many steps have been done, and causes update of the display of dots on the line or estimated time remaining.

public  void  terminate_progress_report(
    progress_struct   *progress )

Terminates the progress report.

Next: Strings Up: Programming Utilities Previous: Higher Level Array
Fri Feb 17 15:37:42 EST 1995