Version: 2021.3
언어: 한국어

ProfilerRecorderOptions.CollectOnlyOnCurrentThread

매뉴얼로 전환

설명

Use to collect samples only on the thread ProfilerRecorder was initialized on.

using System;
using Unity.Profiling;
using UnityEngine;

public class CollectGCAllocCountExample { static void PrintGCAllocCount(Action a) { using (var gcAllocRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Internal, "GC.Alloc", 100, ProfilerRecorderOptions.CollectOnlyOnCurrentThread)) { a.Invoke();

gcAllocRecorder.Stop();

Debug.Log("GC allocs count: " + gcAllocRecorder.Count); } } }