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

Function stamp_sub

lib_acl_cpp/samples/atomic/main.cpp:3–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "acl_cpp/lib_acl.hpp"
2
3double stamp_sub(const struct timeval *from, const struct timeval *sub)
4{
5 struct timeval res;
6
7 memcpy(&res, from, sizeof(struct timeval));
8
9 res.tv_usec -= sub->tv_usec;
10 if (res.tv_usec < 0) {
11 --res.tv_sec;
12 res.tv_usec += 1000000;
13 }
14 res.tv_sec -= sub->tv_sec;
15
16 return (res.tv_sec * 1000.0 + res.tv_usec/1000.0);
17}
18
19class mythread : public acl::thread
20{

Callers 15

mainFunction · 0.70
testFunction · 0.50
runMethod · 0.50
mainFunction · 0.50
thread_mainFunction · 0.50
handle_connectionFunction · 0.50
thread_readFunction · 0.50
thread_writeFunction · 0.50
addMethod · 0.50
getMethod · 0.50
handle_connectionFunction · 0.50
handle_connectionFunction · 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…