I would say that STCKF is less "approximate" than STCK, since STCKF can have more low order bits of time from the clock than STCK, which inserts a processor related value in the low order bits to meet the "unique with a partition" requirement. STCKF is fine for measure time deltas as long as a delta of 0 is acceptable. z/OS routinely uses STCKF for this purpose. You won't observe time flowing backward from two STCKFs on the same logical processor or the same z/OS work unit.
Jim Mulder -----Original Message----- From: Alan Altmark <[email protected]> Sent: Saturday, February 24, 2024 1:48 AM To: [email protected] Subject: Re: Nanosecond resolution timestamps for HLL's? On Thu, 22 Feb 2024 01:08:55 -0600, Jon Perryman <[email protected]> wrote: >Real-time clocks are not monotonical. Regardless of vendor, there is 1 >real-time clock shared by all CPU cores. There is indeed one hardware clock, but it's not visible to the partitions. The "system TOD clock" is what the partitions see, and it is architecturally defined to be monotonically increasing, never going backward and never being the same. Any two executions of STORE CLOCK (STCK or STCKE) on any processor in the partition, same or different, will always result in different clock values, and subsequent executions will result in values that are greater than either of the two prior values. STORE CLOCK FAST (STCKF) guarantees no such relationship, and time may appear to flow backwards. (So it's only useful when "approximately" is good enough.) See Chapter 4 of the PoP, "Setting and Inspecting the Clock". There's a table that I think you will find helpful. Alan Altmark IBM ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
