Struct j2ds::Clock[][src]

pub struct Clock { /* fields omitted */ }

An increasing counter that ticks up until a particular count is reached, which then resets itself

Example:

use j2ds::*;

fn periodically_called_function(clock: &mut Clock) {
    // Do some stuff...

    if clock.tick() {
        // Do something special...
    }
}

Methods

impl Clock
[src]

Create a new clock that cycles every period ticks

Increment the current count by 1. If this is the period-th tick, the counter is reset and true is returned.

Reset the current count

Return the current count

Return the period of the clock

Trait Implementations

impl Debug for Clock
[src]

Formats the value using the given formatter. Read more

impl Eq for Clock
[src]

impl PartialEq for Clock
[src]

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

This method tests for !=.

Auto Trait Implementations

impl Send for Clock

impl Sync for Clock