MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fmt_time

Function fmt_time

dpdk/app/test/test_pcapng.c:192–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192static char *
193fmt_time(char *buf, size_t size, uint64_t ts_ns)
194{
195 time_t sec;
196 size_t len;
197
198 sec = ts_ns / NS_PER_S;
199 len = strftime(buf, size, "%X", localtime(&sec));
200 snprintf(buf + len, size - len, ".%09lu",
201 (unsigned long)(ts_ns % NS_PER_S));
202
203 return buf;
204}
205
206/* Context for the pcap_loop callback */
207struct pkt_print_ctx {

Callers 2

print_packetFunction · 0.85
parse_pcap_packetFunction · 0.85

Calls 1

snprintfFunction · 0.85

Tested by

no test coverage detected