MCPcopy Create free account
hub / github.com/apache/trafficserver / get_time_now_str

Function get_time_now_str

plugins/lua/ts_lua.cc:223–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223static void
224get_time_now_str(char *const buf, size_t const buflen)
225{
226 TSHRTime const timenowusec = TShrtime();
227 int64_t const timemsec = (int64_t)(timenowusec / 1000000);
228 time_t const timesec = (time_t)(timemsec / 1000);
229 int const ms = (int)(timemsec % 1000);
230
231 struct tm tm;
232 gmtime_r(&timesec, &tm);
233 size_t const dtlen = strftime(buf, buflen, "%b %e %H:%M:%S", &tm);
234
235 // tack on the ms
236 snprintf(buf + dtlen, buflen - dtlen, ".%03d", ms);
237}
238
239// dump exhaustive per state summary stats
240static int

Callers 1

lifecycleHandlerFunction · 0.85

Calls 1

TShrtimeFunction · 0.85

Tested by

no test coverage detected