MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / simple_clock_gettime_libc

Function simple_clock_gettime_libc

benches/mod.rs:146–159  ·  view source on GitHub ↗
(c: &mut Criterion)

Source from the content-addressed store, hash-verified

144
145 #[cfg(not(target_os = "wasi"))]
146 pub(super) fn simple_clock_gettime_libc(c: &mut Criterion) {
147 c.bench_function("simple clock_gettime libc", |b| {
148 b.iter(|| {
149 let mut s = std::mem::MaybeUninit::<libc::timespec>::uninit();
150 unsafe {
151 assert_eq!(
152 libc::clock_gettime(libc::CLOCK_MONOTONIC, s.as_mut_ptr()),
153 0
154 );
155 let _ = s.assume_init();
156 }
157 })
158 });
159 }
160
161 #[cfg(not(target_os = "wasi"))]
162 pub(super) fn simple_getpid(c: &mut Criterion) {

Callers

nothing calls this directly

Calls 1

assume_initMethod · 0.80

Tested by

no test coverage detected