aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-04-17 02:03:55 +0000
committerNick Mathewson <nickm@torproject.org>2003-04-17 02:03:55 +0000
commit598c3069e15b23845aa1b15327429ce5cf925b66 (patch)
tree83ee766d6b4b29a3bcd070f7bce261555b851731 /src/common/util.c
parent2da6482f639871784b445187347314e8d026bdb1 (diff)
downloadtor-598c3069e15b23845aa1b15327429ce5cf925b66.tar.gz
tor-598c3069e15b23845aa1b15327429ce5cf925b66.zip
Apply algebra; remove a condition
svn:r246
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c5
1 files changed, 5 insertions, 0 deletions
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.");