use Sleep in Windows instead of sleep_for

fixes #609
This commit is contained in:
Joao Moreno
2018-01-11 14:48:28 +01:00
parent 32177aa77a
commit a938045135
4 changed files with 14 additions and 5 deletions

View File

@@ -362,6 +362,15 @@ inline size_t thread_id()
}
// from https://github.com/gabime/spdlog/issues/609
inline void sleep_for_millis(int milliseconds)
{
#if defined(_WIN32)
Sleep(milliseconds);
#else
std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
#endif
}
// wchar support for windows file names (SPDLOG_WCHAR_FILENAMES must be defined)
#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES)