Files
Dan Gohman febd4d3b53 Put net, time, and other parts of the API behind feature flags (#297)
* Introduce API features.

* Don't use doc_cfg on internal modules.

* Don't compile the net code when the "net" feature is not present.

* Don't compile the runtime code when the "runtime" feature is not present.

* Don't compile the thread code when the "thread" feature is not present.

* Don't compile the time code when the "time" feature is not present.

* Don't compile the fs code when the "fs" feature is not present.

* Don't compile the rand code when the "rand" feature is not present.

* Split an "mm" feature out of the "io" module.

* Make some parts of "process"' implementation conditional.

* "Inline" the use declarations in src/imp/linux_raw/fs/mod.rs.

* Export `Timespec` and `ClockId` in `crate::thread`.

* io_uring depends on types from fs and net.

* Re-export Timespec etc. in crate::fs and crate::thread.

This makes it easier to disable crate::time when the time module is not
enabled.

* Ensure that tests and examples compile when features are disabled.

* Fix compilation.
2022-05-02 10:54:40 -07:00

21 lines
480 B
Rust

//! A command which prints the current values of the realtime and monotonic
//! clocks it's given.
#[cfg(not(windows))]
#[cfg(feature = "time")]
fn main() {
println!(
"Real time: {:?}",
rustix::time::clock_gettime(rustix::time::ClockId::Realtime)
);
println!(
"Monotonic time: {:?}",
rustix::time::clock_gettime(rustix::time::ClockId::Monotonic)
);
}
#[cfg(any(windows, not(feature = "time")))]
fn main() {
unimplemented!()
}