System clock. More...
#include <time.hpp>
Public Types | |
using | duration = boost::chrono::system_clock::duration |
using | rep = duration::rep |
using | period = duration::period |
using | time_point = boost::chrono::time_point< system_clock > |
using | TimePoint = time_point |
using | Duration = duration |
Static Public Member Functions | |
static time_point | now () noexcept |
static std::time_t | to_time_t (const time_point &t) noexcept |
static time_point | from_time_t (std::time_t t) noexcept |
Static Public Attributes | |
static constexpr bool | is_steady = boost::chrono::system_clock::is_steady |
System clock.
System clock represents the system-wide real time wall clock.
It may not be monotonic: on most systems, the system time can be adjusted at any moment. It is the only clock that has the ability to be displayed and converted to/from UNIX timestamp.
To get the current time:
const auto now = system_clock::now();
To convert a time_point to/from UNIX timestamp:
system_clock::time_point time = ...; uint64_t timestampInMilliseconds = toUnixTimestamp(time).count(); system_clock::time_point time2 = fromUnixTimestamp(milliseconds(timestampInMilliseconds));
using ndn::time::system_clock::duration = boost::chrono::system_clock::duration |
using ndn::time::system_clock::rep = duration::rep |
using ndn::time::system_clock::period = duration::period |
using ndn::time::system_clock::time_point = boost::chrono::time_point<system_clock> |
|
staticnoexcept |
Definition at line 46 of file time.cpp.
Referenced by ndn::Name::appendTimestamp(), ndn::Name::appendVersion(), ndn::security::v2::ValidationPolicyCommandInterest::checkPolicy(), ndn::security::v2::ValidationPolicySignedInterest::checkPolicy(), nfd::rib::computeExpiration(), ndn::security::v2::CertificateCache::find(), nfd::ForwarderStatusManager::ForwarderStatusManager(), ndn::SignatureInfo::hasKeyLocator(), ndn::security::v2::CertificateCache::insert(), ndn::security::InterestSigner::makeCommandInterest(), and ndn::PrefixAnnouncement::toData().
|
staticnoexcept |
|
staticnoexcept |
|
static |