Skip to content

Commit cfa8860

Browse files
preloader: log total duration for preloading
1 parent d9dc78c commit cfa8860

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Assembly-CSharp/Preloader.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections;
33
using System.Collections.Generic;
4+
using System.Diagnostics;
45
using System.IO;
56
using System.Linq;
67
using System.Threading.Tasks;
@@ -27,6 +28,7 @@ public IEnumerator Preload
2728
Dictionary<string, List<Func<IEnumerator>>> sceneHooks
2829
)
2930
{
31+
var stopwatch = Stopwatch.StartNew();
3032
MuteAllAudio();
3133

3234
Logger.APILogger.Log($"Preloading using mode {ModHooks.GlobalSettings.PreloadMode}");
@@ -48,6 +50,7 @@ Dictionary<string, List<Func<IEnumerator>>> sceneHooks
4850
yield return CleanUpPreloading();
4951

5052
UnmuteAllAudio();
53+
Logger.APILogger.LogError($"Finished preloading in {stopwatch.ElapsedMilliseconds/1000:F2}s");
5154
}
5255

5356
/// <summary>

0 commit comments

Comments
 (0)