Skip to content

Instantly share code, notes, and snippets.

@asmodehn
Last active June 24, 2018 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asmodehn/078595d40920203f76cd643132155218 to your computer and use it in GitHub Desktop.
Save asmodehn/078595d40920203f76cd643132155218 to your computer and use it in GitHub Desktop.
Windows Batch backoff delay
@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