title: Why multi threading speed is not efficient in my code?
body: <p>For some reasons multi threading is not efficient in my code.</p>
  <p>My code gets a token from a txt file and sends a post request with that token.</p>
  <p>And i don't understand why multi threading is not efficient in my code.</p>
  <p>It took 2.7 seconds to make 3 post requests.</p>
  <p>Here is my code:</p>
  <pre><code>import requests
  from concurrent.futures import ThreadPoolExecutor, as_completed
  from time import time
  url_list = [
      &quot;https://www.google.com/api/&quot;
  ]
  
  tokens = set()
  with open(&quot;tokens.txt&quot;, &quot;r&quot;) as f:
      file_lines = f.readlines()
      for line in file_lines:
          tokens.add(line.strip())
  
  token_data = {&quot;token&quot;: None}
  def makerequest(url):
      for token in tokens:
          token_data[&quot;Token&quot;] = token
          html = requests.post(url,stream=True, data=token_data)
          print(html.text)
  
  start = time()
  
  processes = []
  with ThreadPoolExecutor(max_workers=200) as executor:
      for url in url_list:
          processes.append(executor.submit(makerequest, url))
  
  for task in as_completed(processes):
      print(task.result())
  
  
  print(f'Time taken: {time() - start}')
  </code></pre>
  <p>2.7 seconds to send 3 post requests i don't think it is good for multi threading.</p>