#![no_std]
#![no_main]

#[macro_use]
extern crate user_lib;

use user_lib::{get_time, sleep};

// 教学目标：
// 使用封装好的 `sleep` 接口验证“睡眠前后时间差”是否合理。

#[unsafe(no_mangle)]
extern "C" fn main() -> i32 {
    let start = get_time();
    println!("current time_msec = {}", start);
    sleep(100);
    let end = get_time();
    println!(
        "time_msec = {} after sleeping 100 ticks, delta = {}ms!",
        end,
        end - start
    );
    println!("Test sleep1 passed!");
    0
}
