Descent3/libmve/platform.cpp

20 lines
345 B
C++
Raw Normal View History

2024-04-16 03:43:29 +00:00
#if _WIN32
2024-04-16 18:56:40 +00:00
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <MMSystem.h>
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
unsigned int platform_timeGetTime(void) { return timeGetTime(); }
2024-04-16 03:43:29 +00:00
#else
2024-04-16 18:56:40 +00:00
#include <unistd.h>
#include <sys/time.h>
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
unsigned int platform_timeGetTime(void) {
struct timeval t;
gettimeofday(&t, NULL);
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
return (t.tv_sec * 1000 + t.tv_usec / 1000);
}
2024-04-16 03:43:29 +00:00
#endif