def sleep_correctly(period):
    current_time = time.time()
    end_time = current_time + period
    while current_time < end_time:
        time.sleep(end_time - current_time)
        current_time = time.time()
Sleep function can be interrupted by external signals,
dataset/ETHPy150Open linkedin/simoorg/src/simoorg/atropos.py/sleep_correctly