unbound: util/timeval_func.h File Reference

unbound 0.1

Macros | Functions
timeval_func.h File Reference

This file contains definitions of helpers to manipulate struct timeval values, implemented in the corresponding C file. More...

`#include <sys/time.h>`

## Macros
#define | timeval_isset(tv)
#define | timeval_clear(tv)

## Functions
void | timeval_subtract (struct timeval *d, const struct timeval *end, const struct timeval *start)
| subtract timers and the values do not overflow or become negative
void | timeval_add (struct timeval *d, const struct timeval *add)
| add timers and the values do not overflow or become negative
void | timeval_divide (struct timeval *avg, const struct timeval *sum, long long d)
| divide sum of timers to get average
int | timeval_smaller (const struct timeval *x, const struct timeval *y)
| histogram compare of time values

## Detailed Description

This file contains definitions of helpers to manipulate struct timeval values, implemented in the corresponding C file.

## Macro Definition Documentation

## ◆ timeval_isset

#define timeval_isset | ( |  | tv | ) |

Value:
((tv)->tv_sec || (tv)->tv_usec)

## ◆ timeval_clear

#define timeval_clear | ( |  | tv | ) |

Value:
((tv)->tv_sec = (tv)->tv_usec = 0)