123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?xml version='1.0' encoding='iso-8859-1'?>
- <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
- <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
- <head>
- <title>
- gettimeofday.c
- </title>
- <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
- <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
- <meta name='author' content='cmaier@cmassoc.net'/>
- <meta name='robots' content='noindex,nofollow'/>
- <link href='toolkit.css' rel='stylesheet' type='text/css'/>
- </head>
- <body>
- <div class='headerlink'>
- [<a href='GetProperty.c.html' title=' GetProperty.c '>PREV</a>]
- [<a href='toolkit.html' title=' Index '>HOME</a>]
- [<a href='gpioinfo.c.html' title=' gpioinfo.c '>NEXT</a>]
- </div>
- <pre>
- /*====================================================================*
- *
- * gettimeofday.c - get time of day for Windows;
- *
- * A gettimeofday implementation for Microsoft Windows;
- *
- * Public domain code, author "ponnada";
- *
- *--------------------------------------------------------------------*/
- #ifndef GETTIMEOFDAY_SOURCE
- #define GETTIMEOFDAY_SOURCE
- #include <time.h>
- #include <windows.h>
- #include <sys/time.h>
- int gettimeofday (struct timeval *tv, struct timezone *tz)
- {
- FILETIME ft;
- unsigned __int64 tmpres = 0;
- static int tzflag = 0;
- if (NULL != tv)
- {
- GetSystemTimeAsFileTime (&ft);
- tmpres |= ft.dwHighDateTime;
- tmpres <<= 32;
- tmpres |= ft.dwLowDateTime;
- tmpres /= 10;
- tmpres -= DELTA_EPOCH_IN_MICROSECS;
- tv->tv_sec = (long)(tmpres / 1000000UL);
- tv->tv_usec = (long)(tmpres % 1000000UL);
- }
- if (NULL != tz)
- {
- if (!tzflag)
- {
- _tzset ();
- tzflag++;
- }
- tz->tz_minuteswest = _timezone / 60;
- tz->tz_dsttime = _daylight;
- }
- return 0;
- }
- #endif
- </pre>
- <div class='footerlink'>
- [<a href='GetProperty.c.html' title=' GetProperty.c '>PREV</a>]
- [<a href='toolkit.html' title=' Index '>HOME</a>]
- [<a href='gpioinfo.c.html' title=' gpioinfo.c '>NEXT</a>]
- </div>
- </body>
- </html>
|