Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

ExCTime Class Reference

#include <ExCTime.h>


Public Methods

 ExCTime ()
bool start (float)
bool stop (void)
bool startBlock (float)
bool isTimePassed (float)
bool isFinished (void)

Private Attributes

time_t _real_t0
time_t _real_t1
float _long_t


Constructor & Destructor Documentation

ExCTime  
 

Definition at line 26 of file ExCTime.cpp.

References _long_t.

00026                   {
00027         _long_t = -1;
00028 }


Member Function Documentation

bool isFinished void   
 

Definition at line 73 of file ExCTime.cpp.

References _long_t, and _real_t0.

00073                               {
00074         time_t t1 = time (NULL);
00075         if (difftime (t1, _real_t0) >= _long_t) return true;
00076         else return false;
00077 }

bool isTimePassed float   
 

Definition at line 67 of file ExCTime.cpp.

References _long_t, and _real_t0.

00067                                         {
00068         time_t t1 = time (NULL);
00069         if (difftime (t1, _real_t0) >= _long_t) return true;
00070         else return false;
00071 }

bool start float   
 

Definition at line 30 of file ExCTime.cpp.

References _long_t, and _real_t0.

00030                                  {
00031         if (long_t <= 0) return false;
00032         else {
00033                 _long_t = long_t;
00034 #ifdef UNIX_SRC
00035                 _start = clock ();
00036 #endif
00037                 _real_t0 = time (NULL);
00038                 return true;
00039         }
00040 }

bool startBlock float   
 

Definition at line 42 of file ExCTime.cpp.

References _long_t, and _real_t0.

00042                                       {
00043         if (long_t < 0) return false;
00044         else if (long_t == 0) return true;
00045         else {
00046                 _long_t = long_t;
00047 #ifdef UNIX_SRC
00048                 _start = clock ();
00049 #endif
00050                 _real_t0 = time (NULL);
00051                 time_t t1;
00052                 do {
00053                         t1 = time (NULL);
00054                 } while (difftime (t1, _real_t0) < _long_t);
00055                 return true;
00056         }
00057 }

bool stop void   
 

Definition at line 59 of file ExCTime.cpp.

References _real_t1.

00059                         {
00060 #ifdef UNIX_SRC
00061         _finish = clock ();
00062 #endif
00063         _real_t1 = time (NULL);
00064         return true;
00065 }


Field Documentation

float _long_t [private]
 

Definition at line 39 of file ExCTime.h.

Referenced by ExCTime(), isFinished(), isTimePassed(), start(), and startBlock().

time_t _real_t0 [private]
 

Definition at line 38 of file ExCTime.h.

Referenced by isFinished(), isTimePassed(), start(), and startBlock().

time_t _real_t1 [private]
 

Definition at line 38 of file ExCTime.h.

Referenced by stop().


The documentation for this class was generated from the following files:
Generated on Tue Aug 6 20:27:23 2002 for ExNihilo by doxygen1.2.17