use <chrono> and <thread> on Windows (#221)
* Changing from usleep to c++14 style sleep_for for Windows support
This commit is contained in:
parent
12482e555d
commit
a8ba2c790d
@ -43,6 +43,10 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
// STL
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
// ROS core
|
// ROS core
|
||||||
#include <ros/ros.h>
|
#include <ros/ros.h>
|
||||||
#include <pcl/io/io.h>
|
#include <pcl/io/io.h>
|
||||||
@ -116,7 +120,7 @@ class PCDGenerator
|
|||||||
continue;
|
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
|
if (interval == 0) // We only publish once if a 0 seconds interval is given
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user