memset(&t, 0, sizeof(t));
}
+char *tfc_format_time(tfc_useconds t)
+{
+ tfc_useconds secs, dsecs;
+ unsigned days, hours, minutes, seconds;
+ static char r[128];
+
+ secs = (tfc_useconds)TFC_UTODSECS(t);
+ dsecs = (tfc_useconds)(t - (secs * 1000000));
+
+ days = secs / 86400;
+ hours = (secs / 3600) % 24;
+ minutes = (secs / 60) % 60;
+ seconds = secs % 60;
+
+ if (days > 0) sprintf(r, "%ud,%02u:%02u:%02u.%03u", days, hours, minutes, seconds, (unsigned)(dsecs / 1000));
+ else if (hours > 0) sprintf(r, "%02u:%02u:%02u.%03u", hours, minutes, seconds, (unsigned)(dsecs / 1000));
+ else if (minutes > 0) sprintf(r, "%02u:%02u.%03u", minutes, seconds, (unsigned)(dsecs / 1000));
+ else sprintf(r, "%02u.%03u", seconds, (unsigned)(dsecs / 1000));
+
+ return r;
+}
+
tfc_fsize tfc_fdsize(int fd)
{
off_t l, cur;
}
_out: tfc_getcurtime(¤t_time);
+ total_time += (current_time - delta_time);
seconds = TFC_UTODSECS(current_time - delta_time);
wr_speed = delta_processed / seconds;
tfc_describescale(total_processed_src, &human_totalproc_src, &src_scale_idx);
if (do_less_stats == YES) {
tfc_nfsay(stderr, "%s%s:"
" %s %.2f%s,"
- " %.2f%s B/s",
+ " %.2f%s B/s @%s",
inplace, progname,
oper_mode,
human_totalproc_dst, tfc_getscale(dst_scale_idx),
- human_wr_speed, tfc_getscale(wr_speed_scale));
+ human_wr_speed, tfc_getscale(wr_speed_scale), tfc_format_time(total_time));
}
else {
if (ctr_mode <= TFC_MODE_PLAIN) tfc_nfsay(stderr, "%s%s: read: %llu (%.2f%s),"
" %s %llu (%.2f%s) bytes,"
- " (%llu (%.2f%s) B/s)",
+ " (%llu (%.2f%s) B/s), time %s",
inplace, progname,
total_processed_src, human_totalproc_src, tfc_getscale(src_scale_idx),
oper_mode,
total_processed_dst, human_totalproc_dst, tfc_getscale(dst_scale_idx),
- wr_speed, human_wr_speed, tfc_getscale(wr_speed_scale));
+ wr_speed, human_wr_speed, tfc_getscale(wr_speed_scale), tfc_format_time(total_time));
else tfc_nfsay(stderr, "%s%s: read: %llu (%.2f%s),"
" %s %s %llu (%.2f%s) bytes,"
- " (%llu (%.2f%s) B/s)",
+ " (%llu (%.2f%s) B/s), time %s",
inplace, progname,
total_processed_src, human_totalproc_src, tfc_getscale(src_scale_idx),
tfc_modename(ctr_mode), oper_mode,
total_processed_dst, human_totalproc_dst, tfc_getscale(dst_scale_idx),
- wr_speed, human_wr_speed, tfc_getscale(wr_speed_scale));
+ wr_speed, human_wr_speed, tfc_getscale(wr_speed_scale), tfc_format_time(total_time));
}
if ((do_statline_dynamic == NO || last == YES || signal == -1) && was_sigint == NO) tfc_esay("\n");
char *saltf, *genkeyf, *mackeyf, *tweakf;
char *pw_prompt, *mac_pw_prompt;
tfc_useconds status_timer, bench_timer;
-tfc_useconds current_time, delta_time;
+tfc_useconds total_time, current_time, delta_time;
struct getpasswd_state getps;
extern char *saltf, *genkeyf, *mackeyf, *tweakf;
extern char *pw_prompt, *mac_pw_prompt;
extern tfc_useconds status_timer, bench_timer;
-extern tfc_useconds current_time, delta_time;
+extern tfc_useconds total_time, current_time, delta_time;
extern struct getpasswd_state getps;
size_t xread(int fd, void *data, size_t szdata);
void xclose(int fd);
const char *tfc_modename(int mode);
void tfc_getcurtime(tfc_useconds *tx);
+char *tfc_format_time(tfc_useconds t);
tfc_fsize tfc_fdsize(int fd);
tfc_fsize tfc_fdgetpos(int fd);
tfc_fsize tfc_fnamesize(char *fname, tfc_yesno noexit);