Profiling scopes

- Added profiling scope utility
- Added profiling scopes around some functions
- Testing StreamWriter and FileStream
This commit is contained in:
max
2023-07-16 19:58:37 +02:00
parent d859ad1af5
commit 6667f013bf
4 changed files with 248 additions and 169 deletions

View File

@ -0,0 +1,26 @@
using UnityEngine;
using UnityEngine.Profiling;
namespace VertexColor.ScenePartition
{
public static class ProfilerUtility
{
public class ProfilerScope : System.IDisposable
{
public ProfilerScope(string name)
{
Profiler.BeginSample(name);
}
public ProfilerScope(string name, Object target)
{
Profiler.BeginSample(name, target);
}
public void Dispose()
{
Profiler.EndSample();
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7338cbb3bcd0a224fbfca184c7efcd7e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: