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 Terraria.Utilities
6{
7 // Token: 0x020004FB RID: 1275
8 public class MultiTimer
9 {
10 // Token: 0x060030E8 RID: 12520 RVA: 0x001F722C File Offset: 0x001F542C
11 public MultiTimer()
12 {
13 }
14
15 // Token: 0x060030E9 RID: 12521 RVA: 0x001F7248 File Offset: 0x001F5448
20
21 // Token: 0x060030EA RID: 12522 RVA: 0x001F726C File Offset: 0x001F546C
22 public void Start()
23 {
24 this._timer.Reset();
25 this._timer.Start();
26 }
27
28 // Token: 0x060030EB RID: 12523 RVA: 0x001F7290 File Offset: 0x001F5490
35
36 // Token: 0x060030EC RID: 12524 RVA: 0x001F72C8 File Offset: 0x001F54C8
37 public bool StopAndPrint()
38 {
40 Stopwatch timer = this._timer;
42 Console.WriteLine("Average elapsed time: ");
44 if (ticksBetweenPrint == 0)
45 {
46 }
47 string text;
48 if (text == null || text != null)
49 {
50 if (" : (Average: " != null && " : (Average: " == null)
51 {
53 }
54 string text2;
55 if (text2 != null && text2 == null)
56 {
58 }
59 if (" Min: " != null && " Min: " == null)
60 {
62 }
63 string text3;
64 if (text3 != null && text3 == null)
65 {
67 }
68 if (" Max: " != null && " Max: " == null)
69 {
71 }
72 string text4;
73 if (text4 != null && text4 == null)
74 {
76 }
77 if (" from " != null && " from " == null)
78 {
80 }
81 string text5;
82 if (text5 != null && text5 == null)
83 {
85 }
86 if (" records)" != null && " records)" == null)
87 {
89 }
90 string text6;
92 string text8;
93 string text7 = "Total : " + text8 + "ms";
94 if ("ms" == null)
95 {
96 }
98 }
100 }
101
102 // Token: 0x04003ACF RID: 15055
103 private int _ticksBetweenPrint = 100;
104
105 // Token: 0x04003AD0 RID: 15056
107
108 // Token: 0x04003AD1 RID: 15057
110
111 // Token: 0x04003AD2 RID: 15058
113
114 // Token: 0x020004FC RID: 1276
115 private struct TimerData
116 {
117 // Token: 0x17000615 RID: 1557
118 // (get) Token: 0x060030ED RID: 12525 RVA: 0x001F7418 File Offset: 0x001F5618
119 public double Average
120 {
121 get
122 {
123 /*
124An exception occurred when decompiling this method (060030ED)
125
126ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Double Terraria.Utilities.MultiTimer/TimerData::get_Average()
127
128 ---> System.Exception: Basic block has to end with unconditional control flow.
129{
130 Block_0:
131 stloc:float64(var_0_06, ldfld:float64(TimerData::Ticks, ldloc:valuetype Terraria.Utilities.MultiTimer/TimerData&(this)))
132}
133
134 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
135 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
136 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
137 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
138 --- End of inner exception stack trace ---
139 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
140 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
141*/;
142 }
143 }
144
145 // Token: 0x060030EE RID: 12526 RVA: 0x001F742C File Offset: 0x001F562C
146 private TimerData(double min, double max, double ticks, double total)
147 {
148 this.Min = min;
149 this.Ticks = ticks;
150 }
151
152 // Token: 0x060030EF RID: 12527 RVA: 0x001F7448 File Offset: 0x001F5648
153 public TimerData(double startTime)
154 {
157 }
158
159 // Token: 0x060030F0 RID: 12528 RVA: 0x001F7464 File Offset: 0x001F5664
160 public MultiTimer.TimerData AddTick(double time)
161 {
162 if (!true)
163 {
164 }
165 double max = this.Max;
166 double num = Math.Max(max, time);
167 double ticks = this.Ticks;
168 return 1;
169 }
170
171 // Token: 0x04003AD3 RID: 15059
172 public readonly double Min;
173
174 // Token: 0x04003AD4 RID: 15060
175 public readonly double Max;
176
177 // Token: 0x04003AD5 RID: 15061
178 public readonly double Ticks;
179
180 // Token: 0x04003AD6 RID: 15062
181 public readonly double Total;
182 }
183 }
184}
class f__AnonymousType0<< Count > j__TPar
static void WriteLine(object value)
Definition Console.cs:134
static byte Max(byte val1, byte val2)
Definition Math.cs:111
Dictionary< string, MultiTimer.TimerData > _timerDataMap
MultiTimer(int ticksBetweenPrint)
Definition MultiTimer.cs:16
double TotalMilliseconds
Definition TimeSpan.cs:117
TimerData(double min, double max, double ticks, double total)
MultiTimer.TimerData AddTick(double time)