MCPcopy Create free account
hub / github.com/Compaile/ctrack / get_timestamp

Function get_timestamp

benchmark/ctrack_benchmark.cpp:680–693  ·  view source on GitHub ↗

Get current timestamp

Source from the content-addressed store, hash-verified

678
679// Get current timestamp
680std::string get_timestamp()
681{
682 auto now = std::chrono::system_clock::now();
683 auto time_t = std::chrono::system_clock::to_time_t(now);
684 std::stringstream ss;
685#ifdef _WIN32
686 struct tm time_info;
687 localtime_s(&time_info, &time_t);
688 ss << std::put_time(&time_info, "%Y-%m-%d %H:%M:%S");
689#else
690 ss << std::put_time(std::localtime(&time_t), "%Y-%m-%d %H:%M:%S");
691#endif
692 return ss.str();
693}
694
695// Print usage
696void print_usage(const char *program_name)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected