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

CTBtraceClock.hxx

Go to the documentation of this file.
00001 #ifndef _CTBtraceClock_HXX
00002 #define _CTBtraceClock_HXX 1
00003 
00008 /*----------------------------------------------------------------------------*/
00009 /* C Tool Box: Designed and implemented by:                                   */
00010 /*    Walter F.J. Mueller   Gesellschaft fuer Schwerionenforschung (GSI)      */
00011 /*                          Planckstrasse 1, D-64291 Darmstadt, Germany       */
00012 /*                  Email:  W.F.J.Mueller@gsi.de                              */
00013 /*                  WWW:    http://www-kp3.gsi.de/www/kp3/people/mueller.html */
00014 /*------------------------------------------+---------------------------------*/
00015 
00016 class CTBtraceClock {
00017 
00018   public:
00019                     CTBtraceClock();
00020                     CTBtraceClock(const char* c_text,
00021                                   bool b_start = false, bool b_print = false);
00022 
00023                     ~CTBtraceClock();
00024 
00025     void            Start();
00026     void            Stop();
00027     void            Reset();
00028     bool            IsStarted() const;
00029     double          CpuTime();
00030     double          ElapsedTime();
00031     CTBint          NInterval();
00032     void            ToStream(ostream& os = cout);
00033 
00034   private:
00035 
00036     enum {
00037       e_cputime = 0x1,                      
00038       e_elatime = 0x2                       
00039     };
00040     void            Init(const char* c_text,
00041                       bool b_start = false, bool b_print = false);
00042     void            Update(int i_flags);
00043     
00044   private:
00045     const char*     mc_text;                
00046     bool            mb_started;             
00047     bool            mb_autoprint;           
00048     double          md_cputime;             
00049     double          md_elatime;             
00050     double          md_cpustart;            
00051     double          md_elastart;            
00052     CTBint          mi_intervals;           
00053 
00054 };
00055 
00056     ostream&        operator<<(ostream& os, CTBtraceClock& obj);
00057 
00058 
00059 #if !(defined(CTB__OutLine) || defined(CTBtraceClock__OutLine))
00060 #include "CTBtraceClock.icc"
00061 #endif
00062 
00063 #endif

Generated at Fri Oct 24 18:11:30 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001