fn syscall_getrusage() {
    let time = libc::timeval {
        tv_sec: 0,
        tv_usec: 0,
    };
    let rusage = Box::new(libc::rusage {
        ru_utime: time.clone(),
        ru_stime: time.clone(),
        ru_maxrss: 0,
        ru_ixrss: 0,
        ru_idrss: 0,
        ru_isrss: 0,
        ru_minflt: 0,
        ru_majflt: 0,
        ru_nswap: 0,
        ru_inblock: 0,
        ru_oublock: 0,
        ru_msgsnd: 0,
        ru_msgrcv: 0,
        ru_nsignals: 0,
        ru_nvcsw: 0,
        ru_nivcsw: 0,
    });
    let ptr = Box::into_raw(rusage);

    let result = benchmark(
        || {},
        |_test| {
            unsafe {
                libc::getrusage(0, ptr);
            }
            true
        },
    )
    .unwrap();
    result.print_results("Sycall getrusage(2)", 0);
}
// syscall, can't be optimized out
syscall, can't be optimized out
syscall can ' t be optimized out
fn syscall_getrusage() {
    let time = libc::timeval {
        tv_sec: 0,
        tv_usec: 0,
    };
    let rusage = Box::new(libc::rusage {
        ru_utime: time.clone(),
        ru_stime: time.clone(),
        ru_maxrss: 0,
        ru_ixrss: 0,
        ru_idrss: 0,
        ru_isrss: 0,
        ru_minflt: 0,
        ru_majflt: 0,
        ru_nswap: 0,
        ru_inblock: 0,
        ru_oublock: 0,
        ru_msgsnd: 0,
        ru_msgrcv: 0,
        ru_nsignals: 0,
        ru_nvcsw: 0,
        ru_nivcsw: 0,
    });
    let ptr = Box::into_raw(rusage);
    let result = benchmark(
        || {},
        |_test| {
            unsafe {
                libc::getrusage(0, ptr);
            }
            true
        },
    )
    .unwrap();
    result.print_results("Sycall getrusage(2)", 0);
}
fn syscall_getrusage ( ) { let time = libc :: timeval { tv_sec : 0 , tv_usec : 0 , } ; let rusage = Box :: new ( libc :: rusage { ru_utime : time . clone ( ) , ru_stime : time . clone ( ) , ru_maxrss : 0 , ru_ixrss : 0 , ru_idrss : 0 , ru_isrss : 0 , ru_minflt : 0 , ru_majflt : 0 , ru_nswap : 0 , ru_inblock : 0 , ru_oublock : 0 , ru_msgsnd : 0 , ru_msgrcv : 0 , ru_nsignals : 0 , ru_nvcsw : 0 , ru_nivcsw : 0 , } ) ; let ptr = Box :: into_raw ( rusage ) ; let result = benchmark ( | | { } , | _test | { unsafe { libc :: getrusage ( 0 , ptr ) ; } true } , ) . unwrap ( ) ; result . print_results ( " " , 0 ) ; }
syscall, can't be optimized out
syscall can ' t be optimized out