-
-
Save mati865/b422b41f2c2784361091db78354d4bc8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "libc_test" | |
version = "0.1.0" | |
authors = ["Mateusz Mikuła <mati865@gmail.com>"] | |
edition = "2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
libc = { version = "0.2", default-features = false } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let mut timespec = libc::timespec { | |
tv_sec: 0, | |
tv_nsec: 0, | |
}; | |
unsafe { libc::clock_gettime(libc::CLOCK_REALTIME, &mut timespec) }; | |
println!("{}\n{:#?}", timespec.tv_nsec, std::time::SystemTime::now()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment