How do I measure execution time of a command on the Windows command line?

后端 未结 30 2939
南笙
南笙 2020-11-22 09:44

Is there a built-in way to measure execution time of a command on the Windows command line?

30条回答
  •  北海茫月
    2020-11-22 10:20

    Not quite as elegant as some of the functionality on Unix, but create a cmd file which looks like:

    @echo off
    time < nul
    yourexecutable.exe > c:\temp\output.txt
    time < nul
    rem on newer windows system you can try time /T
    

    That will display the start and stop times like so:

    The current time is: 10:31:57.92
    Enter the new time:
    The current time is: 10:32:05.94
    Enter the new time:
    

提交回复
热议问题