Commit 51c36973 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

compat: Thread: Add missing this_thread::sleep_for

parent b5338097
......@@ -206,6 +206,17 @@ namespace this_thread
return GetCurrentThread();
#else
return { pthread_self() };
#endif
}
template <typename Rep, typename Period>
inline void sleep_for( const std::chrono::duration<Rep, Period>& duration )
{
auto d = std::chrono::duration_cast<std::chrono::milliseconds>( duration );
#ifdef _WIN32
Sleep( d.count() );
#else
usleep( d.count() * 1000 );
#endif
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment