![]() |
Utilities
Utilities header only library
|
Set of functions and structures for measuring time. More...
Data Structures | |
| class | FileTimeLogger |
| Measures duration of program parts and logs times into a file. More... | |
| struct | ProfilingResult |
| The result of profiling function execution. Contains the actual result and the run time. More... | |
| class | StopWatch |
| Class for measuring time in milliseconds [ms]. More... | |
| class | TimeLogger |
| Measures duration of program parts and logs times into a stream. More... | |
Typedefs | |
| using | DateTime = std::chrono::system_clock::time_point |
Functions | |
| DateTime | Now () |
| Returns current time point. | |
| double | NowMs () |
| Returns current time, as number of milliseconds since epoch start. | |
| double | NowS () |
| Returns current time, as number of seconds since epoch start. | |
| std::string | ToString (const DateTime &date_time, const std::string &format="%Y_%m_%d_%H_%M_%S") |
| Returns specified time in string form. More... | |
| std::string | NowStr (const std::string &format="%Y_%m_%d_%H_%M_%S") |
| Returns current time in string form. More... | |
| int64_t | MicrosecondsBetween (const DateTime &datetime1, const DateTime &datetime2) |
| Returns duration between two time points in microseconds. | |
| double | SecondsBetween (const DateTime &datetime1, const DateTime &datetime2) |
| Returns duration between two time points in seconds. | |
| template<typename T > | |
| ProfilingResult< T > | ProfileFunctionRun (std::function< T()> Function) |
| Execute and profile a function. | |
Set of functions and structures for measuring time.
|
inline |
Returns current time in string form.
| format | Defines string format. For options see documentation of strftime() at https://en.cppreference.com/w/c/chrono/strftime. |
|
inline |
Returns specified time in string form.
| date_time | The DateTime to be formatted. |
| format | Defines string format. For options see documentation of strftime() at https://en.cppreference.com/w/c/chrono/strftime. |