1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 //=======================================================================
19 //function : MoniTool_Timer
21 //=======================================================================
23 inline MoniTool_Timer::MoniTool_Timer() : myCount(0), myNesting(0), myAmend(0)
27 //=======================================================================
30 //=======================================================================
32 inline OSD_Timer& MoniTool_Timer::Timer()
37 //=======================================================================
40 //=======================================================================
42 inline const OSD_Timer& MoniTool_Timer::Timer() const
47 //=======================================================================
50 //=======================================================================
52 inline void MoniTool_Timer::Start()
55 if ( ! myNesting ) myTimer.Start();
60 //=======================================================================
63 //=======================================================================
65 inline void MoniTool_Timer::Stop()
68 if ( ! myNesting ) myTimer.Stop();
72 //=======================================================================
75 //=======================================================================
77 inline void MoniTool_Timer::Reset()
80 myCount = myNesting = 0;
84 //=======================================================================
87 //=======================================================================
89 inline Standard_Integer MoniTool_Timer::Count() const
94 //=======================================================================
95 //function : IsRunning
97 //=======================================================================
99 inline Standard_Integer MoniTool_Timer::IsRunning() const
104 //=======================================================================
107 //=======================================================================
109 inline Standard_Real MoniTool_Timer::Amend() const
114 //=======================================================================
117 //=======================================================================
119 inline Standard_Real MoniTool_Timer::CPU()
121 Standard_Integer minutes, hours;
122 Standard_Real seconds, cpu;
123 myTimer.Show(seconds,minutes,hours,cpu);
124 return cpu - myAmend;
127 //=======================================================================
130 //=======================================================================
132 inline void MoniTool_Timer::Start(const Standard_CString name)
134 Timer(name)->Start();
137 //=======================================================================
140 //=======================================================================
142 inline void MoniTool_Timer::Stop(const Standard_CString name)