\brief cast to milliseconds \param time the time \return the time in milliseconds
| 90 | /// \param time the time |
| 91 | /// \return the time in milliseconds |
| 92 | inline 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 |
nothing calls this directly
no outgoing calls
no test coverage detected