The Gaudi Framework  master (37c0b60a)
std::chrono::io Namespace Reference

Helpers to stream duration objects with proper units. More...

Functions

template<typename T >
std::string duration_unit (T)
 Return unit of std::chrono::duration. More...
 
template<>
std::string duration_unit (std::chrono::nanoseconds)
 
template<>
std::string duration_unit (std::chrono::microseconds)
 
template<>
std::string duration_unit (std::chrono::milliseconds)
 
template<>
std::string duration_unit (std::chrono::seconds)
 
template<>
std::string duration_unit (std::chrono::minutes)
 
template<>
std::string duration_unit (std::chrono::hours)
 

Detailed Description

Helpers to stream duration objects with proper units.

This will become obsolete with C++20: https://en.cppreference.com/w/cpp/chrono/duration/operator_ltlt

Function Documentation

◆ duration_unit() [1/7]

template<>
std::string std::chrono::io::duration_unit ( std::chrono::hours  )
inline

Definition at line 61 of file ChronoIO.h.

61  {
62  return "h";
63  }

◆ duration_unit() [2/7]

template<>
std::string std::chrono::io::duration_unit ( std::chrono::microseconds  )
inline

Definition at line 41 of file ChronoIO.h.

41  {
42  return "us";
43  }

◆ duration_unit() [3/7]

template<>
std::string std::chrono::io::duration_unit ( std::chrono::milliseconds  )
inline

Definition at line 46 of file ChronoIO.h.

46  {
47  return "ms";
48  }

◆ duration_unit() [4/7]

template<>
std::string std::chrono::io::duration_unit ( std::chrono::minutes  )
inline

Definition at line 56 of file ChronoIO.h.

56  {
57  return "m";
58  }

◆ duration_unit() [5/7]

template<>
std::string std::chrono::io::duration_unit ( std::chrono::nanoseconds  )
inline

Definition at line 36 of file ChronoIO.h.

36  {
37  return "ns";
38  }

◆ duration_unit() [6/7]

template<>
std::string std::chrono::io::duration_unit ( std::chrono::seconds  )
inline

Definition at line 51 of file ChronoIO.h.

51  {
52  return "s";
53  }

◆ duration_unit() [7/7]

template<typename T >
std::string std::chrono::io::duration_unit ( )
inline

Return unit of std::chrono::duration.

Definition at line 30 of file ChronoIO.h.

30  {
31  return "";
32  }