MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / cast_to_ms

Function cast_to_ms

src/include/utils/utils.hpp:92–108  ·  view source on GitHub ↗

\brief cast to milliseconds \param time the time \return the time in milliseconds

Source from the content-addressed store, hash-verified

90/// \param time the time
91/// \return the time in milliseconds
92inline time_with_unit cast_to_ms(time_with_unit time){
93 if (time.second == "ns"){
94 return std::make_pair(time.first / 1000000, "ms");
95 }
96 if (time.second == "ms"){
97 return time;
98 }
99 if (time.second == "us"){
100 return std::make_pair(time.first / 1000, "ms");
101 }
102 if (time.second == "s"){
103 return std::make_pair(time.first / 1000000, "ms");
104 }
105 else{
106 return time;
107 }
108}
109
110/// \brief cast to seconds
111/// \param time the time

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected