MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / format_time

Function format_time

smallthinker/common/chat.cpp:20–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18#include <vector>
19
20static std::string format_time(const std::chrono::system_clock::time_point & now, const std::string & format) {
21 auto time = std::chrono::system_clock::to_time_t(now);
22 auto local_time = *std::localtime(&time);
23 std::ostringstream ss;
24 ss << std::put_time(&local_time, format.c_str());
25 auto res = ss.str();
26 return res;
27}
28
29static std::string string_diff(const std::string & last, const std::string & current) {
30 if (last.empty()) {

Calls 4

to_time_tFunction · 0.85
localtimeFunction · 0.85
c_strMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected