TimeUs

From Pickwiki
Revision as of 23:48, 26 February 2015 by Conversion script (talk) (link fix)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
This C program works in HPUX 10.2 and below is VOC item to use with it. Most useful for those who find HPUX only returns time to 1 second detail. This routine passes current time as seconds.microseconds. 
I do:
ECMD = 'TIMEUS'
EXECUTE ECMD,/[[/OUT]].>CAP
STTM = CAP<1>

>CT VOC TIMEUS

     TIMEUS
0001 V
0002 /usr/local/bin/timez
0003 U
0004 TICRGM
>

* =========== timez.c =================

#include <sys/time.h>
main()
{
          struct timeval  first;
           struct timezone tzp;

              gettimeofday (&first, &tzp);

printf("%d.%06d",first.tv_sec,first.tv_usec);
}