MCPcopy Create free account
hub / github.com/Kitware/CMake / ComputeSuffixTime

Method ComputeSuffixTime

Source/cmInstrumentation.cxx:806–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804}
805
806std::string cmInstrumentation::ComputeSuffixTime(
807 cm::optional<std::chrono::system_clock::time_point> time)
808{
809 std::chrono::milliseconds ms =
810 std::chrono::duration_cast<std::chrono::milliseconds>(
811 (time.has_value() ? time.value() : std::chrono::system_clock::now())
812 .time_since_epoch());
813 std::chrono::seconds s =
814 std::chrono::duration_cast<std::chrono::seconds>(ms);
815
816 std::time_t ts = s.count();
817 std::size_t tms = ms.count() % 1000;
818
819 cmTimestamp cmts;
820 std::ostringstream ss;
821 ss << cmts.CreateTimestampFromTimeT(ts, "%Y-%m-%dT%H-%M-%S", true) << '-'
822 << std::setfill('0') << std::setw(4) << tms;
823 return ss.str();
824}
825
826bool cmInstrumentation::IsInstrumentableTargetType(
827 cmStateEnums::TargetType type)

Callers 3

WriteCMakeContentMethod · 0.95
InstrumentTestMethod · 0.95
InstrumentCommandMethod · 0.95

Calls 5

has_valueMethod · 0.80
valueMethod · 0.80
strMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected