PC Review


Reply
Thread Tools Rate Thread

command line prompt showing how long last command took?

 
 
sillyhat@yahoo.com
Guest
Posts: n/a
 
      17th May 2006
Hello

I sometimes use a prompt like this:


PROMPT=$D $T$H$H$H [$P]$_$G$S


which gives me this:


Fri 2006-05-12 16:55:32 [H:\]



I would like to be able to have something like this:

Fri 2006-05-12 16:55:32 (00:00:00.34) [H:\]


where the time in bracket is the time taken to execute the last
command.

There is an option under some unix shells to do this.


Is it possible in XP? I know from isssuing a 'prompt /?' that there is
no direct way of doing it but perhaps there is some undocumented way.


If not, I'll stick to TIMETHIS.EXE

This was previously posted in: microsoft.public.windowsxp.general
where it was suggested I post the query here.

Thanks in advance.

Hal
~~~~~~~~~~~~~~~~~~~~~

 
Reply With Quote
 
 
 
 
Timo Salmi
Guest
Posts: n/a
 
      17th May 2006
(E-Mail Removed) wrote:
> I would like to be able to have something like this:
> Fri 2006-05-12 16:55:32 (00:00:00.34) [H:\]
> where the time in bracket is the time taken to execute the last
> command.


> Is it possible in XP? I know from isssuing a 'prompt /?' that there is
> no direct way of doing it but perhaps there is some undocumented way.


Prompt I don't know, but in scripting which is the main topic around
here:
30} Can one calculate the difference between two times in a script?
163586 May 1 2006 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi


All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
private.php?do=newpm&u= <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html
 
Reply With Quote
 
heathsnider@gmail.com
Guest
Posts: n/a
 
      17th May 2006
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
:: Store start time
FOR /f "tokens=1-4 delims=:.," %%T IN ("%TIME%") DO (
SET StartTIME=%TIME%
SET /a Start100S=%%T*360000+%%U*6000+%%V*100+%%W
)

:: Main Batch code goes here
:: Wait for 3 seconds to simulate Batch processing
ping -n 3 127.0.0.1>NUL

:: Retrieve Stop time
FOR /f "tokens=1-4 delims=:.," %%T IN ("%TIME%") DO (
SET StopTIME=%TIME%
SET /a Stop100S=%%T*360000+%%U*6000+%%V*100+%%W
)

:: Test midnight rollover. If so, add 1 day=8640000 1/100ths secs
IF %Stop100S% LSS %Start100S% SET /a Stop100S+=8640000
SET /a TookTime=%Stop100S%-%Start100S%

ECHO. (%~nx0) Started: %StartTime%
ECHO. (%~nx0) Stopped: %StopTime%
ECHO. (%~nx0) Elapsed: %TookTime:~0,-2%.%TookTime:~-2% seconds

 
Reply With Quote
 
Peter.H.M.Brooks@gmail.com
Guest
Posts: n/a
 
      19th May 2006
That's amazing - I was just looking for the msdos version of the 'time'
command and, what do I find, but a usenet group with it as the most
recently posted topic - spooky!

 
Reply With Quote
 
wadester
Guest
Posts: n/a
 
      21st May 2006
(E-Mail Removed) wrote:
> That's amazing - I was just looking for the msdos version of the 'time'
> command and, what do I find, but a usenet group with it as the most
> recently posted topic - spooky!
>


If you are looking for a stand-alone EXE, there is timethis.exe from the
W2K resource kit.

http://download.microsoft.com/downlo...this_setup.exe

ws
 
Reply With Quote
 
sillyhat@yahoo.com
Guest
Posts: n/a
 
      29th May 2006
and if you had read the original post properly....

 
Reply With Quote
 
foxidrive
Guest
Posts: n/a
 
      29th May 2006
On 29 May 2006 03:10:19 -0700, (E-Mail Removed) wrote:

> and if you had read the original post properly....


The answer is no.
 
Reply With Quote
 
David Candy
Guest
Posts: n/a
 
      29th May 2006
You are a grade A idiot. What original post. There is no mention of it moron.

--
--------------------------------------------------------------------------------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================
<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> and if you had read the original post properly....
>

 
Reply With Quote
 
Thorsten Kampe
Guest
Posts: n/a
 
      29th May 2006
* David Candy (2006-05-29 11:25 +0000)
> You are a grade A idiot.


You're welcome.

> What original post.


You mean: "What original post?" Well, probably /the/ original post...
^
> There is no mention of it moron.


Sure there is:

,--- * Message-ID: <(E-Mail Removed)>
| If not, I'll stick to TIMETHIS.EXE
`---

T.
 
Reply With Quote
 
Todd Vargo
Guest
Posts: n/a
 
      29th May 2006
If it was at all worth the effort, one could use http://groups.google.com but I suspect you enjoy arguing and name calling to prove your point. WHATEVER!

"David Candy" <.> wrote in message news:(E-Mail Removed)...

Where?

<bitmap removed>

--
--------------------------------------------------------------------------------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================
"Thorsten Kampe" <(E-Mail Removed)> wrote in message news:1hgdpdwmg6sii$.9f1pby8msmyk$.(E-Mail Removed)...
>* David Candy (2006-05-29 11:25 +0000)
>> You are a grade A idiot.

>
> You're welcome.
>
>> What original post.

>
> You mean: "What original post?" Well, probably /the/ original post...
> ^
>> There is no mention of it moron.

>
> Sure there is:
>
> ,--- * Message-ID: <(E-Mail Removed)>
> | If not, I'll stick to TIMETHIS.EXE
> `---
>
> T.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command prompt..line Natka Windows XP General 5 3rd Sep 2008 03:47 AM
DOS prompt command (long directory names) Don Culp Windows XP General 2 25th Sep 2007 05:58 PM
Command Prompt (cmd.exe) command line interface Larry__Weiss Windows XP General 7 23rd Jul 2006 03:42 PM
command line prompt showing how long last command took? sillyhat@yahoo.com Windows XP General 1 13th May 2006 02:03 AM
Navigating in Command prompt - long directory names Robert Lane Windows XP Help 6 10th Nov 2003 03:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:56 PM.