[J3] SYSTEM_CLOCK

Steven G. Kargl kargl at uw.edu
Thu Jan 28 21:59:26 UTC 2021


On Thu, Jan 28, 2021 at 08:56:26PM +0000, Bill Long via J3 wrote:
> 
> 
> As noted above, I think using the MIN computation is a mistake. 
> 

I did not write the routine, so can only guess at intent.
The MIN routine eliminates counting with 8- and 16-bit
integer (as the clock would rollover too quickly with
gfortran's clock rates).

With a 32-bit, signed integer and millisecond resolution,
one can time a period of up to 24.8551369 days before
the clock rolls over.

With a 32-bit, signed integer and nanosecond resolution,
one can time a period of up to 2.14748359 seconds before
the clock rolls over.

With a 64-bit, signed integer and nanosecond resolution,
one can time a period of up to 292.471191 years before
the clock rolls over.

One of these 3 is somewhat uninteresting for timings (and
gfortran's MIN computation eliminates that choice).

The Fortran standard does not provide a method by which 
a user can select a clock rate.  It says COUNT "is incremented
by one for each clock count".  Well, if a processor has
multiple clock rates what does "increment by one for
each clock count" mean?

-- 
Steve


More information about the J3 mailing list