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

Function stamp_sub

lib_acl/samples/udp/client/main.cpp:4–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include "udp.h"
3
4static double stamp_sub(const struct timeval *from, const struct timeval *sub_by)
5{
6 struct timeval res;
7
8 memcpy(&res, from, sizeof(struct timeval));
9
10 res.tv_usec -= sub_by->tv_usec;
11 if (res.tv_usec < 0) {
12 --res.tv_sec;
13 res.tv_usec += 1000000;
14 }
15 res.tv_sec -= sub_by->tv_sec;
16
17 return res.tv_sec * 1000.0 + res.tv_usec/1000.0;
18}
19
20static int sio(SOCK_UDP *sock, const char *data, int dlen, int count,
21 int inter, bool need_read)

Callers 1

runFunction · 0.70

Calls 1

memcpyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…