I have a Perl script on a *nix system which, at one point, is processing 50,000 + lines of text. This takes some time. I am trying to find a resource friendly way to let the user know the program is not hanging while it is processing all of this text.
Currently I am printing output in realtime as the text is being processed .
I am flushing the output buffer then printing the output on one line with
\r. This seems to be an unnecessary use of resources because it takes almost twice as long than when I print nothing, but as I have said, when printing nothing it looks like the program is hanging.
So my question: Is there a standard or simple way to let the user know the program is indeed running while performing long running tasks?