Created
August 7, 2018 15:44
-
-
Save unitycoder/d2d537b70341a897f9b301d5e5181d34 to your computer and use it in GitHub Desktop.
LogSpamTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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