You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a unified time-type library for embedded applications embedded-time. There is one considerable pain point trying to make it compatible with the Monotonic trait for use with RTFM. That is the requirement that the Duration must implement a special TryInto to convert into the System Timer ticks. This use of TryInto feels inappropriate.
What I would like to suggest is instead have the System Timer implement some trait (let's call it Clock). This Clock trait would require a Fraction/Ratio indicating the precision of the clock. In that way a TryInto could be implemented to convert a duration to a different precision.
This would be roughly in line with how time is handled in the std::chrono library in C++.
I'm going to look into creating an example implementation of this structure, but any suggestions/comments would be much appreciated.
The text was updated successfully, but these errors were encountered:
I am working on a unified time-type library for embedded applications embedded-time. There is one considerable pain point trying to make it compatible with the Monotonic trait for use with RTFM. That is the requirement that the Duration must implement a special TryInto to convert into the System Timer ticks. This use of TryInto feels inappropriate.
What I would like to suggest is instead have the System Timer implement some trait (let's call it
Clock
). ThisClock
trait would require a Fraction/Ratio indicating the precision of the clock. In that way a TryInto could be implemented to convert a duration to a different precision.This would be roughly in line with how time is handled in the std::chrono library in C++.
I'm going to look into creating an example implementation of this structure, but any suggestions/comments would be much appreciated.
The text was updated successfully, but these errors were encountered: