mrdocs::format_duration

Formats a duration into a human‐readable string.

Synopsis

template<
    class Rep,
    class Period>
std::string
format_duration(std::chrono::duration<Rep, Period> delta);

Description

This function takes a std::chrono::duration object and formats it into a string that represents the duration in a human‐readable format. The format includes hours, minutes, seconds, and milliseconds as appropriate.

Return Value

A string representing the formatted duration.

Parameters

Name

Description

delta

The duration to format.

Created with MrDocs