OK The name of this qiestion is not just deciphered, but let me explain to you.
To establish a common language, I am going to provide some detailed information, but this question is intended to apply to all possible contexts, languages, and platforms.
Platform: .NET Framework 4.0 System: Windows (obviously) Language: F #
I need to run the program and evaluate the time taken to complete some instructions. Think that you have the main function: there you set the time counter:
open System.Diagnostics
let main args =
let watch = new Stopwatch ()
watch.Start ()
(* Calling functions and executing main body... *)
watch.Stop ()
(* Printing out the evaluated time *)
OK! I get time and I'm happy.
Now I want to measure this time, but evaluating it from the outside. Therefore, consider a PowerShell script that runs a file, but also counts the time:
$MyProcess = New-Object "System.Diagnostics.Process";
$Watch = New-Object "System.Diagnostics.Stopwatch";
$MyProcess.StartInfo.FileName = "Myexec";
$MyProcess.StartInfo.Arguments = "args";
$MyProcess.StartInfo.CreateNoWindow = $true;
$MyProcess.StartInfo.UseShellExecute = $false;
$StartingTimer = $Watch.Start();
$StartingProcess = $MyProcess.Start();
$WaitingForExit = $MyProcess.WaitForExit();
$StoppingTimer = $Watch.Stop();
$Ticks = $Watch.ElapsedTicks;
Write-Output "$Ticks";
.
:
, : in-code out-code.
, ! , , . , .....
, cpu , , ...
?
?