Changeset 3638 in Sophya
- Timestamp:
- May 26, 2009, 11:39:55 PM (16 years ago)
- Location:
- trunk/SophyaLib/SysTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SysTools/ctimer.cc
r3636 r3638 1 1 // 2 // $Id: ctimer.cc,v 1. 9 2009-05-26 20:24:23ansari Exp $2 // $Id: ctimer.cc,v 1.10 2009-05-26 21:39:54 ansari Exp $ 3 3 // 4 4 … … 46 46 47 47 namespace SOPHYA { 48 //! Default constructor with optional default print flag 49 Timer::Timer(bool prfg) 50 : defprtflg(prfg) 51 { 52 cpu0 = cpuSplit = clock(); 53 gettimeofday(&elapse0, NULL); 54 elapseSplit = elapse0; 55 // elapse0 = elapseSplit = time(0); 56 cpuSecT = cpuSecP = 0.; 57 elapSecT = elapSecP = 0; 58 } 48 59 /*! 49 \brief Constructor with the specification of a optionalname or message50 and default print flag.60 \brief Constructor with the specification of a name or message 61 and optional default print flag. 51 62 if \b prfg==true , a call to Split() causes the display of partial and 52 63 total CPU and elapsed time. 53 64 */ 54 65 Timer::Timer(const char* name, bool prfg) 55 : timerName( name) , defprtflg(prfg)66 : timerName(((name!=NULL)?name:"")) , defprtflg(prfg) 56 67 { 57 68 cpu0 = cpuSplit = clock(); -
trunk/SophyaLib/SysTools/ctimer.h
r3636 r3638 1 1 // This may look like C code, but it is really -*- C++ -*- 2 2 // 3 // $Id: ctimer.h,v 1. 7 2009-05-26 20:24:24ansari Exp $3 // $Id: ctimer.h,v 1.8 2009-05-26 21:39:55 ansari Exp $ 4 4 // 5 5 … … 27 27 class Timer { 28 28 public: 29 Timer(bool prfg=true); 29 30 // L'objet memorise le temps CPU et l'heure, et le nom donne 30 Timer(const char* name =0, bool prfg=true);31 Timer(const char* name, bool prfg=true); 31 32 32 33 // Le destructeur appelle split sans parametre.
Note:
See TracChangeset
for help on using the changeset viewer.