MCPcopy Create free account
hub / github.com/GPUOpen-Tools/radeon_gpu_analyzer / CurrentTime

Function CurrentTime

source/common/rga_shared_utils.cpp:82–99  ·  view source on GitHub ↗

Get current system time.

Source from the content-addressed store, hash-verified

80
81// Get current system time.
82static bool CurrentTime(struct tm& time_data)
83{
84 bool ret = false;
85 std::stringstream suffix;
86 time_t current_time = std::time(0);
87#ifdef _WIN32
88 struct tm* time_local = &time_data;
89 ret = (localtime_s(time_local, &current_time) == 0);
90#else
91 struct tm* time_local = localtime(&current_time);
92 if (time_local != nullptr)
93 {
94 time_data = *time_local;
95 ret = true;
96 }
97#endif
98 return ret;
99}
100
101// Delete log files older than "daysNum" days.
102bool RgaSharedUtils::DeleteOldLogs(const std::string& dir, const std::string& base_file_name, unsigned int days_num)

Callers 2

DeleteOldLogsMethod · 0.70
ConstructLogFileNameMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected