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

后端 未结 30 3242
南笙
南笙 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:15

    Another approach with powershell:

    @echo off
    for /f %%t in ('powershell "(get-date).tofiletime()"') do set mst=%%t
    
    rem some commands
    
    powershell ((get-date).tofiletime() - %mst%)
    

    this will print the execution time in milliseconds.

提交回复
热议问题