You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 rivejä
715 B

  1. @echo off
  2. set start=%time%
  3. :: runs your command
  4. %*
  5. set end=%time%
  6. set options="tokens=1-4 delims=:.,"
  7. for /f %options% %%a in ("%start%") do set start_h=%%a&set /a start_m=100%%b %% 100&set /a start_s=100%%c %% 100&set /a start_ms=100%%d %% 100
  8. for /f %options% %%a in ("%end%") do set end_h=%%a&set /a end_m=100%%b %% 100&set /a end_s=100%%c %% 100&set /a end_ms=100%%d %% 100
  9. set /a hours=%end_h%-%start_h%
  10. set /a mins=%end_m%-%start_m%
  11. set /a secs=%end_s%-%start_s%
  12. set /a ms=%end_ms%-%start_ms%
  13. if %ms% lss 0 set /a secs = %secs% - 1 & set /a ms = 100%ms%
  14. if %secs% lss 0 set /a mins = %mins% - 1 & set /a secs = 60%secs%
  15. if 1%ms% lss 100 set ms=0%ms%
  16. echo [finished in %secs%.%ms%s]
  17. exit /b %errorlevel%