gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14919 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r14919 - gnunet/src/util
Date: Thu, 7 Apr 2011 18:07:47 +0200

Author: nevans
Date: 2011-04-07 18:07:47 +0200 (Thu, 07 Apr 2011)
New Revision: 14919

Modified:
   gnunet/src/util/time.c
Log:
I finally figured out why this function was so unintuitive to me.  Hence 
indicates a time in the future, and this function operates on a time in the 
past.  

Modified: gnunet/src/util/time.c
===================================================================
--- gnunet/src/util/time.c      2011-04-07 15:18:48 UTC (rev 14918)
+++ gnunet/src/util/time.c      2011-04-07 16:07:47 UTC (rev 14919)
@@ -227,21 +227,21 @@
 
 /**
  * Get the duration of an operation as the
- * difference of the current time and the given start time "hence".
+ * difference of the current time and the given start time "whence".
  *
- * @return aborts if hence==FOREVER, 0 if hence > now, otherwise now-hence.
+ * @return aborts if whence==FOREVER, 0 if whence > now, otherwise now-whence.
  */
 struct GNUNET_TIME_Relative
-GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute hence)
+GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence)
 {
   struct GNUNET_TIME_Absolute now;
   struct GNUNET_TIME_Relative ret;
 
   now = GNUNET_TIME_absolute_get ();
-  GNUNET_assert (hence.abs_value != UINT64_MAX);
-  if (hence.abs_value > now.abs_value)
+  GNUNET_assert (whence.abs_value != UINT64_MAX);
+  if (whence.abs_value > now.abs_value)
     return GNUNET_TIME_relative_get_zero ();
-  ret.rel_value = now.abs_value - hence.abs_value;
+  ret.rel_value = now.abs_value - whence.abs_value;
   return ret;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]