title: Writing Curl Output to Batch File Variable
body: <p>I am trying to get the total time to access a page and using this command:</p>
  
  <pre><code>curl -o NUL -s -w "%%{time_total}" http://stackoverflow.com
  </code></pre>
  
  <p>I am able to get the total time displayed in the command prompt.</p>
  
  <p>However, now I would like to put this in a for loop like this:</p>
  
  <pre><code>echo off
  SET /a i=0
  
  :loop
  IF %i%==10 GOTO END
  echo Iteration %i%.
  SET /a i=%i%+1
  GOTO LOOP
  :end
  </code></pre>
  
  <p>and sum up all the times I get, replacing <code>echo Iteration %i%.</code> with something like</p>
  
  <pre><code>set /a var = curl -o NUL -s -w "%%{time_total}" http://stackoverflow.com
  set /a vartotal = var + vartotal
  </code></pre>
  
  <p>But of course this doesn't work, and I know its partially because the times returned are decimal and batch can't handle decimals.  Also, the URL may have non-alphabetic charcters in it such as ?, =, and &amp;.  Please help</p>