summaryrefslogtreecommitdiff
path: root/utils/Time.cc
diff options
context:
space:
mode:
Diffstat (limited to 'utils/Time.cc')
-rw-r--r--utils/Time.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/utils/Time.cc b/utils/Time.cc
index 3e57a3c..ced0df5 100644
--- a/utils/Time.cc
+++ b/utils/Time.cc
@@ -16,24 +16,24 @@
#include <sys/time.h>
//extern "C" int gettimeofday (struct timeval *, struct timezone *);
-/*?class CcuTimeStamp
-The class \var{CcuTimeStamp} provides variables that can be manipulated as
+/*?class IvlTimeStamp
+The class \var{IvlTimeStamp} provides variables that can be manipulated as
integers, but whose initial value is set according to the current time.
The following example should be self-explanatory:
\begin{ccode}
- CcuTimeStamp before;
+ IvlTimeStamp before;
long_task ();
- CcuTimeStamp after;
+ IvlTimeStamp after;
Millisecond delay = after - before;
\end{ccode}
-The values of \typ{CcuTimeStamp}s are expressed in milliseconds.
+The values of \typ{IvlTimeStamp}s are expressed in milliseconds.
The type \typ{Millisecond} is currently defined as \typ{long int}.
?*/
/*?
Create a time stamp. Its value is set according to the current time.
?*/
-CcuTimeStamp :: CcuTimeStamp ()
+IvlTimeStamp :: IvlTimeStamp ()
{
struct timeval tv;
gettimeofday (&tv, 0);
@@ -44,53 +44,53 @@ CcuTimeStamp :: CcuTimeStamp ()
/*?
Get the value of a time stamp.
?*/
-CcuTimeStamp :: operator Millisecond () const
+IvlTimeStamp :: operator Millisecond () const
{
}
#endif /* DOC */
const char*
-CcuTimeStamp :: AsString () const
+IvlTimeStamp :: AsString () const
{
time_t t = Value / 1000;
return ctime (&t);
}
-/*?class CcuTime
-The class \typ{CcuTime} provides a simple way of manipulating real-time. Objects
+/*?class IvlTime
+The class \typ{IvlTime} provides a simple way of manipulating real-time. Objects
of this class are used like integer variables whose value would change with time.
That behavior is obtained through the redefinition of the operator yielding the
integer value.
Time values are expressed with the type \typ{Millisecond}, which is currently implemented
-as \typ{long int}. You may initialize a \typ{CcuTime} with a negative value.
+as \typ{long int}. You may initialize a \typ{IvlTime} with a negative value.
?*/
/*?
Initialize a time variable with initial value \var{t}.
?*/
-CcuTime :: CcuTime (Millisecond t)
+IvlTime :: IvlTime (Millisecond t)
{
- CcuTimeStamp now;
+ IvlTimeStamp now;
Offset = now - t;
}
/*?
Get the current value of a time variable.
?*/
-CcuTime :: operator Millisecond () const
+IvlTime :: operator Millisecond () const
{
- CcuTimeStamp now;
+ IvlTimeStamp now;
return now - Offset;
}
/*?
Reinitialize a time variable to the value \var{t}.
?*/
-CcuTime&
-CcuTime :: operator = (Millisecond t)
+IvlTime&
+IvlTime :: operator = (Millisecond t)
{
- CcuTimeStamp now;
+ IvlTimeStamp now;
Offset = now - t;
return *this;
}