Объявление
public static Unity.Profiling.ProfilerRecorder StartNew(Unity.Profiling.ProfilerCategory category, string statName, int capacity, Unity.Profiling.ProfilerRecorderOptions options);Параметры
category | Категория профайлера. |
statName | Маркер профилировщика или имя счетчика. |
capacity | Максимальное количество образцов для сбора. |
options | Параметры профайлеррекордера. |
Возвращает
ProfilerRecorder Возвращает новый включенный экземпляр рекордера.
Описание
Инициализировать новый экземпляр ProfilerRecorder и начать сбор данных.
Список доступных встроенных маркеров Profiler см. в документации руководства пользователя по маркерам Profiler, модуль Rendering Profiler и модуль Virtual Texturing Profiler.
using Unity.Profiling;
using UnityEngine;
public class ExampleScript : MonoBehaviour
{
ProfilerRecorder systemMemoryRecorder;
ProfilerRecorder gcMemoryRecorder;
ProfilerRecorder mainThreadTimeRecorder;
void OnEnable()
{
systemMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "System Used Memory");
gcMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Reserved Memory");
mainThreadTimeRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Internal, "Main Thread", 15);
}
void OnDisable()
{
systemMemoryRecorder.Dispose();
gcMemoryRecorder.Dispose();
mainThreadTimeRecorder.Dispose();
}
}
Смотрите так же: ctor.
Объявление
public static Unity.Profiling.ProfilerRecorder StartNew(Unity.Profiling.ProfilerMarker marker, int capacity, Unity.Profiling.ProfilerRecorderOptions options);Параметры
capacity | Максимальное количество образцов, которые необходимо собрать. |
options | Параметры регистратора профилировщика. |
marker | Экземпляр маркера профилировщика. |
Возвращает
ProfilerRecorder Возвращает новый включенный экземпляр рекордера.
Описание
Инициализировать новый экземпляр ProfilerRecorder для ProfilerMarker и начать сбор данных.
Смотрите так же:: ProfilerMarker.