MCPcopy Create free account
hub / github.com/acl-dev/acl / stamp_sub

Function stamp_sub

lib_acl_cpp/src/stdlib/util.cpp:60–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60double stamp_sub(const struct timeval& from, const struct timeval& sub)
61{
62#if 0
63 struct timeval res;
64
65 memcpy(&res, &from, sizeof(struct timeval));
66
67 res.tv_usec -= sub.tv_usec;
68 if (res.tv_usec < 0) {
69 --res.tv_sec;
70 res.tv_usec += 1000000;
71 }
72
73 res.tv_sec -= sub.tv_sec;
74 return res.tv_sec * 1000.0 + res.tv_usec / 1000.0;
75#else
76
77 return (from.tv_sec - sub.tv_sec) * 1000
78 + (from.tv_usec - sub.tv_usec) / 1000;
79#endif
80}
81
82} // namespace acl

Callers 4

open_callbackMethod · 0.50
close_callbackMethod · 0.50
check_deadMethod · 0.50
keep_connsMethod · 0.50

Calls 1

memcpyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…