If we run a shell/perl/tcl script in Unix how can we display the percentage of execution in the mean time?
Example:
./scriptname
1% Completed the execution of script.pl
2% Completed the execution of script.pl
...
100% Completed the the execution of script.pl
and display the execution time taken for the script at the end.
Example output:
Execution time for script.pl is :50 Seconds
In Perl, look at the Smart::Comments module.
And for the elapsed time, simply take the delta of the
time()at the beginning versus the end.