$darkmode
duration.hpp File Reference
#include <chrono>
#include <ratio>
#include <string>
#include <nlohmann/json.hpp>
Include dependency graph for duration.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  nlohmann::adl_serializer< cloe::Microseconds >
 
struct  nlohmann::adl_serializer< cloe::Milliseconds >
 
struct  nlohmann::adl_serializer< cloe::Seconds >
 
struct  nlohmann::adl_serializer< cloe::Duration >
 

Typedefs

using cloe::Duration = std::chrono::nanoseconds
 
using cloe::Microseconds = std::chrono::duration< double, std::micro >
 
using cloe::Milliseconds = std::chrono::duration< double, std::milli >
 
using cloe::Seconds = std::chrono::duration< double >
 

Functions

std::string cloe::to_string (const Duration &ns)
 
nlohmann::json cloe::to_convenient_json (const Duration &ns)
 
std::string nlohmann::to_string_hr (double d)
 

Detailed Description

See also
cloe/core.hpp

Typedef Documentation

◆ Duration

using cloe::Duration = typedef std::chrono::nanoseconds

Duration is an alias for std::chrono::nanoseconds, which represents the default unit of time for simulated time and spans roughly +/- 290 years.

Warning: the default constructor does not exist. If you want zero time, you need to set it explicitly, for example inside a class:

Duration time_ = Duration(0);