title: I want to stop packet capture while sniffing continuously once a condition is met
body: <h3>Problem</h3>
  
  <p>I have written a script that sniffs packet from a host, however, I am sniffing the packets in continuous mode and would like to stop sniffing on a timeout. I have written the following code to stop packet sniffing, but it doesn't seem to stop when the time has clearly exceeded the timeout. What could I be doing wrong in here?</p>
  
  <pre class="lang-py prettyprint-override"><code>import time
  import pyshark
  
  prog_start = time.time()
  capture = pyshark.LiveCapture(interface='en0')
  capture.sniff(timeout=10)
  start_time = capture[0].frame_info.time_epoch
  end_time = capture[-1].frame_info.time_epoch
  print("Capture lasted:", float(end_time) - float(start_time))
  pkt_num = 0
  for pkt in capture:
      pkt_num += 1
      print("Time", time.time() - prog_start, "Pkt#", pkt_num)
  </code></pre>
  
  <p>We then get this output, with thousands of <em>additional</em> packets a second, past when the capture should have stopped:</p>
  
  <pre class="lang-sh prettyprint-override"><code>Capture lasted: 9.148329019546509
  Time 10.346031188964844 Pkt# 1
  Time 10.348641157150269 Pkt# 2
  Time 10.351708889007568 Pkt# 3
  Time 10.353564977645874 Pkt# 4
  Time 10.35555100440979 Pkt# 5
  ...
  </code></pre>
  
  <h3>Question</h3>
  
  <p>Why does PyShark continue to capture packets after the timeout?</p>