Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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 havejava Abc
Now i want to calculate the time taken to execute the java.
Some thing like this..
Starting timejava Abc
End Time
Total Time taken...
How to DO that??
Can some body Help??

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

![]() |
Sound Blasted!
|
Stay on DOS after boot (w...
|

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