Rate counter: Difference between revisions
→{{header|Fortran}}: A rethink being prompted.
(→{{header|Fortran}}: A rethink being prompted.) |
|||
Line 565:
So, in <lang Fortran> DO I = FIRST,LAST
IF (PROGRESSNOTE((I - FIRST
...much computation...
END DO</lang>
Function PROGRESSNOTE is invoked at the start of each iteration, with its
<pre>
Standard progress report|Tailored message.
Line 576:
ETF + 6·1hrs!@Monday 17/ 7/2017 5:21:23·397am. 0% Dumping Friday 16/ 5/1749.
</pre>
Thus, the
Incidentally, on windows systems at least, frequent invocations of the date and time routine can cause execution to run ''much'' slower, or worse. A loop waiting for the system's DATE_AND_TIME result to attain a specified value will instead cause a crash.
For another approach, imagine a long-running program, WORKER, that writes various remarks to standard output as it goes, and consider another, TIMESTAMP, that copies from standard input to standard output, prefixing each line with a date and time stamp, perhaps invoked via something like <code>WORKER | TIMESTAMP >Log.txt</code> - the vertical bar an amusing choice to symbolise a horizontal "pipe". When everything finishes, the log file can be analysed to determine the rate of progress. But alas, in the windows world, the stages of a "pipeline" are performed serially, not simultaneously - the vertical bar symbolising this separation. All output from WORKER will be saved in a temporary disc file then when WORKER finishes that file will be fed as input to TIMESTAMP, thereby producing data only on the rate of file input/output.
=={{header|Go}}==
|