diff --git a/main.cpp b/main.cpp index 03348a2..dd5e77f 100644 --- a/main.cpp +++ b/main.cpp @@ -15,6 +15,29 @@ static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *use return size * nmemb; } +#if defined(__WIN32__) + +#include + +msec_t time_ms(void) +{ + return timeGetTime(); +} + +#else + +#include + +long time_ms() +{ + timeval tv; + gettimeofday(&tv, nullptr); + return tv.tv_sec * 1000 + tv.tv_usec / 1000; +} + +#endif + + int clear_icanon() { struct termios settings{};