Computing.Net > Forums > Disk Operating System > How To calculate Time taken ??

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How To calculate Time taken ??

Reply to Message Icon

Name: depampom
Date: May 23, 2002 at 10:56:09 Pacific
Comment:

I want to calculate the time taken for executing a batc file.
....
For Example i have a batch file execute.bat
In side that i have

java Abc

Now i want to calculate the time taken to execute the java.

Some thing like this..
Starting time

java Abc

End Time
Total Time taken

...

How to DO that??


Can some body Help??




Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: May 23, 2002 at 11:24:48 Pacific
Reply:

The following line will display the current time in the screen:

echo.EXIT|%comspec%/k PROMPT $T$_|FIND ":"

Now, you can have the start and end time. Subtracting is complicated, I think it's better do it by yourself (I'm not saying it can't be done in batch, I'm just saying it's not that simple)

echo Starting time:
echo.EXIT|%comspec%/k PROMPT $T$_|FIND ":"
java Abc
echo End Time:
echo.EXIT|%comspec%/k PROMPT $T$_|FIND ":"

If the java outputs text to the screen, you migth want to store the times into a text file and TYPE it on the end:

echo.EXIT|%comspec%/k PROMPT $T$_|FIND ":">result.txt
java Abc
echo.EXIT|%comspec%/k PROMPT $T$_|FIND ":">>result.txt
echo Start and end time:
TYPE result.txt
del result.txt

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 2
Name: depapom
Date: May 24, 2002 at 00:06:09 Pacific
Reply:

Hi..

Thts gr88

Thnxx



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Sound Blasted! Stay on DOS after boot (w...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: How To calculate Time taken ??

How to update time automatically? www.computing.net/answers/dos/how-to-update-time-automatically/14968.html

How to display time and date in autoexec www.computing.net/answers/dos/how-to-display-time-and-date-in-autoexec/11241.html

How to setup more than one operating sys www.computing.net/answers/dos/how-to-setup-more-than-one-operating-sys/8117.html