/* Returns: time difference in number of microseconds. For too large diffs it returns max value.  */
timediff_t Curl_timediff_us(struct curltime newer, struct curltime older)
/* Returns: time difference in number of microseconds. For too large diffs it returns max value.  */
timediff_t Curl_timediff_us(struct curltime newer, struct curltime older)
{
  timediff_t diff = (timediff_t)newer.tv_sec-older.tv_sec;
  if(diff >= (TIME_MAX/1000000))
    return TIME_MAX;
  else if(diff <= (TIME_MIN/1000000))
    return TIME_MIN;
  return diff * 1000000 + newer.tv_usec-older.tv_usec;
}