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

Function size_t_to_string

src/include/utils/debug_utils.hpp:172–182  ·  view source on GitHub ↗

\brief size_t_to_string macro \param size the size to convert \return the string representation of the size

Source from the content-addressed store, hash-verified

170/// \param size the size to convert
171/// \return the string representation of the size
172inline std::string size_t_to_string(size_t size){
173 if (size / 1024 == 0) {
174 return std::to_string(size);
175 } else if (size / (1024 * 1024) == 0) {
176 return std::to_string(size / 1024) + "K";
177 } else if (size / (1024 * 1024) == 0){
178 return std::to_string(size / (1024 * 1024)) + "M";
179 } else {
180 return std::to_string(size / (1024 * 1024 * 1024)) + "G";
181 }
182}

Callers 1

print_cmdMethod · 0.85

Calls 1

to_stringFunction · 0.50

Tested by

no test coverage detected