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: 
If you want the time to be constantly displayed while the script(block) is running, you can do something like below:

```
function timer($script, $interval = 1){
    $t = [system.diagnostics.stopwatch]::startnew()
    $job = start-job -script $script
    while($job.state -eq "running"){
        write-host -fore yellow "Elapsed: $($t.elapsed) "
        $job | Receive-Job
        sleep $interval
    }
    $t.stop()
}

timer -script {1..10 | %{ write-host $_ test; start-sleep 2}}

```
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