hi
i want to learn how to measure elapsed time when start some process like counting of min,hours?
thank you
measrue elapsed time
Moderator: DosItHelp
Re: measrue elapsed time
I need something like stopwatch examples
Not those examples
Not those examples
Re: measrue elapsed time
Hello, have you tried Enhanced Batch?
You can measure the time using the extension @timer, as in this example:
it prints:
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
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 . . .