MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / get_log_timestamp

Function get_log_timestamp

TactilityKernel/source/log.cpp:50–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50static uint64_t get_log_timestamp() {
51 static uint64_t base = 0U;
52 static std::once_flag init_flag;
53 std::call_once(init_flag, []() {
54 timeval time {};
55 gettimeofday(&time, nullptr);
56 base = ((uint64_t)time.tv_sec * 1000U) + (time.tv_usec / 1000U);
57 });
58 timeval time {};
59 gettimeofday(&time, nullptr);
60 uint64_t now = ((uint64_t)time.tv_sec * 1000U) + (time.tv_usec / 1000U);
61 return now - base;
62}
63
64extern "C" {
65

Callers 1

log_genericFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected