2/9/2023 9:44:31 PM

When you have long running loops in a .NET Console App, it is nice to get visual feedback that the process is still running. Use the following to output a counter to the Console window without adding a new line to the output.

public static void Console_Counter(int current, int total) { try { System.Console.Write("\r{0}/{1}", current, total); } catch (Exception ex) { } }