Last active
June 24, 2018 19:23
-
-
Save asmodehn/078595d40920203f76cd643132155218 to your computer and use it in GitHub Desktop.
Windows Batch backoff delay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
set /a backoff = 1 | |
set /a backoff_max = 1 | |
for /L %%a in (1,1,100) do ( | |
set /a backoff_max= !backoff_max! *2 | |
echo !backoff_max! | |
set /a backoff= %random% %% !backoff_max! | |
echo Waiting !backoff! second... | |
choice /N /C:YN /T:!backoff! /D:Y >NUL | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment