#date #time #test #embedded-time

dev std-embedded-time

Implementation of embedded-time Clocks using std::time

1 unstable release

0.1.0 Aug 20, 2021

#1174 in Embedded development

Download history 80/week @ 2023-07-17 730/week @ 2023-07-24 424/week @ 2023-07-31 109/week @ 2023-08-07 128/week @ 2023-08-14 169/week @ 2023-08-21 172/week @ 2023-08-28 162/week @ 2023-09-04 44/week @ 2023-09-11 37/week @ 2023-09-18 25/week @ 2023-09-25 19/week @ 2023-10-02 82/week @ 2023-10-09 35/week @ 2023-10-16 162/week @ 2023-10-23 252/week @ 2023-10-30

532 downloads per month
Used in 5 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

~605KB
~12K SLoC