All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ndn::time::system_clock Class Reference

System clock. More...

#include <time.hpp>

Inheritance diagram for ndn::time::system_clock:
[legend]
Collaboration diagram for ndn::time::system_clock:
[legend]

Public Types

typedef time_point TimePoint
 
typedef duration Duration
 

Detailed Description

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 current TimePoint:

system_clock::TimePoint now = system_clock::now();

To convert TimePoint to/from UNIX timestamp:

system_clock::TimePoint time = ...; uint64_t timestampInMilliseconds = toUnixTimestamp(time).count(); system_clock::TimePoint time2 = fromUnixTimestamp(time::milliseconds(timestampInMilliseconds));

Definition at line 52 of file time.hpp.

Member Typedef Documentation

Definition at line 56 of file time.hpp.

Definition at line 55 of file time.hpp.