Skip to content

Commit

Permalink
Merge pull request #21 from warnerpr-cyan/master
Browse files Browse the repository at this point in the history
Add a sleep in NmapProcess.__wait to reduce CPU overhead
  • Loading branch information
savon-noir committed Apr 8, 2014
2 parents 6f079e9 + 76c2c98 commit e47a442
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libnmap/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from threading import Thread
from xml.dom import pulldom
import warnings
import time
try:
from Queue import Queue, Empty, Full
except ImportError:
Expand Down Expand Up @@ -301,6 +302,7 @@ def __wait(self):
self.__nmap_event_callback(self)
self.__stdout += thread_stream
self.__io_queue.task_done()
time.sleep(0.01)

self.__nmap_rc = self.__nmap_proc.poll()
if self.rc is None:
Expand Down

0 comments on commit e47a442

Please sign in to comment.