Namespaces
Variants
Views
Actions

std::chrono::steady_clock

From cppreference.com
< cpp‎ | chrono
 
 
Utilities library
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)
 
Date and time utilities
Time point
(C++11)
(C++20)
Duration
(C++11)
Clocks
steady_clock
(C++11)
(C++11)      
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Time of day
(C++20)(C++20)
(C++20)(C++20)
(C++20)

Calendars
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
Time zones
(C++20)
(C++20)
(C++20)
chrono I/O
(C++20)
C-style date and time
 
std::chrono::steady_clock
Member functions
 
Defined in header <chrono>
class steady_clock;
(since C++11)

Class std::chrono::steady_clock represents a monotonic clock. The time points of this clock cannot decrease as physical time moves forward and the time between ticks of this clock is constant. This clock is not related to wall clock time (for example, it can be time since last reboot), and is most suitable for measuring intervals.

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

Contents

[edit] Member types

Member type Definition
rep arithmetic type representing the number of ticks in the clock's duration
period a std::ratio type representing the tick period of the clock, in seconds
duration std::chrono::duration<rep, period>
time_point std::chrono::time_point<std::chrono::steady_clock>

[edit] Member constants

constexpr bool is_steady
[static]
steady clock flag, always true
(public static member constant)

[edit] Member functions

[static]
returns a time_point representing the current value of the clock
(public static member function)

[edit] See also

wall clock time from the system-wide realtime clock
(class)
the clock with the shortest tick period available
(class)