forked from M-Labs/libfringe
16 lines
247 B
Rust
16 lines
247 B
Rust
|
#![feature(asm)]
|
||
|
extern crate test;
|
||
|
use test::Bencher;
|
||
|
|
||
|
#[bench]
|
||
|
fn kernel_swap(b: &mut Bencher) {
|
||
|
b.iter(|| unsafe {
|
||
|
asm!("movq $$102, %rax\n\
|
||
|
syscall"
|
||
|
:
|
||
|
:
|
||
|
: "rax", "rcx"
|
||
|
: "volatile");
|
||
|
});
|
||
|
}
|