mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 18:17:02 +08:00
Initial import of Glaurung 2.1
This commit is contained in:
28
src/timeoday.cpp
Normal file
28
src/timeoday.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
(c) Copyright 1992 Eric Backus
|
||||
|
||||
This software may be used freely so long as this copyright notice is
|
||||
left intact. There is no warrantee on this software.
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <time.h>
|
||||
#include "dos.h"
|
||||
|
||||
|
||||
int gettimeofday(struct timeval * tp, struct timezone * tzp)
|
||||
{
|
||||
SYSTEMTIME systime;
|
||||
|
||||
if (tp) {
|
||||
struct tm tmrec;
|
||||
time_t theTime = time(NULL);
|
||||
|
||||
|
||||
tmrec = *localtime(&theTime);
|
||||
tp->tv_sec = mktime(&tmrec);
|
||||
GetLocalTime(&systime); /* system time */
|
||||
|
||||
tp->tv_usec = systime.wMilliseconds * 1000;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user