using System.Diagnostics;
public class TestObject {
private readonly int _value;
public TestObject(int value){
private static readonly int testCount = 100000;
public static void Main(string[] args)
Stopwatch timerEx = new Stopwatch();
for(var i = 0; i < testCount; i++){
var flag = GetFlagWithExceptionControlFlow(i);
Console.WriteLine($"Execution time with exception control flow: {timerEx.Elapsed}");
Stopwatch timer = new Stopwatch();
for(var i = 0; i < testCount; i++){
var flag = BuildObject(i);
Console.WriteLine($"Execution time WITHOUT exception control flow: {timer.Elapsed}");
private static (bool, TestObject) BuildObject(int i){
return (true, new TestObject(i));
private static bool GetFlag(int i)
private static bool GetFlagWithExceptionControlFlow(int i)
throw new Exception("oh no.");