MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get_time

Function get_time

src/ifcparse/IfcLogger.cpp:40–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38namespace {
39
40std::string get_time(bool with_milliseconds = false) {
41 std::ostringstream oss;
42 time_t now = time(nullptr);
43 oss << std::put_time(localtime(&now), "%F %T");
44
45 if (with_milliseconds) {
46 auto now_chrono = std::chrono::system_clock::now();
47 auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(now_chrono.time_since_epoch()) % 1000;
48 oss << '.' << std::setfill('0') << std::setw(3) << milliseconds.count();
49 }
50
51 return oss.str();
52}
53
54template <typename T>
55struct severity_strings {

Callers 2

plain_text_messageFunction · 0.85
json_messageFunction · 0.85

Calls 2

countMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected