I did a somewhat halfway-there implementation of timestamp sources, assuming there would be only one (a singleton or static thing, I assumed), and that the timestamps that it returns would be compatible with Duration. This is true in std, but not super true if one wanted to use quanta, especially when using its mock time sources.
So, to implement a truly usable clock source, we need to do the following:
Have a time source trait that allows for concrete objects to return now()
Update the state structs to keep a time source in them
I did a somewhat halfway-there implementation of timestamp sources, assuming there would be only one (a singleton or static thing, I assumed), and that the timestamps that it returns would be compatible with
Duration
. This is true in std, but not super true if one wanted to usequanta
, especially when using its mock time sources.So, to implement a truly usable clock source, we need to do the following:
now()