RSX Code Reference
    Preparing search index...
    • rsx
    • ProfilerEvent

    Class ProfilerEvent

    The ProfilerEvent class is a definition for events and class to start recording them.

    Simple usage:

    	ProfilerEvent.sample("Editor Update", () => { .. my code ..}))
    

    Setting an attribute:

    	ProfilerEvent.sample("Editor Update", (eventSample) => {
    		... my code ...
    		eventSample.setAttribute("Objects updated", objectCount);
    	}
    

    Better performance:

    	static eventEditorUpdate = new ProfilerEvent("Editor update");
    	ProfilerEvent.sample(eventEditorUpdate, () => { .. my code ..}))
    

    Better performance with an attribute:

    	private static eventEditorUpdate = new ProfilerEvent("Editor update");
    	private static attributeObjectsUpdated = new ProfilerAttribute("Objects updated");
    	ProfilerEvent.sample(eventEditorUpdate, (eventSample) => {
    		... my code ...
    		eventSample.setAttribute(attributeObjectsUpdated, objectCount);
    	}
    
    Index
    • Constructs event with given name and adds it to static map.

      Parameters

      • name: string

        User-friendly name of this event.

      Returns ProfilerEvent

    identifier: number

    Identifier of profiler event that is unique within the script events provider.

    name: string

    User-friendly name of profiler event.

    _markers: Map<string, ProfilerEvent>
    • Returns profiler marker by name.

      Parameters

      • name: string

        Name of the event to be found and returned.

      Returns ProfilerEvent

    • Returns object that starts measuring the event. This provides slightly worse performance because the event object first needs to be found in a string map.

      Type Parameters

      • T

      Parameters

      • eventName: string

        Name of the event that should be sampled.

      • action: (sample: ProfilerEventSample) => T

      Returns T