![]() The following script uses only "cmd.exe" and outputs the number of milliseconds from the time a pipeline is created to the time that the process preceding the script exits. Variable t2 holds your running time, you can echo %t2% to display it. it uses delayed expansion, and should be saved in a cmd/bat file.īefore your code: SETLOCAL EnableDelayedExpansionįor /f "tokens=2 delims=" %%I in ('wmic os get localdatetime /format:list') do set t=%%I My code gives you the running time in milliseconds, up to 24 hrs, it is locale insensitive, and accounts for negative values if code runs through midnight. :: Delete leading zero - so it'll not parsed as octal later Timeout 1 | TimeIt.cmd Execution took ~969 milliseconds.Ĭopy
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |