I have an application , and I need to show the total time of the process when this ends.
I am using the Swith case,
case "4":
Console.WriteLine("Generating file..." + "\n");
_loader.GenerateBinaryLog(filePath, logSelected);
Console.WriteLine("File Generated: " + _writer.getBinaryFileName(filePath, Convert.ToInt32(logSelected)) + "\n");
logSelected = "-1";
Console.ReadKey();
break;
So, when the process ends I need to show the message and something like this: “process finished in 30 seconds”…
You don’t need a performance counter.
You can use a Stopwatch,