I have been working on a program that calculates the minimum potential of a number of particles, the amount of time the program runs can be specifed by the user. Since the user can have the program to run for a couple of hours, what I need is to have the program to print out the percentage that the program has completed (printing out the percentage on one line and it keeps refreshing, just like when uncompressing big files under DOS there is a percentage bar showing the amount has completed).
Here is what I have right now:
percent = esc_time / TIME_TO_RUN * 100;
esc_time is the amount of time the program has been running
TIME_TO_RUN is the time request by the user to run
and I need to print out the variable "percent" and having it keeps refreshing. Appreciated if anyone can tell me how to do!