OxL Reference

method ClusterApi.now

cluster.now() (§12.6, §17.3): a hybrid logical clock stamp of a new local event. Strictly increasing on a node, and above every stamp the node saw from a peer (the stamps travel in every message between nodes), so it orders events across nodes.

Example:

oxl✓ checked in CI
fn main() io {
  let a = cluster.now()
  let b = cluster.now()
  print("{a < b}")
}
Output
true
pub(api) fn now() -> Hlc

Thread safety. safe from any task; stamps of one node strictly increase.

Since. 1.0.0-beta

Returns

Hlc

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/node.oxl:355

See also