Skip to content

Instantly share code, notes, and snippets.

@theeye-io
Created November 25, 2016 17:33
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 theeye-io/ebefc07b69eedb0a7c67d5626b0d76d7 to your computer and use it in GitHub Desktop.
Save theeye-io/ebefc07b69eedb0a7c67d5626b0d76d7 to your computer and use it in GitHub Desktop.
batch script to check timeout using curl
echo off
set arg1=%1
set arg2=%2
shift
shift
..\mingw64\bin\curl -o /dev/null -s -w %%{time_total} %arg1% > ..\tmp\rtime2.txt
set /p VAR=<..\tmp\rtime2.txt
del ..\tmp\rtime2.txt
IF %VAR% GEQ %arg2% (
echo Response time alto! %VAR%, expected %arg2%
echo { "state":"failure", "data":%VAR% }
) ELSE (
echo Response time bajo! %VAR%, expected %arg2%
echo { "state":"success", "data":%VAR% }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment