X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fheader%2FChronos.h;fp=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fheader%2FChronos.h;h=b740e9b6d578850dc9aa8f7c52868d156984c04f;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_CPP/src/core/tools/header/Chronos.h b/WCudaMSE/BilatTools_CPP/src/core/tools/header/Chronos.h new file mode 100755 index 0000000..b740e9b --- /dev/null +++ b/WCudaMSE/BilatTools_CPP/src/core/tools/header/Chronos.h @@ -0,0 +1,60 @@ +#ifndef CHRONOS_H +#define CHRONOS_H + +#include + +using std::string; +using std::ostream; + +class Chronos + { + public: + + /*--------------------------------------*\ + |* Constructor *| + \*-------------------------------------*/ + + Chronos(); + + /*--------------------------------------*\ + |* Destructor *| + \*-------------------------------------*/ + + virtual ~Chronos(); + + /*--------------------------------------*\ + |* Methodes *| + \*-------------------------------------*/ + + void start(); + double stop(); + double timeFlight() const; + double getDeltaTime() const; + void print(const string& titre = "") const; + void print(ostream& stream, const string& titre = "") const; + + /*--------------------------------------*\ + |* Friend *| + \*-------------------------------------*/ + + friend ostream& operator <<(ostream& stream, const Chronos& chrono); + + private: + + /*--------------------------------------*\ + |* Methodes *| + \*-------------------------------------*/ + + static double time(); + + /*--------------------------------------*\ + |* Attributs *| + \*-------------------------------------*/ + + double timeStart; + double timeStop; + double deltaTime; + bool isRunning; + }; + +#endif