Changeset 895 in Sophya for trunk/SophyaLib/SysTools/ctimer.cc
- Timestamp:
- Apr 12, 2000, 7:49:54 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SysTools/ctimer.cc
r241 r895 1 1 // 2 // $Id: ctimer.cc,v 1. 2 1999-04-21 13:11:59ansari Exp $2 // $Id: ctimer.cc,v 1.3 2000-04-12 17:49:40 ansari Exp $ 3 3 // 4 4 … … 8 8 //++ 9 9 // Class Timer 10 // Lib Outils++10 // Lib SysTools 11 11 // include ctimer.h 12 12 // … … 37 37 //-- 38 38 39 /*! 40 \class SOPHYA::Timer 41 This class implements a simple chronometer which can be used for 42 measuring the CPU and elapsed time in functions. The constructor 43 keeps the start time (and CPU time) and an optional message. 44 The \b Split method displays the partial time, and destructor 45 displays the total CPU and elapsed time since timer creation. 46 The macro \b TIMEF create a timer object with the function name. 47 The macro \b SPLITTIME calls the split methode for the timer created 48 by TIMEF. A named timer can be created using the macro \b TIMEN(nom) 49 */ 50 51 /*! Constructor with the specification of a optional name or message */ 39 52 Timer::Timer(const char* name) 40 53 : timerName(name) … … 53 66 //-- 54 67 55 68 /*! Method which displays the partial CPU and elapsed time 69 An optional message can be passed to be used instead of the 70 timer name 71 */ 56 72 void Timer::Split(const char* comm) 57 73 { … … 65 81 int etmt = elapse - elapse0; 66 82 67 cout << "***Timing " << (comm ? comm : timerName ) << endl;83 cout << "***Timing " << (comm ? comm : timerName.c_str()) << endl; 68 84 69 85 // Pour des formats comme ca, la syntaxe printf est plus agreable.
Note:
See TracChangeset
for help on using the changeset viewer.