Print time in a batch file (milliseconds)

后端 未结 7 896
野性不改
野性不改 2020-12-13 23:56

How do I print the time (in ms) in a Windows batch file?

I want to measure the time that passes between lines in my batch file, but Windows\'s \"time /T\" does not p

7条回答
  •  伪装坚强ぢ
    2020-12-14 00:29

    %time% should work, provided enough time has elapsed between calls:

    @echo OFF
    
    @echo %time%
    ping -n 1 -w 1 127.0.0.1 1>nul
    @echo %time%
    

    On my system I get the following output:

    6:46:13.50
    6:46:13.60

提交回复
热议问题