Added times

This commit is contained in:
Jake Hillion 2020-04-28 15:04:26 +01:00
parent af3cdf78f1
commit 155c1513a1

View File

@ -18,8 +18,6 @@ def update():
with globals()['lock']:
globals()['data'] = grid_string
print("data updated to: " + grid_string)
return grid_string
def prepare_grid(grid):
@ -41,7 +39,10 @@ def serial_func():
while True:
with globals()['lock']:
if globals()['data'] != '':
t1 = time.time()
ser.write(bytes(globals()['data'], 'ascii'))
t2 = time.time()
print("time taken: " + str(t2-t1) + "s")
globals()['data'] = ''
time.sleep(0.1)