// sleep-typed.el — sleep(Duration) lowers to el_sleep_duration. The actual
// elapsed Duration is measured by Instant - Instant arithmetic. The check
// returns 1 if elapsed is at least 50 millis but under 1 second — the wide
// upper bound tolerates scheduler jitter on shared CI runners while the
// lower bound proves the sleep actually waited.

// `test` is reserved; using `run_test` instead.
fn run_test() -> Int {
    let start: Instant = now()
    sleep(50.millis)
    let elapsed: Duration = now() - start
    if elapsed >= 50.millis {
        if elapsed < 1.second {
            return 1
        }
    }
    return 0
}

fn main() -> Void {
    println(int_to_str(run_test()))
}
