title: why python takes more time while saving the image second time?
body: <p>I want to save a png image on the hard disk. The first time it takes 1.6 seconds while the second time onwards it takes more than 3 seconds why is that?</p>
  <pre><code>import appium.webdriver
  from appium import webdriver
  import time
  import PIL
  from PIL import Image
  import datetime
  
  &quot;&quot;&quot;
  Desired Capabilities
  &quot;&quot;&quot;
  
  desired_cap = {
    &quot;deviceName&quot;: &quot;ZY2244B53V&quot;,
    &quot;platformName&quot;: &quot;Android&quot;,
    &quot;appPackage&quot;: &quot;==&quot;,
    &quot;appActivity&quot;: &quot;com.tictok.tictokgame.activities.HomeActivity&quot;,
    &quot;automationName&quot;: &quot;UiAutomator1&quot;
  }
  webdriver = webdriver.Remote(&quot;http://localhost:4723/wd/hub&quot;,desired_cap)
  n=0
  while n&lt;2:
    a=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
    print(&quot;time of start saving image&quot; + str(a))
    webdriver.save_screenshot(&quot;D:/Python/winzo_memory/a.png&quot;)
    b=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
    print(&quot;time of end saving image&quot; + str(b))
  
    a=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
    print(&quot;time of start opening image&quot; + str(a))
    im = Image.open(&quot;a.png&quot;)
    b=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
    print(&quot;time of end opening image&quot; + str(b))
    n=n+1
  </code></pre>
  <p>output:</p>
  <pre><code>time of start saving image2020-08-23 06:56:41.252
  time of end saving image2020-08-23 06:56:42.837
  time of start saving image2020-08-23 06:56:42.904
  time of end saving image2020-08-23 06:56:45.952
  </code></pre>
  <p>I am trying to take a screenshot in appium driver. Is there a faster way to take a screenshot and let python read the pixels? Thanks in advance.</p>
  <p>My operating system is windows 7. the image is 1080X1920. and the size of the image is aprx 1.5 mb. not sure about HDD or SSD.</p>