Rate counter: Difference between revisions

Content added Content deleted
(→‎{{header|Go}}: Add Fortran.)
Line 568: Line 568:
...much computation...
...much computation...
END DO</lang>
END DO</lang>
Function PROGRESSNOTE is invoked at the start of the iteration, with its first parameter stating how many steps have been completed (initially, none: this restarts its timers) and the second indicates how many are to be made. The function notes whether sufficient clock time has elapsed (more than six seconds, for example) and if so, returns ''true'' after starting an output line with a standard report giving an estimated time to run and an estimated time (and date, if not the current day) of completion. This line is not terminated; the invoking routine provides its own progress message, tailored to the task it is working through. For instance,
Function PROGRESSNOTE is invoked at the start of the iteration, with its first parameter stating how many steps have been completed (initially, none: this restarts its timers) and the second indicates how many are to be made. The function notes whether sufficient clock time has elapsed since its previous report (more than six seconds, for example) and if so, returns ''true'' after starting an output line with a standard report giving an estimated time to run and an estimated time (and date, if not the current day) of completion. This line is not terminated; the invoking routine appends its own progress message, tailored to the nature of the task it is working through. For instance,
<pre>
<pre>
Standard progress report|Tailored message.
Standard progress report|Tailored message.
Line 576: Line 576:
ETF + 6·1hrs!@Monday 17/ 7/2017 5:21:23·397am. 0% Dumping Friday 16/ 5/1749.
ETF + 6·1hrs!@Monday 17/ 7/2017 5:21:23·397am. 0% Dumping Friday 16/ 5/1749.
</pre>
</pre>
Thus, the user waiting at the computer screen can know to go for a walk, or not.
Thus, the user waiting at the computer screen can monitor the rate of progress and know to go for a walk, or not.


Incidentally, on windows systems at least, frequent invocations of the date and time routine can cause execution to run ''much'' slower, or crash the system. A loop waiting for the system's DATE_AND_TIME result to attain a specified value will instead cause a crash.
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.


=={{header|Go}}==
=={{header|Go}}==