home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / unix / unixlib_1 / !UnixLib37_netlib_netlib_c_timeofday < prev    next >
Encoding:
Text File  |  1996-07-28  |  550 b   |  29 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source$
  4.  * $Date$
  5.  * $Revision$
  6.  * $State$
  7.  * $Author$
  8.  *
  9.  * $Log$
  10.  ***************************************************************************/
  11.  
  12. static const char rcs_id[] = "$Id$";
  13.  
  14. #include <sys/time.h>
  15. #include <time.h>
  16.  
  17. void
  18. gettimeofday (struct timeval *tv, struct timezone *tz)
  19. {
  20.   time_t t;
  21.   struct tm *tmptr;
  22.  
  23.   t = time (NULL);
  24.   tmptr = localtime (&t);
  25.  
  26.   tv->tv_sec = tmptr->tm_sec + tmptr->tm_min * 60 + tmptr->tm_hour * 60 * 60;
  27.   tv->tv_usec = 0;
  28. }
  29.