// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _OSD_Timer_HeaderFile #define _OSD_Timer_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_Macro_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _OSD_Chronometer_HeaderFile #include #endif #ifndef _Standard_OStream_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif //! Working on heterogeneous platforms
//! we need to use the system call gettimeofday.
//! This function is portable and it measures ELAPSED
//! time and CPU time in seconds and microseconds.
//! Example: OSD_Timer aTimer;
//! aTimer.Start(); // Start the timers (t1).
//! ..... // Do something.
//! aTimer.Stop(); // Stop the timers (t2).
//! aTimer.Show(); // Give the elapsed time between t1 and t2.
//! // Give also the process CPU time between
//! // t1 and t2.
class OSD_Timer : public OSD_Chronometer { public: void* operator new(size_t,void* anAddress) { return anAddress; } void* operator new(size_t size) { return Standard::Allocate(size); } void operator delete(void *anAddress) { if (anAddress) Standard::Free((Standard_Address&)anAddress); } //! Builds a Chronometer initialized and stopped.
Standard_EXPORT OSD_Timer(); //! Stops and reinitializes the timer.
Standard_EXPORT virtual void Reset() ; //! Shows both the elapsed time and CPU time on the standard output
//! stream .The chronometer can be running (Lap Time) or
//! stopped.
Standard_EXPORT virtual void Show() ; //! Shows both the elapsed time and CPU time on the
//! output stream .
Standard_EXPORT virtual void Show(Standard_OStream& os) ; //! returns both the elapsed time(seconds,minutes,hours)
//! and CPU time.
Standard_EXPORT void Show(Standard_Real& seconds,Standard_Integer& minutes,Standard_Integer& hours,Standard_Real& CPUtime) ; //! Stops the Timer.
Standard_EXPORT virtual void Stop() ; //! Starts (after Create or Reset) or restarts (after Stop)
//! the Timer.
Standard_EXPORT virtual void Start() ; protected: private: Standard_Real TimeStart; Standard_Real TimeCumul; }; // other Inline functions and methods (like "C++: function call" methods) #endif