UT_Timer.h
Go to the documentation of this file.
00001 
00003 //
00004 // definition of the class :  UT_Timer
00005 //
00006 // Copyright (c) Frank Althof, August 2000
00007 // slightly modified by Derik Schroeter
00008 // Lehrstuhl fuer Mensch-Maschine-Kommunikation
00009 // Technische Universitaet Muenchen
00010 // Arcisstrasse 21, D-80290 Muenchen
00011 //
00012 // Remarks :
00013 //     - partly based on old c code generated by Thorsten Bomberg
00014 //     - enhanced and adapted to c++ class
00015 //
00017 
00018 #ifndef _UT_TIMER_HH
00019 #define _UT_TIMER_HH
00020 
00021 /***************************   include   ************************************/
00022 #ifndef WIN32
00023 #include <unistd.h>
00024 #include <stdio.h>
00025 #include <time.h>
00026 #include <sys/types.h>
00027 #include <sys/times.h>
00028 #include <sys/time.h>
00029 
00030 /****************************************************************************/
00031 
00039 class UT_Timer
00040 {
00041  public :
00042   // --- constructors and destructor --------------------------------------
00043   UT_Timer( void );
00044   virtual ~UT_Timer( void ) {}
00045 
00046   // --- member functions -------------------------------------------------
00047 
00048   inline void start( void )  
00049          { gettimeofday(&tv_start, NULL); }
00050   double end( char *message=NULL );
00051   inline char* getDateTimeStr( void )
00052          { time_t t = time(NULL); return (ctime(&t)); }
00053 
00054  protected :
00055   struct timeval tv_start;
00056   struct timeval tv_end;
00057   long usecs;
00058   long secs;
00059   long ges_usecs;
00060 
00061   // clock tick measure originally by MarcL
00062   long    iClkTck;
00063   struct  tms currtime;
00064   struct  tms lasttime;
00065   struct  tms difftime;
00066 
00067   clock_t clock, start_clock;  
00068 };
00069 
00070 #endif
00071 #endif /*WIN32*/
00072 
00073 /*********************   END OF FILE *********************************/


lo
Author(s): U. Klank
autogenerated on Mon Oct 6 2014 10:44:15