Goby3  3.1.4
2024.02.22
goby::time::SteadyClock Struct Reference

Essentially the same as std::chrono::steady_clock except the time returned by SteadyClock::now() can be "warped" (made to run faster than real time) for simulation purposes. To do this, set the appropriate parameters in SimulatorSettings. More...

#include <goby/time/steady_clock.h>

Public Types

typedef std::chrono::microseconds duration
 Duration type. More...
 
typedef duration::rep rep
 
typedef duration::period period
 
typedef std::chrono::time_point< SteadyClocktime_point
 

Static Public Member Functions

static time_point now () noexcept
 Returns the current steady time unless SimulatorSettings::using_sim_time == true in which case a simulated time is returned that is sped up by (multiplied by) the SimulatorSettings::warp_factor More...
 

Static Public Attributes

static const bool is_steady = true
 

Detailed Description

Essentially the same as std::chrono::steady_clock except the time returned by SteadyClock::now() can be "warped" (made to run faster than real time) for simulation purposes. To do this, set the appropriate parameters in SimulatorSettings.

Definition at line 37 of file steady_clock.h.

Member Typedef Documentation

◆ duration

typedef std::chrono::microseconds goby::time::SteadyClock::duration

Duration type.

We use microseconds (not nanoseconds) to avoid overflow at higher warp values

Definition at line 42 of file steady_clock.h.

◆ period

typedef duration::period goby::time::SteadyClock::period

Definition at line 44 of file steady_clock.h.

◆ rep

typedef duration::rep goby::time::SteadyClock::rep

Definition at line 43 of file steady_clock.h.

◆ time_point

typedef std::chrono::time_point<SteadyClock> goby::time::SteadyClock::time_point

Definition at line 45 of file steady_clock.h.

Member Function Documentation

◆ now()

static time_point goby::time::SteadyClock::now ( )
inlinestaticnoexcept

Returns the current steady time unless SimulatorSettings::using_sim_time == true in which case a simulated time is returned that is sped up by (multiplied by) the SimulatorSettings::warp_factor

Definition at line 49 of file steady_clock.h.

Member Data Documentation

◆ is_steady

const bool goby::time::SteadyClock::is_steady = true
static

Definition at line 46 of file steady_clock.h.


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