clock_source 0.2.4

set a common clock source
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[macro_export]
macro_rules! register_clock_source {
    ($path:path) => {
        #[no_mangle]
        extern "C" fn __RUST_CRATE_CLOCK_SOURCE() -> u64 {
            $path()
        }
    };
}
extern "C" {
    fn __RUST_CRATE_CLOCK_SOURCE() -> u64;
}

pub const CLOCK: fn() -> u64 = || unsafe { __RUST_CRATE_CLOCK_SOURCE() };