NOTE: All methods marked with Benchmark
will have benchmark code injected.
Before code:
class MyClass
{
[Benchmark]
void MyMethod()
{
Thread.Sleep(TimeSpan.FromMilliseconds(120));
}
}
What gets compiled:
class MyClass
{
[Benchmark]
void MyMethod()
{
Stopwatch stopwatch = Stopwatch.StartNew();
Thread.Sleep(TimeSpan.FromMilliseconds(120));
Debug.Log($"MyClass::MyMethod took {stopwatch.ElapsedMilliseconds}ms.");
}
}
The actual injected class and method names are different
- Cadabra was made possible by com.unity.entities
- Icon Cadabra icon created by Freepik - Flaticon