I think we may have what is called an X-Y problem.
Perhaps you are asking how to do X when you really need to do Y.

In general a terminal I/F or GUI is much better at displaying progress than an operation using a log file.

I absolutely hate the standard Windows "Circle of Death". This is often just a separate process that is just making a circle go around completely independent of whether the program is actually doing anything at all! That thing does have some value, but there is a user "patience factor".

How often does the user need a progress report?:
In my experience (yours may vary), the user will tolerate about a max of 60 to perhaps 90 seconds before thinking that the process is hung and "not doing anything" and that is even with the "warning" that this utility "can take a long time".

A main thing that you want to prevent is the user deciding that the program is "hung", and therefore "killing it" prematurely while it is in fact actually continuing to its job just fine!.

If you can provide a command line I/F, then think about just printing a simple "." per "unit" worked. Don't print dots via separate process (ala the "Windows Circle of Death"). If each dot represents actual progress towards the goal, the user will accept this. If a dot (period) appears at least every 30 seconds, that is often enough. It is completely fine if the appearance of the dots has an irregular rhythm. Humans are "pattern matching machines". The human (if he/she has used this utility before), will recognize a "good" vs "bad" pattern.

NEVER modify a log file. That is a very bad idea as other Monks have said.

I suggest that you don't have to get "fancy", just print a dot (period) on the command line I/F that is related to "actual work accomplished" and do that at least every 30 seconds and you will do just fine. The user will believe that the program is still running and won't "kill it".


In reply to Re: Recommended way to display progress by Marshall
in thread Recommended way to display progress by ovedpo15

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.