Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PollForValues()

static void System.Diagnostics.Tracing.CounterGroup.PollForValues ( )
inlinestaticprivate

Definition at line 203 of file CounterGroup.cs.

204 {
207 while (true)
208 {
209 int num = int.MaxValue;
211 {
214 {
215 DateTime utcNow = DateTime.UtcNow;
216 if (s_counterGroupEnabled._nextPollingTimeStamp < utcNow + new TimeSpan(0, 0, 0, 0, 1))
217 {
219 }
220 int val = (int)(s_counterGroupEnabled._nextPollingTimeStamp - utcNow).TotalMilliseconds;
221 val = Math.Max(1, val);
222 num = Math.Min(num, val);
223 }
224 }
225 foreach (CounterGroup item in list)
226 {
227 item.OnTimer();
228 }
229 list.Clear();
230 if (num == int.MaxValue)
231 {
232 num = -1;
233 }
234 autoResetEvent?.WaitOne(num);
235 }
236 }
void Add(TKey key, TValue value)
CounterGroup(EventSource eventSource)
static List< CounterGroup > s_counterGroupEnabledList
static AutoResetEvent s_pollingThreadSleepEvent
static readonly object s_counterGroupLock

References System.item, System.list, System.Math.Max(), System.Math.Min(), System.Diagnostics.Tracing.CounterGroup.s_counterGroupEnabledList, System.Diagnostics.Tracing.CounterGroup.s_counterGroupLock, System.Diagnostics.Tracing.CounterGroup.s_pollingThreadSleepEvent, and System.DateTime.UtcNow.

Referenced by System.Diagnostics.Tracing.CounterGroup.EnableTimer().