implement a platform neutral usleep() using C++11
This commit is contained in:
@ -61,7 +61,9 @@
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <chrono>
|
||||
#include <cstring>
|
||||
#include <thread>
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
@ -172,6 +174,14 @@ double platform::walltime()
|
||||
return wtime;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
sleep with microsecond resolution
|
||||
------------------------------------------------------------------------ */
|
||||
void platform::usleep(int usec)
|
||||
{
|
||||
return std::this_thread::sleep_for(std::chrono::microseconds(usec));
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
get Operating system and version info
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user