MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / size_string

Function size_string

include/util/io.h:68–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68std::string size_string(size_t size) {
69 std::stringstream ss;
70 ss.precision(3);
71 if (size >= 1 << 30)
72 ss << size / float(1 << 30) << " GiB";
73 else if (size >= 1 << 20)
74 ss << size / float(1 << 20) << " MiB";
75 else if (size >= 1 << 10)
76 ss << size / float(1 << 10) << " KiB";
77 else
78 ss << size << " B";
79 return ss.str();
80}
81
82const size_t kLineWidth = 44;
83std::string begin(kLineWidth, '<');

Callers 1

resource_infoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected