X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-new.c;h=941f9d615a44ce07521395db331a9c6b7d11b6c4;hb=3e4a9d60a9419621b08c647a306843d76c47c2cb;hp=1473d2e69449c80e596b0440bbd6269c31d8fd61;hpb=90a505373ef5a8135357f2da3cdf6837e32c3a7a;p=notmuch diff --git a/notmuch-new.c b/notmuch-new.c index 1473d2e6..941f9d61 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -117,15 +117,19 @@ generic_print_progress (const char *action, const char *object, printf ("%s %d ", action, processed); if (total) { - double time_remaining; - - time_remaining = ((total - processed) / rate_overall); - printf ("of %d %s (", total, object); - notmuch_time_print_formatted_seconds (time_remaining); - printf (" remaining).\033[K\r"); + printf ("of %d %s", total, object); + if (processed > 0 && elapsed_overall > 0.5) { + double time_remaining = ((total - processed) / rate_overall); + printf (" ("); + notmuch_time_print_formatted_seconds (time_remaining); + printf (" remaining)"); + } } else { - printf ("%s (%d %s/sec.)\033[K\r", object, (int) rate_overall, object); + printf ("%s", object); + if (elapsed_overall > 0.5) + printf (" (%d %s/sec.)", (int) rate_overall, object); } + printf (".\033[K\r"); fflush (stdout); }