#embedded #date #time #test #embedded-time

std-embedded-time

Implementation of embedded-time Clocks using std::time

1 unstable release

0.1.0 Aug 20, 2021

#333 in Embedded development

Download history 24/week @ 2021-08-17 2/week @ 2021-08-24 2/week @ 2021-09-14 10/week @ 2021-09-28 89/week @ 2021-10-05 42/week @ 2021-10-12 3/week @ 2021-10-19 26/week @ 2021-10-26 3/week @ 2021-11-02 61/week @ 2021-11-09 3/week @ 2021-11-16 5/week @ 2021-11-23

72 downloads per month
Used in 2 crates

Custom license

5KB

std-embedded-time

Provides an embedded-time::Clock using [std::time] so that embedded-time can eaisly be used in on-host testing.

Usage

It's extremely straight-forward to start using a clock:

use std_embedded_time::StandardClock;
use embedded_time::Clock;

fn main() {
    let clock = StandardClock::default();

    let now = clock.try_now().unwrap();
    println!("Current time: {:?}", now);
}

lib.rs:

Standard embedded-time

This library provides an [embedded_time::Clock] that can be used for host-side testing.

The provided [embedded_time::Clock] implementation is based on [std::time].

Usage

use std_embedded_time::StandardClock;
use embedded_time::Clock;

fn main() {
    let clock = StandardClock::default();

    let now = clock.try_now().unwrap();
    println!("Current time: {:?}", now);
}

Dependencies

~545KB
~10K SLoC