measrue elapsed time

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Userdosfx
Posts: 13
Joined: 31 Aug 2019 14:13

measrue elapsed time

#1 Post by Userdosfx » 10 Dec 2019 06:32

hi
i want to learn how to measure elapsed time when start some process like counting of min,hours?

thank you

miskox
Posts: 630
Joined: 28 Jun 2010 03:46

Re: measrue elapsed time

#2 Post by miskox » 10 Dec 2019 07:09


Userdosfx
Posts: 13
Joined: 31 Aug 2019 14:13

Re: measrue elapsed time

#3 Post by Userdosfx » 28 Dec 2019 08:00

I need something like stopwatch examples
Not those examples

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: measrue elapsed time

#4 Post by carlos » 28 Dec 2019 10:30

Hello, have you tried Enhanced Batch?

You can measure the time using the extension @timer, as in this example:

Code: Select all

@Echo off
Rundll32 "%~dp0enhancedbatch_%processor_architecture%" load
If Not Defined @enhancedbatch (
Echo Load Failed
Goto :Eof
)

set @delayedexpansion=1
set @echooptions=0

call @timer start

:: execute here your command
:: ping as example
ping.exe example.com

call @timer stop
echo
echo Elapsed milliseconds: !@timer!

pause
it prints:

Code: Select all

Pinging example.com [93.184.216.34] with 32 bytes of data:
Reply from 93.184.216.34: bytes=32 time=145ms TTL=49
Reply from 93.184.216.34: bytes=32 time=139ms TTL=49
Reply from 93.184.216.34: bytes=32 time=137ms TTL=49
Reply from 93.184.216.34: bytes=32 time=136ms TTL=49

Ping statistics for 93.184.216.34:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 136ms, Maximum = 145ms, Average = 139ms

Elapsed milliseconds: 3266
Press any key to continue . . .

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: measrue elapsed time

#5 Post by Squashman » 30 Dec 2019 08:31

Userdosfx wrote:
28 Dec 2019 08:00
I need something like stopwatch examples
Not those examples
Explain to us how using GetTimeStamp or JTimeStamp does not working for you in a stopwatch like fashion.

Post Reply