diff --git a/src/impl/os.cpp b/src/impl/os.cpp index 7981470..9591fbc 100644 --- a/src/impl/os.cpp +++ b/src/impl/os.cpp @@ -2,6 +2,11 @@ // Copyright 2014 Perttu Ahola #include "interface/os.h" #include +#ifdef _WIN32 + #include "ports/windows_compat.h" +#else + #include +#endif namespace interface { namespace os { @@ -13,6 +18,11 @@ int64_t get_timeofday_us() return (int64_t)tv.tv_sec * 1000000 + (int64_t)tv.tv_usec; } +void sleep_us(int us) +{ + usleep(us); +} + } } // vim: set noet ts=4 sw=4: diff --git a/src/interface/os.h b/src/interface/os.h index 46a1080..c1e8af6 100644 --- a/src/interface/os.h +++ b/src/interface/os.h @@ -8,6 +8,7 @@ namespace interface namespace os { int64_t get_timeofday_us(); + void sleep_us(int us); } }