bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
timing.h File Reference

Wall clock helpers for running a simulation in real time. More...

#include "bitsim/bitsim_types.h"
#include <chrono>
#include <thread>
Include dependency graph for timing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  bitsim
namespace  bitsim::utils

Typedefs

using bitsim::utils::WallClock = std::chrono::steady_clock

Functions

real_t bitsim::utils::seconds_between (WallClock::time_point from, WallClock::time_point to)
 The seconds from one time point to another.
real_t bitsim::utils::milliseconds_since (WallClock::time_point t)
 The milliseconds since a time point.
void bitsim::utils::sleep_until_step (WallClock::time_point start, long step, real_t step_size)
 Sleep until step steps of step_size [s] after start, so that a loop that calls this every step keeps to real time without its errors adding up.

Detailed Description

Wall clock helpers for running a simulation in real time.