Descent3/libmve/platform.cpp
2024-04-16 12:56:40 -06:00

20 lines
345 B
C++

#if _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <MMSystem.h>
unsigned int platform_timeGetTime(void) { return timeGetTime(); }
#else
#include <unistd.h>
#include <sys/time.h>
unsigned int platform_timeGetTime(void) {
struct timeval t;
gettimeofday(&t, NULL);
return (t.tv_sec * 1000 + t.tv_usec / 1000);
}
#endif