enabled
Enables recording.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Property
- Namespace: UnityEngine.Profiling
- Assembly: UnityEngine.CoreModule
public bool enabled { get; set; }
Remarks
When enabled Recorder collects data regardless of Profiler being enabled or not.
Note:
Set to false to make measurements available immediately for synchronous testing scenarious.
Examples
using UnityEngine;using UnityEngine.Profiling;public class Example{ public static void TimeSynchronousMethodWithMarkers() { var recorder = Recorder.Get("MyMarker"); recorder.enabled = true; // Starts measurements // Call method which uses MyMarker // MyMethod(); recorder.enabled = false; // Stops measurements and makes data available immediately Debug.Log("MyMarker total time, ns: " + recorder.elapsedNanoseconds); }}