Tanoda
ProfilerSample.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using System;
10using UnityEngine.Profiling;
11
12namespace Leap.Unity {
13
23 public struct ProfilerSample : IDisposable {
24
25 public ProfilerSample(string sampleName) {
26 Profiler.BeginSample(sampleName);
27 }
28
29 public ProfilerSample(string sampleName, UnityEngine.Object obj) {
30 Profiler.BeginSample(sampleName, obj);
31 }
32
33 public void Dispose() {
34 Profiler.EndSample();
35 }
36 }
37}
A utility struct for ease of use when you want to wrap a piece of code in a Profiler....
ProfilerSample(string sampleName)
ProfilerSample(string sampleName, UnityEngine.Object obj)