11 /*----------------------------------------------------------------------*\
13 \*---------------------------------------------------------------------*/
15 /*--------------------------------------*\
17 \*-------------------------------------*/
29 /*--------------------------------------*\
31 \*-------------------------------------*/
35 // cout << "Chronos : start" << endl;
43 double Chronos::stop()
45 //cout << "Chronos : stop" << endl;
50 deltaTime
= timeStop
- timeStart
;
55 double Chronos::getDeltaTime() const
59 cout
<< "Chronos : Warning : Stop chrono befor, or use methode timeFlight() instead!" << endl
;
68 double Chronos::timeFlight() const
70 return time() - timeStart
;
73 void Chronos::print(const string
& titre
) const
78 void Chronos::print(ostream
& stream
, const string
& titre
) const
89 stream
<< titre
<< " " << dt
<< " (s)" << endl
;
92 double Chronos::time()
94 // return time(NULL); // #include <time.h> time(NULL) est time_t
95 // Problem : Sous linux : compte en seconde!
97 return omp_get_wtime(); //#include <omp.h>
100 /*--------------------------------------*\
102 \*-------------------------------------*/
104 ostream
& operator <<(ostream
& stream
, const Chronos
& chrono
) // friend
106 chrono
.print(stream
);
110 /*----------------------------------------------------------------------*\
112 \*---------------------------------------------------------------------*/