def METHOD_NAME(self, timeout, callback):
    interval = 0.01
    start = datetime.now().timestamp()
    count = int(timeout / interval)
    for x in range(count):
        if callback():
            break
        time.sleep(interval)
    print("checked {} times, {:3F} seconds".format(x, datetime.now().timestamp()-start))