Repository navigation
Commit 41dd4a2
feat(time): Let AnchoredClock recover the tick of an instant it projected
Restores the anchor plumbing that JAVA-572's Timestamp/AnchoredClock PR
(#6045) shed before merge, because it had no consumer at the time. The
span integration below is that consumer.
A Timestamp now records the clock that projected it, if any. That lets
tickOf invert the projection exactly — projection adds a tick difference
to a fixed epoch, so subtraction recovers the tick — and lets it reject
an instant this clock did not produce, whose epoch bears no arithmetic
relation to these ticks. at() becomes public for the reverse direction,
placing something already measured on the ticker, such as a frame or a
profiler sample, on the same timeline.
Equality stays by instant: the anchor records how an instant was
obtained, not what it denotes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 744ff64 commit 41dd4a2
3 files changed
Lines changed: 49 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7600 | 7600 | | |
7601 | 7601 | | |
7602 | 7602 | | |
| 7603 | + | |
7603 | 7604 | | |
7604 | 7605 | | |
7605 | 7606 | | |
| 7607 | + | |
7606 | 7608 | | |
7607 | 7609 | | |
7608 | 7610 | | |
| |||
7638 | 7640 | | |
7639 | 7641 | | |
7640 | 7642 | | |
| 7643 | + | |
7641 | 7644 | | |
7642 | 7645 | | |
7643 | 7646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
56 | 76 | | |
57 | 77 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| 29 | + | |
24 | 30 | | |
25 | | - | |
| 31 | + | |
26 | 32 | | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
| 36 | + | |
29 | 37 | | |
30 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
31 | 43 | | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
37 | 58 | | |
38 | 59 | | |
39 | 60 | | |
| |||
0 commit comments