MCPcopy Create free account
hub / github.com/SIPp/sipp / timerdiv

Function timerdiv

src/send_packets.c:67–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65extern bool media_ip_is_ipv6;
66
67inline void
68timerdiv(struct timeval* tvp, float div)
69{
70 double interval;
71
72 if (div == 0 || div == 1)
73 return;
74
75 interval = ((double) tvp->tv_sec * 1000000 + tvp->tv_usec) / (double) div;
76 tvp->tv_sec = interval / (int) 1000000;
77 tvp->tv_usec = interval - (tvp->tv_sec * 1000000);
78}
79
80/*
81 * converts a float to a timeval structure

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected