Sunshine latest
Self-hosted game stream host for Moonlight.
logging::time_delta_periodic_logger Class Reference

A helper class for tracking and logging short time intervals across a period of time. More...

#include <src/logging.h>

Public Member Functions

void first_point (const std::chrono::steady_clock::time_point &point)
 
void first_point_now ()
 
bool is_enabled () const
 
void reset ()
 
void second_point_and_log (const std::chrono::steady_clock::time_point &point)
 
void second_point_now_and_log ()
 
 time_delta_periodic_logger (boost::log::sources::severity_logger< int > &severity, std::string_view message, std::chrono::seconds interval_in_seconds=std::chrono::seconds(20))
 

Detailed Description

A helper class for tracking and logging short time intervals across a period of time.

Examples

time_delta_periodic_logger logger(debug, "Test duration", 5s);
logger.first_point_now();
// ...
logger.second_point_now_and_log();
// after 5 seconds
logger.first_point_now();
// ...
logger.second_point_now_and_log();
// In the log:
// [2024:01:01:12:00:00]: Debug: Test duration (min/max/avg): 1.23ms/3.21ms/2.31ms
A helper class for tracking and logging short time intervals across a period of time.
Definition logging.h:166

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