int tv_diff(const struct timeval *b, const struct timeval *a,
struct timeval *diff);
long unsigned tv2ms(const struct timeval *tv);
-void d2tv(double x, struct timeval *tv);
void tv_add(const struct timeval *a, const struct timeval *b,
struct timeval *sum);
void tv_scale(const unsigned long mult, const struct timeval *tv,
tv->tv_usec = (n % 1000) * 1000;
}
-/**
- * Convert a double to a struct timeval.
- *
- * \param x The value to convert.
- * \param tv Result pointer.
- */
-void d2tv(double x, struct timeval *tv)
-{
- tv->tv_sec = x;
- tv->tv_usec = (x - (double)tv->tv_sec) * 1000.0 * 1000.0 + 0.5;
-}
-
/**
* Compute the difference of two time values.
*