libecs-cpp 2.1.0
Entity Component System library in C++
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
ecs::SteadyClock Class Reference

The real clock: std::chrono::steady_clock, truncated to whole microseconds. More...

#include <Clock.hpp>

Inheritance diagram for ecs::SteadyClock:
Inheritance graph
[legend]
Collaboration diagram for ecs::SteadyClock:
Collaboration graph
[legend]

Public Member Functions

std::chrono::microseconds Now () const override
 Time since the clock's starting point, in microseconds.
 
- Public Member Functions inherited from ecs::Clock
virtual ~Clock ()=default
 Destroys the clock.
 

Static Public Member Functions

static const SteadyClock & Instance ()
 The shared instance, which lives until the process ends.
 

Detailed Description

The real clock: std::chrono::steady_clock, truncated to whole microseconds.

It is stateless and safe to use from any thread.

Member Function Documentation

◆ Instance()

static const SteadyClock & ecs::SteadyClock::Instance ( )
inlinestatic

The shared instance, which lives until the process ends.

Does not allocate.

◆ Now()

std::chrono::microseconds ecs::SteadyClock::Now ( ) const
inlineoverridevirtual

Time since the clock's starting point, in microseconds.

Never decreases.

Implements ecs::Clock.


The documentation for this class was generated from the following file: