Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   Related Pages   Examples  

Timer.h

00001 /* Copyright (c) 2001 C. Grigorescu */
00002 #ifndef _TIMER_H_
00003 #define _TIMER_H_
00004 
00005 #include <sys/time.h>
00006 #include <unistd.h>
00007 
00011 class Timer
00012 {
00013  private:
00014   int   running;
00015   int   seconds;
00016   int   microseconds;
00017   timeval start;
00018   timeval stop;
00019 
00020  public:
00022   Timer::Timer() {
00023     running = 0;
00024     seconds = 0;
00025     microseconds = 0;
00026   }                 
00027 
00029   void  Start();
00030 
00032   void  Stop();
00033 
00035   float getTime();
00036 
00038   void  Print();
00039 
00042   void  Tick();
00043 };
00044 
00047 #endif