Aggiunta calcolo tempi esecuzione
This commit is contained in:
@@ -12,6 +12,10 @@ Console.WriteLine("calling ext app with args[]:");
|
||||
string appPath = "./Utils/ExImp.exe";
|
||||
string procArg = @"C:\Temp\test.log";
|
||||
Console.WriteLine($"{appPath} {procArg}");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("press enter to proceed...");
|
||||
|
||||
Console.ReadLine();
|
||||
|
||||
ProcessStartInfo psi = new ProcessStartInfo
|
||||
{
|
||||
@@ -25,7 +29,9 @@ ProcessStartInfo psi = new ProcessStartInfo
|
||||
RedirectStandardInput = true,
|
||||
};
|
||||
|
||||
//childProc.StartInfo = psi;
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
|
||||
Process p = Process.Start(psi);
|
||||
|
||||
string q = "";
|
||||
@@ -34,9 +40,19 @@ while (!p.HasExited)
|
||||
q += p.StandardOutput.ReadToEnd();
|
||||
}
|
||||
|
||||
Console.WriteLine("Ext prog ended");
|
||||
sw.Stop();
|
||||
var timeElaps = sw.Elapsed;
|
||||
Console.WriteLine($"Ext prog executed in {timeElaps.TotalMilliseconds} ms");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("press enter to proceed...");
|
||||
|
||||
Console.ReadLine();
|
||||
sw.Restart();
|
||||
Console.WriteLine("Data received:");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine(q);
|
||||
Console.WriteLine();
|
||||
sw.Stop();
|
||||
timeElaps = sw.Elapsed;
|
||||
Console.WriteLine($"Display executed in {timeElaps.TotalMilliseconds} ms");
|
||||
|
||||
Console.ReadLine();
|
||||
Reference in New Issue
Block a user