Profiler Class
Provides methods to collect performance data during update operations in a View.
NuGet/Assembly: Carmenta.Engine.5.16.2.nupkg (in the CECore assembly)
Syntax
public class Profiler : EngineObject
Remarks
A Profiler measures elapsed time when a View is updated. The performance data is returned in a PerformanceReport which can be saved to a file.
Carmenta Explorer has built in functionality to measure the performance of a View and a configuration does not have to be modified in any way to make use of it. However, if you want to measure the performance in a running application you can use a Profiler to do it and then view the resulting report in Carmenta Explorer.
Example
// Profiles a single update and saves the resulting performance report
// to a file which can be opened in Carmenta Explorer.
public static void ProfileUpdate(View view, string filename)
{
Profiler profiler = new Profiler(view);
profiler.Start();
view.Update();
PerformanceReport report = profiler.Stop();
report.Save(filename);
}
Inheritance Hierarchy
System.Object (not available in C#)
EngineObject
Profiler
Platforms
Windows, Linux, Android
Profiler Members
The Profiler type has the following members.
Constructors
Name | Description |
---|---|
Profiler | Initializes a new instance of the Profiler class for the given View. |
Properties
Name | Description |
---|---|
IsDisposed | Gets a value that tells whether the current Profiler has been disposed. Inherited from EngineObject |
IsRunning | Gets a value that determines whether the profiler is running or not. |
NativeHandle | Gets the native Carmenta Engine kernel object the current Profiler represents. Inherited from EngineObject |
Gets the profiler that is currently running. | |
View | Gets the View the profiler is connected to. |
Methods
Name | Description |
---|---|
Clone | Creates a copy of an object. Inherited from EngineObject |
Dispose | Releases the reference to the native Carmenta Engine kernel instance the EngineObject represents. Inherited from EngineObject |
Equals | Determines whether this instance is equal to another. Inherited from EngineObject |
Reset | Stops collecting data and resets the state of the Profiler. |
Start | Starts collecting data for the View connected with the Profiler. |
Stop | Stops collecting data and returns a PerformanceReport with the result. |