hydroflow
                                
                                
                                
                                    hydroflow copied to clipboard
                            
                            
                            
                        Support for wall-clock time in Context.
I need wall clock time for a HLC implementation.
The current implementation of Context:: current_tick_start uses std::time::instant as the type.
Should we add another field to represent wall clock time? Or should we replace current_tick_start with SystemTime?
Arguments for changing type:
- Individual clock readings in the context are all meaningful, without the need for another timestamp. It can be used to stamp messages and events.
 
Arguments for keeping type (and introducing a separate field for wall clock time)
- It helps measure the performance of operations since the start of the tick, although one can do this in other ways.
 
IMHO, changing the type makes more sense.
What do you need that Instant can't provide? Serialization/deserialization?
For Hybrid-Logical clock? I need the wall clock time. Instant is not wall clock time - it's an offset from some arbitrary event, and systems may not even agree on the "start" for measuring the offset.
For example, on Windows, instant uses QueryPerformanceCounter APIs. This is what the documentation says about the value:
QPC is independent of, and isn't synchronized to, any external time reference. To retrieve time stamps that can be synchronized to an external time reference, such as, Coordinated Universal Time (UTC) for use in high-resolution time-of-day measurements, use GetSystemTimePreciseAsFileTime.
Fixed. https://github.com/hydro-project/hydroflow/pull/1196
For the future: https://github.com/hydro-project/hydroflow/issues/1202