I have a program that runs on a Raspberry Pi 4 and uses std::time::Instant. I want to change it to no_std so I can try and make it run on smaller devices. embedded-time::clock::Clock seems to be a no_std alternative to std::time::Instant.
However, Clock is just a trait and I can't figure out how to create an instance of it. Do I need to use an additional crate, perhaps specific to Raspberry Pi, that provides an implementation of Clock? How do I find such a crate? I tried searching crates.io for crates that depend on embedded-time, but there are many results and none seemed applicable.
For what it's worth, my program needs to repeatedly check how much time has passed since some start. So I don't need UTC or complex calendar logic or anything like that. embedded-time::timer::Timer::is_expired sounds ideal for me.
I have a program that runs on a Raspberry Pi 4 and uses
std::time::Instant. I want to change it tono_stdso I can try and make it run on smaller devices.embedded-time::clock::Clockseems to be ano_stdalternative tostd::time::Instant.However,
Clockis just a trait and I can't figure out how to create an instance of it. Do I need to use an additional crate, perhaps specific to Raspberry Pi, that provides an implementation ofClock? How do I find such a crate? I tried searchingcrates.iofor crates that depend onembedded-time, but there are many results and none seemed applicable.For what it's worth, my program needs to repeatedly check how much time has passed since some start. So I don't need UTC or complex calendar logic or anything like that.
embedded-time::timer::Timer::is_expiredsounds ideal for me.