# Reset()

> Stops data collection and clears collected samples.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Profiling](/engine/6000.3/script-reference/unity/profiling.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public void Reset()
```

### Remarks

Sets [ProfilerRecorder.Count](/engine/6000.3/script-reference/unity/profiling/profilerrecorder/count.md) to 0 and [ProfilerRecorder.WrappedAround](/engine/6000.3/script-reference/unity/profiling/profilerrecorder/wrappedaround.md) to false and stops collection.

```csharp
using Unity.Profiling;
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    ProfilerRecorder recorder;

    void OnEnable()
    {
        recorder = new ProfilerRecorder("MyMarker", 1);
        recorder.Start();
    }

    void OnDisable()
    {
        recorder.Dispose();
    }

    void Update()
    {
        recorder.Reset();
        recorder.Start();
    }

    void LateUpdate()
    {
        Debug.Log("MyMarker costs between Update and LateUpdate, ms: " + recorder.CurrentValue);
    }
}
```

**Note:**

If *Reset* is used every frame, the [ProfilerRecorder.LastValue](/engine/6000.3/script-reference/unity/profiling/profilerrecorder/lastvalue.md) and [ProfilerRecorder.LastValueAsDouble](/engine/6000.3/script-reference/unity/profiling/profilerrecorder/lastvalueasdouble.md) properties will be 0.
