Accumulated time of Begin/End pairs for the previous frame in nanoseconds. (Read Only)
Long-lasting operations (for example, on a preloading thread) might not end within a single frame. In this case, elapsedNanoseconds is calculated until the end of the frame, so you can always see activity for these operations.
#pragma strict var behaviourUpdateRecorder: Recorder; function Start() { behaviourUpdateRecorder = Recorder.Get("BehaviourUpdate"); behaviourUpdateRecorder.enabled = true; } function Update() { if (behaviourUpdateRecorder.isValid) Debug.Log("BehaviourUpdate time: " + behaviourUpdateRecorder.elapsedNanoseconds); }
using UnityEngine; using UnityEngine.Profiling;
public class ExampleClass : MonoBehaviour { Recorder behaviourUpdateRecorder; void Start() { behaviourUpdateRecorder = Recorder.Get("BehaviourUpdate"); behaviourUpdateRecorder.enabled = true; }
void Update() { if (behaviourUpdateRecorder.isValid) Debug.Log("BehaviourUpdate time: " + behaviourUpdateRecorder.elapsedNanoseconds); } }
Did you find this page useful? Please give it a rating: