]> git.sesse.net Git - stockfish/blob - src/timeoday.cpp
Micro optimize copy of new state in do_move()
[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 #include <windows.h>
8 #include <time.h>
9 #include "dos.h"
10
11
12 int             gettimeofday(struct timeval * tp, struct timezone * tzp)
13 {
14     SYSTEMTIME      systime;
15
16     if (tp) {
17         struct tm       tmrec;
18         time_t          theTime = time(NULL);
19
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 }