MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / bitemporal_now_ms

Method bitemporal_now_ms

nodedb/src/data/executor/core_loop/bitemporal_time.rs:43–56  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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)]

Callers 6

execute_upsertMethod · 0.80
apply_point_putMethod · 0.80
execute_point_updateMethod · 0.80
execute_point_deleteMethod · 0.80

Calls 5

nowFunction · 0.85
duration_sinceMethod · 0.80
loadMethod · 0.45
as_millisMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected