Commit ea21701
committed
io: Redefine
`Clock.real` being defined to return timestamps relative to an
implementation-specific epochs means that there's currently no way for
the user to translate returned timestamps to actual calendar dates
without digging into implementation details of any particular `Io`
implementation. Redefining it to return timestamps relative to
1970-01-01 00:00:00+00:00 fixes this problem.
There are other ways to solve this, such as adding new vtable functions
for returning the implementation-specific epoch, but in terms of
complexity this redefinition is by far the simplest solution and only
amounts to a simple 96-bit integer addition's worth of overhead for
OSes like Windows that use non-POSIX/Unix epochs.Clock.real to return timestamps relative to the POSIX/Unix epoch1 parent fc5d8f4 commit ea21701
1 file changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
737 | | - | |
| 737 | + | |
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
745 | | - | |
746 | | - | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
747 | 750 | | |
748 | 751 | | |
749 | 752 | | |
| |||
0 commit comments