mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 12:23:39 +01:00
formatting
This commit is contained in:
parent
7768a9c1d9
commit
d7b2d92552
1 changed files with 9 additions and 2 deletions
|
|
@ -194,16 +194,23 @@ namespace Dalamud.Game
|
||||||
// Stat Tracking for Framework Updates
|
// Stat Tracking for Framework Updates
|
||||||
var invokeList = this.Update.GetInvocationList();
|
var invokeList = this.Update.GetInvocationList();
|
||||||
var notUpdated = StatsHistory.Keys.ToList();
|
var notUpdated = StatsHistory.Keys.ToList();
|
||||||
|
|
||||||
// Individually invoke OnUpdate handlers and time them.
|
// Individually invoke OnUpdate handlers and time them.
|
||||||
foreach (var d in invokeList)
|
foreach (var d in invokeList)
|
||||||
{
|
{
|
||||||
statsStopwatch.Restart();
|
statsStopwatch.Restart();
|
||||||
d.Method.Invoke(d.Target, new object[] { this });
|
d.Method.Invoke(d.Target, new object[] { this });
|
||||||
statsStopwatch.Stop();
|
statsStopwatch.Stop();
|
||||||
|
|
||||||
var key = $"{d.Target}::{d.Method.Name}";
|
var key = $"{d.Target}::{d.Method.Name}";
|
||||||
if (notUpdated.Contains(key)) notUpdated.Remove(key);
|
if (notUpdated.Contains(key))
|
||||||
if (!StatsHistory.ContainsKey(key)) StatsHistory.Add(key, new List<double>());
|
notUpdated.Remove(key);
|
||||||
|
|
||||||
|
if (!StatsHistory.ContainsKey(key))
|
||||||
|
StatsHistory.Add(key, new List<double>());
|
||||||
|
|
||||||
StatsHistory[key].Add(statsStopwatch.Elapsed.TotalMilliseconds);
|
StatsHistory[key].Add(statsStopwatch.Elapsed.TotalMilliseconds);
|
||||||
|
|
||||||
if (StatsHistory[key].Count > 1000)
|
if (StatsHistory[key].Count > 1000)
|
||||||
{
|
{
|
||||||
StatsHistory[key].RemoveRange(0, StatsHistory[key].Count - 1000);
|
StatsHistory[key].RemoveRange(0, StatsHistory[key].Count - 1000);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue