]> git.sesse.net Git - stockfish/blob - src/timeoday.cpp
Document TTEntry and move layouts
[stockfish] / src / timeoday.cpp
1 /*
2    (c) Copyright 1992 Eric Backus
3
4    This software may be used freely so long as this copyright notice is
5    left intact. There is no warrantee on this software.
6 */
7
8 #include <windows.h>
9 #include <time.h>
10 #include "dos.h"
11
12 int gettimeofday(struct timeval* tp, struct timezone* tzp)
13 {
14     SYSTEMTIME systime;
15
16     if (tp)
17     {
18         struct tm tmrec;
19         time_t theTime = time(NULL);
20
21         tmrec = *localtime(&theTime);
22         tp->tv_sec = mktime(&tmrec);
23         GetLocalTime(&systime); /* system time */
24
25         tp->tv_usec = systime.wMilliseconds * 1000;
26     }
27     return 0;
28 }