terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
MultiTimer.cs
Go to the documentation of this file.
1using System;
4
5namespace ReLogic.Utilities
6{
7 // Token: 0x02000B03 RID: 2819
8 public class MultiTimer
9 {
10 // Token: 0x0600527B RID: 21115 RVA: 0x00282F9C File Offset: 0x0028119C
15
16 // Token: 0x0600527C RID: 21116 RVA: 0x00282FB8 File Offset: 0x002811B8
17 public void Start()
18 {
19 this._timer.Reset();
20 this._timer.Start();
21 }
22
23 // Token: 0x0600527D RID: 21117 RVA: 0x00282FDC File Offset: 0x002811DC
31
32 // Token: 0x0600527E RID: 21118 RVA: 0x0028302C File Offset: 0x0028122C
33 public bool StopAndPrint()
34 {
35 this._timer.Stop();
37 Stopwatch timer = this._timer;
39 Console.WriteLine("Average elapsed time: ");
41 if (ticksBetweenPrint == 0)
42 {
43 }
44 string text;
45 if (text == null || text != null)
46 {
47 if (" : (Average: " != null && " : (Average: " == null)
48 {
50 }
51 string text2;
52 if (text2 != null && text2 == null)
53 {
55 }
56 if (" Min: " != null && " Min: " == null)
57 {
59 }
60 string text3;
61 if (text3 != null && text3 == null)
62 {
64 }
65 if (" Max: " != null && " Max: " == null)
66 {
68 }
69 string text4;
70 if (text4 != null && text4 == null)
71 {
73 }
74 if (" from " != null && " from " == null)
75 {
77 }
78 string text5;
79 if (text5 != null && text5 == null)
80 {
82 }
83 if (" records)" != null && " records)" == null)
84 {
86 }
87 string text6;
89 string text8;
90 string text7 = "Total : " + text8 + "ms";
91 if ("ms" == null)
92 {
93 }
95 }
97 }
98
99 // Token: 0x04008AC3 RID: 35523
101
102 // Token: 0x04008AC4 RID: 35524
104
105 // Token: 0x04008AC5 RID: 35525
107
108 // Token: 0x04008AC6 RID: 35526
110
111 // Token: 0x02000B04 RID: 2820
112 private struct TimerData
113 {
114 // Token: 0x170008DF RID: 2271
115 // (get) Token: 0x0600527F RID: 21119 RVA: 0x00283188 File Offset: 0x00281388
116 public double Average
117 {
118 get
119 {
120 /*
121An exception occurred when decompiling this method (0600527F)
122
123ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Double ReLogic.Utilities.MultiTimer/TimerData::get_Average()
124
125 ---> System.Exception: Basic block has to end with unconditional control flow.
126{
127 Block_0:
128 stloc:float64(var_0_06, ldfld:float64(TimerData::Ticks, ldloc:valuetype ReLogic.Utilities.MultiTimer/TimerData&(this)))
129}
130
131 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
132 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
133 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
134 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
135 --- End of inner exception stack trace ---
136 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
137 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
138*/;
139 }
140 }
141
142 // Token: 0x06005280 RID: 21120 RVA: 0x0028319C File Offset: 0x0028139C
143 private TimerData(double min, double max, double ticks, double total)
144 {
145 this.Min = min;
146 this.Ticks = ticks;
147 }
148
149 // Token: 0x06005281 RID: 21121 RVA: 0x002831B8 File Offset: 0x002813B8
150 public TimerData(double startTime)
151 {
154 }
155
156 // Token: 0x06005282 RID: 21122 RVA: 0x002831D4 File Offset: 0x002813D4
157 public MultiTimer.TimerData AddTick(double time)
158 {
159 if (!true)
160 {
161 }
162 double max = this.Max;
163 double num = Math.Max(max, time);
164 double ticks = this.Ticks;
165 return 1;
166 }
167
168 // Token: 0x04008AC7 RID: 35527
169 public readonly double Min;
170
171 // Token: 0x04008AC8 RID: 35528
172 public readonly double Max;
173
174 // Token: 0x04008AC9 RID: 35529
175 public readonly double Ticks;
176
177 // Token: 0x04008ACA RID: 35530
178 public readonly double Total;
179 }
180 }
181}
class f__AnonymousType0<< Count > j__TPar
void Record(string key)
Definition MultiTimer.cs:24
MultiTimer(int ticksBetweenPrint=100)
Definition MultiTimer.cs:11
readonly Stopwatch _timer
readonly Dictionary< string, MultiTimer.TimerData > _timerDataMap
static void WriteLine(object value)
Definition Console.cs:134
static byte Max(byte val1, byte val2)
Definition Math.cs:111
TimerData(double min, double max, double ticks, double total)
MultiTimer.TimerData AddTick(double time)
double TotalMilliseconds
Definition TimeSpan.cs:117