From 52dfdb1ff928b6dbe8229e234cda6017291584bd Mon Sep 17 00:00:00 2001 From: Christopher Wecht Date: Fri, 12 Apr 2019 10:42:17 +0200 Subject: [PATCH] CallbackQueue: use SteadyTime instead of WallTime to get independent of system-time changes --- clients/roscpp/src/libros/callback_queue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/roscpp/src/libros/callback_queue.cpp b/clients/roscpp/src/libros/callback_queue.cpp index a43772cc71..0dc2181937 100644 --- a/clients/roscpp/src/libros/callback_queue.cpp +++ b/clients/roscpp/src/libros/callback_queue.cpp @@ -226,7 +226,7 @@ CallbackQueue::CallOneResult CallbackQueue::callOne(ros::WallDuration timeout) return Disabled; } - ros::WallTime start_time(ros::WallTime::now()); + ros::SteadyTime start_time(ros::SteadyTime::now()); if (callbacks_.empty()) { @@ -271,7 +271,7 @@ CallbackQueue::CallOneResult CallbackQueue::callOne(ros::WallDuration timeout) { // do not spend more than `timeout` seconds in the callback; we already waited for some time when waiting for // nonempty queue - ros::WallTime now(ros::WallTime::now()); + ros::SteadyTime now(ros::SteadyTime::now()); ros::WallDuration time_spent = now - start_time; ros::WallDuration time_to_wait = timeout - time_spent;