home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / xjig / vms_unix_times.c < prev    next >
C/C++ Source or Header  |  1997-12-30  |  577b  |  36 lines

  1. /*
  2.  *    UNIX-style Time Functions
  3.  *
  4.  */
  5. #include <stdio.h>
  6. #include <signal.h>
  7. #include <time.h>
  8. #include "vms_unix_time.h"
  9.  
  10. /*
  11.  *    gettimeofday(2) - Returns the current time
  12.  *
  13.  *    NOTE: The timezone portion is useless on VMS.
  14.  *    Even on UNIX, it is only provided for backwards
  15.  *    compatibilty and is not guaranteed to be correct.
  16.  */
  17.  
  18. int gettimeofday(tv)
  19. struct timeval  *tv;
  20. {
  21.     timeb_t tmp_time;
  22.  
  23.     ftime(&tmp_time);
  24.  
  25.     if (tv != NULL)
  26.     {
  27.     tv->tv_sec  = tmp_time.time;
  28.     tv->tv_usec = tmp_time.millitm * 1000;
  29.     }
  30.  
  31.  
  32.     return (0);
  33.  
  34. } /*** End gettimeofday() ***/
  35.  
  36.