Skip to content

Commit

Permalink
core: chrono::steady_clock::now() is static
Browse files Browse the repository at this point in the history
  • Loading branch information
Pesa committed Dec 3, 2023
1 parent 9b826db commit fe0a337
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions ndn-svs/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <ndn-cxx/security/signing-helpers.hpp>
#include <ndn-cxx/security/verification-helpers.hpp>

#include <chrono>

#ifdef NDN_SVS_COMPRESSION
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/device/array.hpp>
Expand All @@ -45,7 +47,8 @@ SVSyncCore::SVSyncCore(ndn::Face& face,
, m_periodicSyncTime(30_s)
, m_periodicSyncJitter(0.1)
, m_rng(ndn::random::getRandomNumberEngine())
, m_retxDist(m_periodicSyncTime.count() * (1.0 - m_periodicSyncJitter), m_periodicSyncTime.count() * (1.0 + m_periodicSyncJitter))
, m_retxDist(m_periodicSyncTime.count() * (1.0 - m_periodicSyncJitter),
m_periodicSyncTime.count() * (1.0 + m_periodicSyncJitter))
, m_intrReplyDist(0, m_maxSuppressionTime.count())
, m_keyChainMem("pib-memory:", "tpm-memory:")
, m_scheduler(m_face.getIoContext())
Expand Down Expand Up @@ -382,7 +385,7 @@ long
SVSyncCore::getCurrentTime() const
{
return std::chrono::duration_cast<std::chrono::microseconds>(
m_steadyClock.now().time_since_epoch()).count();
std::chrono::steady_clock::now().time_since_epoch()).count();
}

bool
Expand Down
3 changes: 0 additions & 3 deletions ndn-svs/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <ndn-cxx/util/scheduler.hpp>

#include <atomic>
#include <chrono>
#include <mutex>

namespace ndn::svs {
Expand Down Expand Up @@ -287,8 +286,6 @@ class SVSyncCore : noncopyable
scheduler::ScopedEventId m_retxEvent;
scheduler::ScopedEventId m_packetEvent;

std::chrono::steady_clock m_steadyClock;

// Time at which the next sync interest will be sent
std::atomic_long m_nextSyncInterest;

Expand Down
2 changes: 2 additions & 0 deletions ndn-svs/svspubsub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include <ndn-cxx/util/segment-fetcher.hpp>

#include <chrono>

namespace ndn::svs {

SVSPubSub::SVSPubSub(const Name& syncPrefix,
Expand Down

0 comments on commit fe0a337

Please sign in to comment.