Logo Search packages:      
Sourcecode: tardy version File versions  Download package

void filenamelist_filter_progress::show_end_status (  )  [private]

The show_end_status method is used to shwo the number of files, number of bytes, effective data transfer rate, and elapsed time.

Definition at line 209 of file progress.cc.

References list, show, size_position, size_total, and start_time.

Referenced by read_one_line().

{
      if (!show)
            return;
      time_t now;
      time(&now);

      char buffer[80];
      char *bp = buffer;
      *bp++ = '\r';

      snprintf(bp, buffer + sizeof(buffer) - bp, "%s files, ",
            format_size(list.size()));
      bp += strlen(bp);

      snprintf(bp, buffer + sizeof(buffer) - bp, "%sB, ",
            format_size(size_total));
      bp += strlen(bp);

      time_t elapsed = now - start_time;
      if (elapsed < 1)
            elapsed = 1;
      long long rate = size_position / elapsed;
      snprintf(bp, buffer + sizeof(buffer) - bp, "%sB/sec, ",
          format_size(rate));
      bp += strlen(bp);

      snprintf(bp, buffer + sizeof(buffer) - bp, "%s     ",
          format_time(elapsed));
      bp += strlen(bp);
      while (bp < buffer + sizeof(buffer) - 1)
          *bp++ = ' ';
      *bp++ = '\n';

      ::write(2, buffer, sizeof(buffer));
}


Generated by  Doxygen 1.6.0   Back to index