MCPcopy Index your code
hub / github.com/SSheldon/rust-dispatch / exec_after

Method exec_after

src/queue.rs:166–173  ·  view source on GitHub ↗

After the specified delay, submits a closure for asynchronous execution on self.

(&self, delay: Duration, work: F)

Source from the content-addressed store, hash-verified

164 /// After the specified delay, submits a closure for asynchronous execution
165 /// on self.
166 pub fn exec_after<F>(&self, delay: Duration, work: F)
167 where F: 'static + Send + FnOnce() {
168 let when = time_after_delay(delay);
169 let (context, work) = context_and_function(work);
170 unsafe {
171 dispatch_after_f(when, self.ptr, context, work);
172 }
173 }
174
175 /// Submits a closure to be executed on self the given number of iterations
176 /// and waits until it completes.

Callers 1

test_afterFunction · 0.80

Calls 2

time_after_delayFunction · 0.85
context_and_functionFunction · 0.85

Tested by 1

test_afterFunction · 0.64