std::chrono::system_clock

From Cppreference

Jump to: navigation, search
Defined in header <chrono>

Defined in namespace std::chrono
class system_clock;
(C++11 feature)

Class std::chrono::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 C++ clock that has the ability to map its time points to C time, and, therefore, to be displayed.

Contents

[edit] Member types

Member type Definition
rep signed arithmetic type representing the number of ticks in the clock's duration
period an std::ratio type representing the tick period of the clock, in seconds
duration std::chrono::duration<rep, period>, capable of representing negative durations
time_point the type of this clock's time point, std::chrono::time_point<system_clock>

[edit] Member constants

is_steady
indicates whether system_clock is steady
(public static member constant)

[edit] Member functions

now [static]
returns a time_point representing the current point in time
(public static member function)
to_time_t [static]
converts a system_clock time point to std::time_t
(public static member function)
from_time_t [static]
converts std::time_t to a system_clock time point
(public static member function)

[edit] See also

steady_clock (C++11)
monotonic clock that will never be adjusted
(class)
high_resolution_clock (C++11)
the clock with the shortest tick period available
(class)