unbound 0.1
timeval_func.c File Reference

This file contains helpers to manipulate struct timeval values. More...

#include "config.h"
#include "timeval_func.h"

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 helpers to manipulate struct timeval values.

Function Documentation

◆ timeval_subtract()

void timeval_subtract ( struct timeval * d,
const struct timeval * end,
const struct timeval * start )

◆ timeval_add()

void timeval_add ( struct timeval * d,
const struct timeval * add )

add timers and the values do not overflow or become negative

References timeval_add().

Referenced by comm_timer_set(), mesh_send_reply(), time_passes(), and timeval_add().

◆ timeval_divide()

void timeval_divide ( struct timeval * avg,
const struct timeval * sum,
long long d )

divide sum of timers to get average

References timeval_divide().

Referenced by mesh_stats(), print_stats(), and timeval_divide().

◆ timeval_smaller()

int timeval_smaller ( const struct timeval * x,
const struct timeval * y )

histogram compare of time values

References timeval_smaller().

Referenced by first_timer(), mesh_make_new_space(), replay_get_oldest_timer(), timehist_insert(), and timeval_smaller().