![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Newbie Question: Here-Script with PowerShell Hallo, I'm new to this newsgroup and I'm new to PowerShell. I've been using a script under HP-UX to feed a program (laufdaten.exe) with some input wich then produces a file called md_daten wich then is read by another program (mdlauf.exe) wich produces some more or less important output. The cpu- seconds used by mdlauf.exe are measured. Here is the a part of the script: ,------------- [ Unix Here-Script ] ------------- | | laufdaten.exe << ! | 0 | 0.5 | 3 | 132000 | '''/users/hemmer/mds_neu/TEST/md_erg0.5-7''' | '''/users/hemmer/mds_neu/TEST/orte0.5-7''' | '''/users/hemmer/mds_neu/TEST/enrg0.5-7''' | '''/users/hemmer/mds_neu/TEST/polar0.5-7''' | ! | time mdlauf2.exe | `------------------------------------------------ Is this possible with powershell too? And how can I measure the cpu-time used by a command with powershell? Thanx in advance, Raymund |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | RE: Newbie Question: Here-Script with PowerShell Hi, You can use the following to assess how long a command or script has taken: Measure-Command {c:\scripts\test.ps1} "Raymund Hemmerling" wrote:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest | Re: Newbie Question: Here-Script with PowerShell "NJC" <NJC@xxxxxx> wrote in message news:6EB38534-CC20-4465-96F9-B0CF898FDE63@xxxxxx
you can read the property of the process object. You can do this in several ways such as: $myapp = [System.Diagnostics.Process]::Start("<path to my app>\mdlauf.exe") while (! $myapp.HasExited) {} $myapp.TotalProcessorTime Hope that helps, Jacques | ||||||||||||
My System Specs![]() | |||||||||||||
| | #4 (permalink) | ||||||||||||
| Guest | Re: Newbie Question: Here-Script with PowerShell NJC schrieb am 26.09.:
cpu-time. If there are several commands hunting for cpu-time, the real-time could be much longer. Raymund | ||||||||||||
My System Specs![]() | |||||||||||||
| | #5 (permalink) | ||||||||||||
| Guest | Re: Newbie Question: Here-Script with PowerShell Jacques Barathon [MS] schrieb am 26.09.:
multi-cpu-system the sum of all cpu-time used on all cpus by the app? Raymund | ||||||||||||
My System Specs![]() | |||||||||||||
| | #6 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Newbie Question: Here-Script with PowerShell "Raymund Hemmerling" <just4news@xxxxxx-2007-09-30.arcornews.de> wrote in message news:Xns99B87B1F8AB24enigma@xxxxxx-63535.user.dfncis.de...
I can only assume it does but won't formally say yes. The MSDN documentation for the property doesn't say anything about it. Jacques | ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #7 (permalink) | ||||||||||||
| Guest | Re: Newbie Question: Here-Script with PowerShell Jacques Barathon [MS] schrieb am 27.09.:
I've tested my app with "Measure-Command" and your solution. And with TotalProcessorTime I've got 50% more cpu-time than real-time with Measure- Command on a dual-core system. The app is Fortran- and C-code compiled with Intel's Compilers using multi-threading-libs. Raymund | ||||||||||||
My System Specs![]() | |||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question - flushing out powershell.exe when existing a script | Sabo, Eric | PowerShell | 8 | 03-26-2008 12:35 PM |
| Newbie question - Is there a script/command to do a backup of a di | dob | PowerShell | 4 | 01-03-2008 09:45 AM |
| Newbie Question - Uses for PowerShell | Kim Finleyson | PowerShell | 11 | 06-28-2007 07:20 PM |
| Newbie question: How can I perform web searches from PowerShell? | Mark Allen | PowerShell | 16 | 05-10-2007 10:41 AM |
| Newbie question - Powershell/Authentication/IP address | =?Utf-8?B?Ym1lcnJpMTk=?= | PowerShell | 3 | 07-20-2006 02:38 AM |