Skip to content

Commit

Permalink
Make patch stopwatch local
Browse files Browse the repository at this point in the history
It's not needed outside of ProcessPatch(), which contains everything it
needs to time
  • Loading branch information
blowfishpro committed Apr 8, 2018
1 parent 5d41c73 commit 5a5b3e7
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions ModuleManager/MMPatchLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public class MMPatchLoader : LoadingSystem

private bool useCache = false;

private readonly Stopwatch patchSw = new Stopwatch();

private static readonly List<ModuleManagerPostPatchCallback> postPatchCallbacks = new List<ModuleManagerPostPatchCallback>();

private const float yieldInterval = 1f/30f; // Patch at ~30fps
Expand Down Expand Up @@ -95,12 +93,6 @@ private void Awake()

public override bool IsReady()
{
//return false;
if (ready)
{
patchSw.Stop();
logger.Info("Ran in " + ((float)patchSw.ElapsedMilliseconds / 1000).ToString("F3") + "s");
}
return ready;
}

Expand All @@ -113,9 +105,6 @@ public override string ProgressTitle()

public override void StartLoad()
{
patchSw.Reset();
patchSw.Start();

ready = false;

// DB check used to track the now fixed TextureReplacer corruption
Expand All @@ -132,6 +121,9 @@ public static void AddPostPatchCallback(ModuleManagerPostPatchCallback callback)

private IEnumerator ProcessPatch()
{
Stopwatch patchSw = new Stopwatch();
patchSw.Start();

status = "Checking Cache";
logger.Info(status);
yield return null;
Expand Down Expand Up @@ -390,6 +382,9 @@ float updateTimeRemaining()

yield return null;

patchSw.Stop();
logger.Info("Ran in " + ((float)patchSw.ElapsedMilliseconds / 1000).ToString("F3") + "s");

ready = true;
}

Expand Down

0 comments on commit 5a5b3e7

Please sign in to comment.