#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

#1582 in Embedded development

Download history 41/week @ 2023-10-17 222/week @ 2023-10-24 195/week @ 2023-10-31 82/week @ 2023-11-07 94/week @ 2023-11-14 54/week @ 2023-11-21 126/week @ 2023-11-28 70/week @ 2023-12-05 79/week @ 2023-12-12 96/week @ 2023-12-19 45/week @ 2023-12-26 143/week @ 2024-01-02 93/week @ 2024-01-09 228/week @ 2024-01-16 145/week @ 2024-01-23 124/week @ 2024-01-30

607 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