Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created August 7, 2018 15:44
Show Gist options
  • Save unitycoder/d2d537b70341a897f9b301d5e5181d34 to your computer and use it in GitHub Desktop.
Save unitycoder/d2d537b70341a897f9b301d5e5181d34 to your computer and use it in GitHub Desktop.
LogSpamTest
// measure debug.log with large loop
using UnityEngine;
public class LogSpamTest : MonoBehaviour
{
void Start()
{
var stopwatch = new System.Diagnostics.Stopwatch();
stopwatch.Start();
for (int i = 0; i < 100000; i++)
{
Debug.Log(i);
}
stopwatch.Stop();
Debug.Log("Timer: " + stopwatch.ElapsedMilliseconds);
stopwatch.Reset();
// with stacktrace = 25000 ms
// without stacktrace = 2200 ms
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment