summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XTimeProfiler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/XTimeProfiler.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/XTimeProfiler.cs53
1 files changed, 53 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/XTimeProfiler.cs b/Client/Assets/Scripts/XMainClient/XTimeProfiler.cs
new file mode 100644
index 00000000..de1faf83
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/XTimeProfiler.cs
@@ -0,0 +1,53 @@
+using System;
+
+namespace XMainClient
+{
+ internal class XTimeProfiler
+ {
+ private int _timeLimit;
+
+ private int _start;
+
+ private XTimeoutHandler _handler;
+
+ private static XTimeProfiler _Instance;
+
+ public static XTimeProfiler getLogProfiler(int timeLimit, string message)
+ {
+ bool flag = XTimeProfiler._Instance == null;
+ if (flag)
+ {
+ XTimeoutLogHandler handler = new XTimeoutLogHandler();
+ XTimeProfiler._Instance = new XTimeProfiler(timeLimit);
+ XTimeProfiler._Instance.SetHandler(handler);
+ }
+ else
+ {
+ XTimeProfiler._Instance._timeLimit = timeLimit;
+ }
+ (XTimeProfiler._Instance._handler as XTimeoutLogHandler).Message = message;
+ return XTimeProfiler._Instance;
+ }
+
+ public XTimeProfiler(int timeLimit)
+ {
+ this._timeLimit = timeLimit;
+ this._start = 0;
+ this._handler = null;
+ }
+
+ public void SetHandler(XTimeoutHandler handler)
+ {
+ this._handler = handler;
+ }
+
+ public void Begin()
+ {
+ this._start = Environment.TickCount;
+ }
+
+ public void End()
+ {
+ }
+ }
+}