Advertisement
annikkexe

Delay example

Dec 3rd, 2016
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. @echo off
  2. REM Creates a delay of specified cents
  3.  
  4. :testLoop
  5. echo CATBISCUIT
  6. call :delay 450
  7. goto :testLoop
  8.  
  9. pause
  10. exit /b
  11.  
  12.  
  13.  
  14. :delay
  15. call :getAbsTime
  16. set /a limit=%cent% + %~1
  17. echo cent: %cent% PREVIOUS: %centPrev% LIMIT: %limit%
  18. :wait
  19. title %cent%\%limit%
  20. set "centPrev=%cent%"
  21. call :getAbsTime
  22. if %centPrev% GTR %cent% set /a limit-=100& echo WRAP
  23. if %cent% LSS %limit% goto :wait
  24. goto :eof
  25.  
  26.  
  27. :getAbsTime
  28. for /f "tokens=2 delims=." %%a in ("%time%") do (set "cent=%%a")
  29. if "%cent:~0,1%" == "0" set "cent=%cent:~1%"
  30. :goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement