Namespaces
Variants
Views
Actions

std::chrono::system_clock

From cppreference.com
< cpp‎ | chrono
Revision as of 08:07, 22 December 2012 by P12 (Talk | contribs)

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <chrono>
</td>

<td></td> <td></td> <tr class="t-dcl ">

<td >
class system_clock;
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end

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-style time, and, therefore, to be displayed.

std::chrono::system_clock meets the requirements of TrivialClock.

Contents

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 std::chrono::time_point<std::chrono::system_clock>

Member constants

bool is_steady
[static]
true if the time between ticks is always constant, i.e. calls to now() return values that increase monotonically even in case of some external clock adjustment
(public static member constant)

Member functions

Template:cpp/chrono/system clock/dcl list nowTemplate:cpp/chrono/system clock/dcl list to time tTemplate:cpp/chrono/system clock/dcl list from time t

See also

monotonic clock that will never be adjusted
(class)
the clock with the shortest tick period available
(class)