MCPcopy Create free account
hub / github.com/3rdparty/libprocess / time

Method time

src/posix/libevent/libevent.cpp:164–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162
163
164double EventLoop::time()
165{
166 // We explicitly call `evutil_gettimeofday()` for now to avoid any
167 // issues that may be introduced by using the cached value provided
168 // by `event_base_gettimeofday_cached()`. Since a lot of logic in
169 // libprocess depends on time math, we want to log fatal rather than
170 // cause logic errors if the time fails.
171 timeval t;
172 if (evutil_gettimeofday(&t, nullptr) < 0) {
173 LOG(FATAL) << "Failed to get time, evutil_gettimeofday";
174 }
175
176 return Duration(t).secs();
177}
178
179
180void EventLoop::initialize()

Callers

nothing calls this directly

Calls 1

secsMethod · 0.80

Tested by

no test coverage detected