Python 2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2] on linux2 Type "copyright", "credits" or "license()" for more information. >>> from a_star import AStar >>> import time >>> a = AStar() >>> tSteps = [.1, .05, .025, .0125, .00625] >>> for step in tSteps: print step t0 = time.time() while time.time() - t0 < 60: a.test_read8() time.sleep(step) 0.1 0.05 0.025 0.0125 0.00625 >>> for step in tSteps: print step t0 = time.time() while time.time() - t0 < 60: analog = a.read_analog() time.sleep(step) 0.1 0.05 0.025 0.0125 0.00625 >>> for step in tSteps: print step t0 = time.time() while time.time() - t0 < 60: a.test_write8() time.sleep(step) 0.1 0.05 0.025 0.0125 0.00625 >>> for step in tSteps: print step t0 = time.time() while time.time() - t0 < 60: analog = a.read_analog() a.motors(0, 0) time.sleep(step) 0.1 0.05 Traceback (most recent call last): File "", line 5, in analog = a.read_analog() File "a_star.py", line 43, in read_analog return self.read_unpack(12, 12, "HHHHHH") File "a_star.py", line 20, in read_unpack byte_list.append(self.bus.read_byte(20)) IOError: [Errno 5] Input/output error >>> >>> for step in tSteps: print step t0 = time.time() while time.time() - t0 < 60: analog = a.read_analog() a.motors(0, 0) time.sleep(step) 0.1 0.05 0.025 0.0125 0.00625 Traceback (most recent call last): File "", line 5, in analog = a.read_analog() File "a_star.py", line 43, in read_analog return self.read_unpack(12, 12, "HHHHHH") File "a_star.py", line 20, in read_unpack byte_list.append(self.bus.read_byte(20)) IOError: [Errno 5] Input/output error >>> for step in tSteps: print step t0 = time.time() while time.time() - t0 < 60: analog = a.read_analog() a.motors(0, 0) time.sleep(step) 0.1 0.05 0.025 0.0125 0.00625 >>> step = .00625 >>> while True: print step t0 = time.time() while time.time() - t0 < 60: a.test_write8() time.sleep(step) step /= 2 0.00625 0.003125 0.0015625 0.00078125 0.000390625 0.0001953125 9.765625e-05 4.8828125e-05 2.44140625e-05 Traceback (most recent call last): File "", line 6, in time.sleep(step) KeyboardInterrupt >>> for once in range(1): # To avoid delay between next two lines t0 = time.time() for i in range(500): a.test_write8() total_time = time.time() - t0 >>> 8 * 500 * 8 / total_time / 1000 130.68810369539477