MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / unitsAsString

Method unitsAsString

unittests/catch.hpp:11795–11811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11793 }
11794 }
11795 auto unitsAsString() const -> std::string {
11796 switch (m_units) {
11797 case Unit::Nanoseconds:
11798 return "ns";
11799 case Unit::Microseconds:
11800 return "µs";
11801 case Unit::Milliseconds:
11802 return "ms";
11803 case Unit::Seconds:
11804 return "s";
11805 case Unit::Minutes:
11806 return "m";
11807 default:
11808 return "** internal error **";
11809 }
11810
11811 }
11812 friend auto operator << (std::ostream& os, Duration const& duration) -> std::ostream& {
11813 return os << duration.value() << " " << duration.unitsAsString();
11814 }

Callers 1

operator <<Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected