Пример #1
0
/* Subtract b from a. */
struct timeval
timeval_subtract(struct timeval a, struct timeval b) {
  struct timeval val;

  val.tv_usec = a.tv_usec - b.tv_usec;
  val.tv_sec = a.tv_sec - b.tv_sec;

  return timeval_adjust (val);
}
Пример #2
0
struct pal_timeval
timeval_subtract (struct pal_timeval a, struct pal_timeval b)
{
  struct pal_timeval ret;

  ret.tv_usec = a.tv_usec - b.tv_usec;
  ret.tv_sec = a.tv_sec - b.tv_sec;

  return timeval_adjust (ret);
}