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

Function epoll_timeout_nsecs

tests/event/epoll_timeout.rs:6–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5#[test]
6fn epoll_timeout_nsecs() {
7 let epoll_fd = epoll::create(epoll::CreateFlags::CLOEXEC).unwrap();
8
9 let start = Instant::now();
10 let mut events = Vec::with_capacity(1);
11 epoll::wait(
12 &epoll_fd,
13 spare_capacity(&mut events),
14 Some(&Timespec {
15 tv_sec: 0,
16 tv_nsec: 1_000_000,
17 }),
18 )
19 .unwrap();
20
21 let duration = start.elapsed();
22
23 assert!(
24 duration.as_secs() > 0 || (duration.as_secs() == 0 && duration.subsec_nanos() >= 1_000_000)
25 );
26}
27
28#[test]
29fn epoll_timeout_secs() {

Callers

nothing calls this directly

Calls 3

spare_capacityFunction · 0.85
createFunction · 0.50
waitFunction · 0.50

Tested by

no test coverage detected