(&self)
| 41 | /// watermark. Guarantees: strictly increasing on this core. |
| 42 | #[inline] |
| 43 | pub(in crate::data::executor) fn bitemporal_now_ms(&self) -> i64 { |
| 44 | let prev = self.last_stamp_ms.load(Ordering::Relaxed); |
| 45 | let anchor = if let Some(epoch_ms) = self.epoch_system_ms { |
| 46 | epoch_ms |
| 47 | } else { |
| 48 | SystemTime::now() |
| 49 | .duration_since(UNIX_EPOCH) |
| 50 | .map(|d| i64::try_from(d.as_millis()).unwrap_or(i64::MAX)) |
| 51 | .unwrap_or(prev) |
| 52 | }; |
| 53 | let next = anchor.max(prev.saturating_add(1)); |
| 54 | self.last_stamp_ms.store(next, Ordering::Relaxed); |
| 55 | next |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | #[cfg(test)] |
no test coverage detected