123456789101112131415161718192021222324252627282930313233343536 |
- #include <sys/timeb.h>
- #include <sys/time.h>
- int ftime(timebuf)
- struct timeb *timebuf;
- {
- struct timeval tv;
- struct timezone tz;
- if (gettimeofday (&tv, &tz) < 0)
- return -1;
- timebuf->time = tv.tv_sec;
- timebuf->millitm = (tv.tv_usec + 999) / 1000;
- timebuf->timezone = tz.tz_minuteswest;
- timebuf->dstflag = tz.tz_dsttime;
- return 0;
- }
|