From: Nick Mathewson Date: Thu, 17 Apr 2003 02:03:55 +0000 (+0000) Subject: Apply algebra; remove a condition X-Git-Tag: tor-0.0.2pre8~222 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=598c3069e15b23845aa1b15327429ce5cf925b66;p=thirdparty%2Ftor.git Apply algebra; remove a condition svn:r246 --- diff --git a/src/common/util.c b/src/common/util.c index 600a8e614d..e5e83532d7 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -30,10 +30,15 @@ tv_udiff(struct timeval *start, struct timeval *end) log(LOG_NOTICE, "tv_udiff(): comparing times too far apart."); return LONG_MAX; } + + /* + This is a no-op: "secdiff--" takes 1M from the final result, + and "end_usec+=100000L" puts it back. if (end_usec < start->tv_usec) { secdiff--; end_usec += 1000000L; } + */ udiff = secdiff*1000000L + (end_usec - start->tv_usec); if(udiff < 0) { log(LOG_NOTICE, "tv_udiff(): start is after end. Returning 0.");