Skip to content
Sebastiano Mandalà edited this page Jun 20, 2019 · 3 revisions

The design of the PlatformProfiler struct is not final yet and keeps evolving until it gets to the final vision. It's a simple way to profile functions and the implementation can be platform specific (this part is still to improve).

the PlatformProfiler is a struct and it's meant to be initialized on use. Failing to do so may result in exception in some cases (for example when the multithreading version is used with old unity versions).

The current standard use is:

using (var profiler = new PlatformProfiler("Svelto.ECS - Entities Submission")) //this triggers the first profile too
{
       //....stuff....
       using (profiler.Sample("Remove and Swap operations")) //subsequent profilings are done in this way
       {
             //...even more stuff....
       }
}