Struct j2ds::Timer[][src]

pub struct Timer { /* fields omitted */ }

A periodic timer with rising and falling edges

Methods

impl Timer
[src]

Creaste a new timer that activates every period ticks, starts at the given offset timer, and lasts for duration ticks. The offset and duration must be less than the period. The duration may be 0, and in that case the timer will only emit RisingEdge events

Get the next tick that will emit a RisingEdge event

Get the next tick that will emit a FallingEdge event

Get the next tick that will produce any TimerEvent

Runs the timer until either the given absolute time is reached, or until the next event occurs. You should generally run this function in a loop, as multiple events may have occured in the time elapsed.

Indicates if the timer is currently between a RisingEdge and FallingEdge event

Trait Implementations

impl Debug for Timer
[src]

Formats the value using the given formatter. Read more

impl Eq for Timer
[src]

impl PartialEq for Timer
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Copy for Timer
[src]

impl Clone for Timer
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Timer

impl Sync for Timer