Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

clocker.h

00001 //FILE:         clocker.h
00002 //AUTHOR:       Nathan Cournia <nathan@cournia.com>
00003 //\todo HAVE_SDL check should be replaced with a WIN32 check and an SDL check to allow for nonr-SDL backends on WIN32.
00004 
00005 #ifndef COURNIA_CLOCKER_H
00006 #define COURNIA_CLOCKER_H 1
00007 
00008 #include "config.h"
00009 
00010 #ifdef HAVE_SDL
00011 #include "SDL.h"
00012 #else
00013 #include <sys/time.h>
00014 #endif
00015 
00017 
00021 class clocker
00022 {
00023 private:
00024 #ifdef HAVE_SDL
00025         Uint32 last;
00026 #else
00027         struct timeval *clock;
00028         struct timeval *now;
00029 #endif
00030         double m_elapsed;
00031 
00032         //don't let the compiler generate this methods
00033         clocker( const clocker &cpy );
00034         clocker& operator= ( clocker &rhs );
00035 
00036 public:
00038         clocker( void );
00039         
00041         ~clocker( void );
00042         
00044 
00047         void reset( void );
00048         
00050 
00054         void update( void );
00055         
00056         
00058         inline double elapsed( ) const {
00059                 return m_elapsed;
00060         }
00061 };
00062 
00063 #endif

Generated on Tue Feb 11 18:49:40 2003 for uber by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002