File indexing completed on 2025-01-18 10:04:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _MoniTool_Timer_HeaderFile
0017 #define _MoniTool_Timer_HeaderFile
0018
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021
0022 #include <OSD_Timer.hxx>
0023 #include <Standard_Integer.hxx>
0024 #include <Standard_Transient.hxx>
0025 #include <Standard_OStream.hxx>
0026 #include <Standard_CString.hxx>
0027 #include <MoniTool_DataMapOfTimer.hxx>
0028
0029
0030 class MoniTool_Timer;
0031 DEFINE_STANDARD_HANDLE(MoniTool_Timer, Standard_Transient)
0032
0033
0034
0035
0036
0037
0038
0039
0040 class MoniTool_Timer : public Standard_Transient
0041 {
0042
0043 public:
0044
0045
0046
0047 MoniTool_Timer();
0048
0049 const OSD_Timer& Timer() const;
0050
0051
0052 OSD_Timer& Timer();
0053
0054 void Start();
0055
0056 void Stop();
0057
0058
0059
0060
0061 void Reset();
0062
0063
0064 Standard_Integer Count() const;
0065
0066
0067 Standard_Integer IsRunning() const;
0068
0069
0070 Standard_Real CPU();
0071
0072
0073 Standard_Real Amend() const;
0074
0075
0076 Standard_EXPORT void Dump (Standard_OStream& ostr);
0077
0078
0079
0080 Standard_EXPORT static Handle(MoniTool_Timer) Timer (const Standard_CString name);
0081
0082 static void Start (const Standard_CString name);
0083
0084
0085
0086 static void Stop (const Standard_CString name);
0087
0088
0089 Standard_EXPORT static MoniTool_DataMapOfTimer& Dictionary();
0090
0091
0092 Standard_EXPORT static void ClearTimers();
0093
0094
0095 Standard_EXPORT static void DumpTimers (Standard_OStream& ostr);
0096
0097
0098
0099
0100 Standard_EXPORT static void ComputeAmendments();
0101
0102
0103 Standard_EXPORT static void GetAmendments (Standard_Real& Access, Standard_Real& Internal, Standard_Real& External, Standard_Real& Error10);
0104
0105
0106
0107
0108 DEFINE_STANDARD_RTTIEXT(MoniTool_Timer,Standard_Transient)
0109
0110 protected:
0111
0112
0113
0114
0115 private:
0116
0117
0118 Standard_EXPORT static void AmendAccess();
0119
0120 Standard_EXPORT void AmendStart();
0121
0122
0123
0124 Standard_EXPORT void AmendStop();
0125
0126 OSD_Timer myTimer;
0127 Standard_Integer myCount;
0128 Standard_Integer myNesting;
0129 Standard_Real myAmend;
0130 Handle(MoniTool_Timer) myPrev;
0131 Handle(MoniTool_Timer) myNext;
0132
0133
0134 };
0135
0136
0137 #include <MoniTool_Timer.lxx>
0138
0139
0140
0141
0142
0143 #endif