use <chrono> and <thread> on Windows (#221)

* Changing from usleep to c++14 style sleep_for for Windows support
This commit is contained in:
James Xu 2019-04-05 07:50:11 -07:00 committed by Lucid One
parent 12482e555d
commit a8ba2c790d

View File

@ -43,6 +43,10 @@
**/
// STL
#include <chrono>
#include <thread>
// ROS core
#include <ros/ros.h>
#include <pcl/io/io.h>
@ -116,7 +120,7 @@ class PCDGenerator
continue;
}
usleep (interval);
std::this_thread::sleep_for(std::chrono::microseconds(static_cast<uint32_t>(interval)));
if (interval == 0) // We only publish once if a 0 seconds interval is given
{