public static string FormatBenchmarkResult(string title, ProfilerHelpers.BenchmarkResult result, bool csv = false)
 {
     if (csv)
     {
         return($"{result.sampleCount},{result.totalInSecond},{result.avgInMs},{result.medianInMs},{result.peakInMs},{result.minInMs}");
     }
     else
     {
         return($"{title} samples: {result.sampleCount} - total: {FormatNumber(result.totalInSecond)}s - avg: {FormatNumber(result.avgInMs)}ms - median: {FormatNumber(result.medianInMs)}ms - peak: {FormatNumber(result.peakInMs)}ms - min: {FormatNumber(result.minInMs)}ms");
     }
 }
Exemple #2
0
 private static void LogBenchmark(string title, ProfilerHelpers.BenchmarkResult result, ProfilingSnippetOptions options)
 {
     Debug.Log(ProfilingSnippetUtils.FormatBenchmarkResult(title, result));
     options.Log(ProfilingSnippetUtils.FormatBenchmarkResult(title, result, options.csvLog));
 }