1#ifndef BITSIM_UTILS_TIMING_H
2#define BITSIM_UTILS_TIMING_H
26 return std::chrono::duration<real_t>(to - from).count();
34 return std::chrono::duration<real_t, std::milli>(WallClock::now() - t).count();
43 std::this_thread::sleep_until(
44 start + std::chrono::microseconds(
static_cast<long>(1.0e6 * step_size * step)));
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
Definition bitsim_utils.h:11
real_t milliseconds_since(WallClock::time_point t)
The milliseconds since a time point.
Definition timing.h:32
real_t seconds_between(WallClock::time_point from, WallClock::time_point to)
The seconds from one time point to another.
Definition timing.h:24
std::chrono::steady_clock WallClock
Definition timing.h:19
void 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 ...
Definition timing.h:41
Definition dc_motor_backend_base.h:9
double real_t
real_t
Definition bitsim_types.h:20