#time #date #date-time #embedded-time #testing

dev std-embedded-time

Implementation of embedded-time Clocks using std::time

1 unstable release

0.1.0 Aug 20, 2021

#1755 in Embedded development

Download history 352/week @ 2024-07-26 320/week @ 2024-08-02 365/week @ 2024-08-09 274/week @ 2024-08-16 153/week @ 2024-08-23 877/week @ 2024-08-30 1273/week @ 2024-09-06 782/week @ 2024-09-13 1421/week @ 2024-09-20 565/week @ 2024-09-27 477/week @ 2024-10-04 490/week @ 2024-10-11 489/week @ 2024-10-18 388/week @ 2024-10-25 337/week @ 2024-11-01 321/week @ 2024-11-08

1,628 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
~11K SLoC