Commit a4129c62 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Print board parsing time

parent 29be6a54
......@@ -47,15 +47,18 @@ if __name__ == '__main__':
try:
board = screenshot_board(win)
start = time.time()
state = State.detect(board)
vprint('\033c', 'parsed:', sep='')
end = time.time()
vprint('\033c', end='')
vprint('parsed in', round((end - start) * 1000, 1), 'ms:')
vprint_state(state)
vprint()
start = time.time()
solution = state.solve()
end = time.time()
vprint('thought for', round((end - start) * 1000, 1), 'milliseconds')
vprint('thought for', round((end - start) * 1000, 1), 'ms')
except (TypeError, AssertionError):
vprint('\rerror during parsing, wait for a bit...', end='')
time.sleep(0.050)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment