// 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_Chronometer_HeaderFile #define _OSD_Chronometer_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_Macro_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _Standard_OStream_HeaderFile #include #endif //! This class measures CPU time (both user and system) consumed
//! by current process or thread. The chronometer can be started
//! and stopped multiple times, and measures cumulative time.
class 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); } //! Initializes a stopped Chronometer.
Standard_EXPORT OSD_Chronometer(const Standard_Boolean ThisThreadOnly = Standard_False); Standard_EXPORT virtual void Destroy() ; ~OSD_Chronometer() { Destroy(); } //! Stops and Reinitializes the Chronometer.
Standard_EXPORT virtual void Reset() ; //! Stops the Chronometer.
Standard_EXPORT virtual void Stop() ; //! Starts (after Create or Reset) or restarts (after Stop)
//! the chronometer.
Standard_EXPORT virtual void Start() ; //! Shows the current CPU user and system time on the
//! standard output stream .
//! The chronometer can be running (laps Time) or stopped.
Standard_EXPORT virtual void Show() ; //! Shows the current CPU user and system time on the output
//! stream .
//! The chronometer can be running (laps Time) or stopped.
Standard_EXPORT virtual void Show(Standard_OStream& os) ; //! Returns the current CPU user time in a variable.
//! The chronometer can be running (laps Time) or stopped.
Standard_EXPORT void Show(Standard_Real& UserSeconds) ; //! Returns the current CPU user and system time in variables.
//! The chronometer can be running (laps Time) or stopped.
Standard_EXPORT void Show(Standard_Real& UserSeconds,Standard_Real& SystemSeconds) ; //! Returns CPU time (user and system) consumed by the current
//! process since its start, in seconds. The actual precision of
//! the measurement depends on granularity provided by the system,
//! and is platform-specific.
Standard_EXPORT static void GetProcessCPU(Standard_Real& UserSeconds,Standard_Real& SystemSeconds) ; //! Returns CPU time (user and system) consumed by the current
//! thread since its start. Note that this measurement is
//! platform-specific, as threads are implemented and managed
//! differently on different platforms and CPUs.
Standard_EXPORT static void GetThreadCPU(Standard_Real& UserSeconds,Standard_Real& SystemSeconds) ; protected: Standard_Boolean Stopped; private: Standard_Boolean ThreadOnly; Standard_Real Start_user; Standard_Real Start_sys; Standard_Real Cumul_user; Standard_Real Cumul_sys; }; // other Inline functions and methods (like "C++: function call" methods) #endif