/home/orm/Projects/moji/src/Timer.h

00001 
00002 #ifndef TIMER_H
00003 #define TIMER_H
00004 
00005 #include <boost/date_time/posix_time/posix_time.hpp>
00006 #include <angelscript.h>
00007 
00016 class Timer
00017 {
00018     bool m_started;
00019     int m_ref_count;
00020 
00021     boost::posix_time::ptime m_start_time;
00022     boost::posix_time::ptime m_stop_time;
00023 
00024     boost::posix_time::ptime GetLocalTime();
00025 
00026 public:
00027     Timer();
00028 
00034     void Start();
00035 
00041     inline bool IsRunning(){return m_started;}
00042 
00048     void Stop();
00049 
00055     void Reset();
00056 
00063     float Elapsed();
00064 
00065     // Not exposed, ignored by doxygen.
00067     void AddRef();
00068     void Release();
00069     static void Register(asIScriptEngine* e);
00071 };
00072 
00075 #endif
00076 
 All Data Structures Functions