Unity 6.3
0 онлайн 72 гостей 3 в системе
Вход

ProfilerRecorderOptions.CollectOnlyOnCurrentThread

Описание

Используйте для сбора образцов только на потоке, на котором инициализована ProfilerRecorder.

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); } } }