>From my reading, time() returns a integer which is "time in seconds since
EPOCH". What is wrong with using the assembler STCKE instruction to get the
104 bit TOD clock (in a 16 byte, double word aligned, field). Bit 51 of
this value is 0.000001 seconds since the z/OS epoch start. So, load bits
0..63 into a grande register with an LG. Then do an SRLG to "scoot"
everything over 5 bits. The resultant grande register has the time in
microseconds since epoch. So divide it by 1000000 and ignore the remainder
(or round if you want).

      STCKE   MILLSECS
      LG          R1,MILLSECS # IGNORE SECOND DOUBLE WORD
      SRLG     R1,5 # SCOOT RIGHT 5 BITS
      DSGF     R1,=F'1000000' # DIVIDE BY A MILLION
      CGHI      R0,500000 # COMPARE TO 1/2 MILLION
      JL          NOADD #DON'T ADD ONE TO RESULT
      AGHI      R1,1 # ROUND UP
NOADD DS 0H
      STG      R1,DOUBLETIME
* OR USE ST IF YOU'RE CERTAIN THAT THE RESULT IS VALID IN 32 BITS
...
MILLSECS  DS 2D


The above should be close. Perhaps some other eyes will validate and
correct if necessary.


On Wed, Oct 28, 2015 at 9:12 AM, Paul Gilmartin <
[email protected]> wrote:

> (Cross-posting)
>
> In the Assembler Callable Services Reference, I find no analogue
> of the C/C++ time() function.  Is there one?  Am I looking in the
> wrong place?  Is the programmer expected simply to use the C Library
> interface to call the C function?
>
> Thanks,
> gil
>



-- 

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

Reply via email to