reduced cpu load
This commit is contained in:
parent
28e0cc3bc1
commit
f5352f247a
|
@ -54,18 +54,12 @@ from pyqtgraph.widgets.PlotWidget import PlotWidget
|
||||||
from chaosc.argparser_groups import *
|
from chaosc.argparser_groups import *
|
||||||
from chaosc.lib import resolve_host
|
from chaosc.lib import resolve_host
|
||||||
|
|
||||||
try:
|
|
||||||
from chaosc.c_osc_lib import *
|
|
||||||
except ImportError:
|
|
||||||
from chaosc.osc_lib import *
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from chaosc.c_osc_lib import decode_osc
|
from chaosc.c_osc_lib import OSCMessage, decode_osc
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
print(e)
|
print(e)
|
||||||
from chaosc.osc_lib import decode_osc
|
from chaosc.osc_lib import OSCMessage, decode_osc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -137,7 +131,7 @@ class OSCThread(threading.Thread):
|
||||||
|
|
||||||
while self.running:
|
while self.running:
|
||||||
try:
|
try:
|
||||||
reads, writes, errs = select.select([self.osc_sock], [], [], 0.05)
|
reads, writes, errs = select.select([self.osc_sock], [], [], 0.01)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print "select error", e
|
print "select error", e
|
||||||
pass
|
pass
|
||||||
|
@ -407,6 +401,7 @@ class MyHandler(BaseHTTPRequestHandler):
|
||||||
#s = np.clip(dt*3., 0, 1)
|
#s = np.clip(dt*3., 0, 1)
|
||||||
#fps = fps * (1-s) + (1.0/dt) * s
|
#fps = fps * (1-s) + (1.0/dt) * s
|
||||||
#print '%0.2f fps' % fps
|
#print '%0.2f fps' % fps
|
||||||
|
time.sleep(0.05)
|
||||||
|
|
||||||
elif self.path.endswith(".jpeg"):
|
elif self.path.endswith(".jpeg"):
|
||||||
directory = os.path.dirname(os.path.abspath(__file__))
|
directory = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
Loading…
Reference in New Issue