- fprintf (stderr, _("Total bytes written: "));
- fprintf (stderr, TARLONG_FORMAT, prev_written + bytes_written);
- fprintf (stderr, "\n");
-}
+ tarlong written = prev_written + bytes_written;
+ char bytes[sizeof (tarlong) * CHAR_BIT];
+ char abbr[LONGEST_HUMAN_READABLE + 1];
+ char rate[LONGEST_HUMAN_READABLE + 1];
+ double seconds;
+ int human_opts = human_autoscale | human_base_1024 | human_SI | human_B;
+
+#if HAVE_CLOCK_GETTIME
+ struct timespec now;
+ if (clock_gettime (CLOCK_REALTIME, &now) == 0)
+ seconds = ((now.tv_sec - start_timespec.tv_sec)
+ + (now.tv_nsec - start_timespec.tv_nsec) / 1e9);
+ else
+#endif
+ seconds = time (0) - start_time;
+
+ sprintf (bytes, TARLONG_FORMAT, written);