Question: My machine is Win7 64 bit. I use PowerShell.

While running gcc or gfortran on my PowerShell I would like to see a 'stopper' (time elapsed) during my program is execute. How can I do that in PowerShell?

I would like that this stop-watch (time elapse) will be on the shell and not part of my code that i am running. 

Is there any command? Do someone give me a script that do it (I am novice).

Answer: 
I would do this with the Write-Progress cmdlet:

```
$start = Get-Date
$j = Start-Job -ScriptBlock {...}
do {
    Write-Progress "Waiting for Job to Finish" "Waiting For $((Get-Date) - $start)"
    Start-Sleep -milliseconds 250
} while ($j.State -eq 'Running')
Receive-Job -Job $j

```

Hope this Helps
Sounds like you want to time a process. Replace $executable and $argument with your specifics. The $timeSpan variable will give you the time it took to complete.

```
$executable = "C:\Windows\notepad.exe"
$arguments = "C:\Windows\WindowsUpdate.log"

$timeSpan = Measure-Command { Start-Process -FilePath $executable -ArgumentList $arguments -Wait -NoNewWindow }

$timeSpan

```

Output:

```
Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 24
Milliseconds      : 255
Ticks             : 242559320
TotalDays         : 0.000280739953703704
TotalHours        : 0.00673775888888889
TotalMinutes      : 0.404265533333333
TotalSeconds      : 24.255932
TotalMilliseconds : 24255.932

```