Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created November 4, 2017 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/c96018dee07cef754a0207589c8b1484 to your computer and use it in GitHub Desktop.
Save tsubaki/c96018dee07cef754a0207589c8b1484 to your computer and use it in GitHub Desktop.
using UnityEngine;
using UnityEngine.Profiling;
public class ExampleClass : MonoBehaviour
{
Recorder behaviourUpdateRecorder;
void Start()
{
// Profilerから”BehaviourUpdate”と名前の付く項目を抽出して、
// 観測を有効化
behaviourUpdateRecorder = Recorder.Get("BehaviourUpdate");
behaviourUpdateRecorder.enabled = true;
}
void Update()
{
// BehaviourUpdateが観測可能(EditorとDevelopment Players)なら、ログに処理時間(ミリ秒)を出力
if (behaviourUpdateRecorder.isValid)
Debug.Log("BehaviourUpdate time: " + behaviourUpdateRecorder.elapsedNanoseconds);
}
}
@tsubaki
Copy link
Author

tsubaki commented Nov 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment