Skip to content

Commit 534bc59

Browse files
SHM: Replaced eCAL::Time (-> non-steady clock) for loop-time computation in memfile pool with std::steady_clock (#727)
1 parent ee29fe7 commit 534bc59

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ecal/core/src/io/ecal_memfile_pool.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
#include "ecal_memfile_pool.h"
3232

33+
#include <chrono>
34+
3335
namespace eCAL
3436
{
3537
////////////////////////////////////////
@@ -157,7 +159,7 @@ namespace eCAL
157159
while((m_timeout_read < timeout_) && !m_do_stop)
158160
{
159161
// loop start in ms
160-
auto loop_start = eCAL::Time::GetMicroSeconds()/1000;
162+
auto loop_start = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
161163

162164
// check for memory file update event from shm writer (20 ms)
163165
if(gWaitForEvent(m_event_snd, 20))
@@ -254,7 +256,7 @@ namespace eCAL
254256
else
255257
{
256258
// increase timeout in ms
257-
m_timeout_read += eCAL::Time::GetMicroSeconds()/1000 - loop_start;
259+
m_timeout_read += std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count() - loop_start;
258260
}
259261
}
260262

0 commit comments

Comments
 (0)