10 using clock = std::chrono::high_resolution_clock;
12 using duration = std::chrono::duration<std::size_t,std::milli>;
22 return std::chrono::duration_cast<duration>(
clock::now() - start);
64 void collect(std::map<std::string, std::string>& data,
const std::string& key) {
66 data.emplace(key+
".count", std::to_string(
count()));
67 data.emplace(key+
".overall_ms", std::to_string(
overall_ms()));
68 data.emplace(key+
".active_at_timeout", active_at_timeout ?
"1" :
"0");
carl is the main namespace for the library.
auto since(time_point start)
Return the duration since the given start time point.
clock::time_point time_point
The type of a time point.
auto zero()
Return a zero duration.
std::chrono::duration< std::size_t, std::milli > duration
The duration type used here.
auto now()
Return the current time point.
std::chrono::high_resolution_clock clock
The clock type used here.
static timing::time_point start()
void collect(std::map< std::string, std::string > &data, const std::string &key)
timing::time_point m_current_start
void finish(timing::time_point start)
timing::duration m_overall