Struct fence::Fence
[−]
[src]
pub struct Fence { /* fields omitted */ }
Methods
impl Fence
[src]
Fence provides a timed rate limiter. It's useful for imposing a framerate cap on a UI thread.
In a typical usage, place a fence at the end of a loop to control the invocation rate.
fn from_secs(s: u64) -> Fence
Construct a fence from the specified seconds.
fn from_millis(m: u64) -> Fence
Construct a fence from the specified milliseconds.
fn from_duration(dur: Duration) -> Fence
Construct a fence from the given duration.
fn sleep(&mut self)
Sleep the current thread until at least the specified passage of time.