[Test, Performance, Category("String")] publicvoidString_NotReallyOutput() { var unit = SampleUnit.Microsecond;
var outputStr = new MeasurementSettings(10, 10, 100, "Output using string", unit); var outputFormattedStr = new MeasurementSettings(10, 10, 100, "Output using formatted string", unit);
voidFakeOutput(string str) { if (false) Debug.Log(str); } voidFormattedFakeOutput(FormattableString fStr) { if (false) Debug.Log(fStr.ToString()); }
int age = 23, times = 25; Measure.Method(() => { FakeOutput($"Hello World with age {age} with times {times} "); }, outputStr).Run();
Measure.Method(() => { FormattedFakeOutput($"Hello World with age {age} with times {times} "); }, outputFormattedStr).Run(); }
[Test, Performance, Category("String")] publicvoidString_ReallyOutput() { var unit = SampleUnit.Microsecond;
var outputStr = new MeasurementSettings(10, 10, 100, "Output using string", unit); var outputFormattedStr = new MeasurementSettings(10, 10, 100, "Output using formatted string", unit);
voidFakeOutput(string str) { if (true) Debug.Log(str); }
voidFormattedFakeOutput(FormattableString fStr) { if (true) Debug.Log(fStr.ToString()); }
int age = 23, times = 25;
Measure.Method(() => { FakeOutput($"Hello World with age {age} with times {times} "); }, outputStr).Run();
Measure.Method(() => { FormattedFakeOutput($"Hello World with age {age} with times {times} "); }, outputFormattedStr).Run(); }