Timestamps (X11)
The X server's own clock: 32 bits of milliseconds riding along on every key press and mouse click, and the thing that decides who won when two programs want the same resource.
The server counts milliseconds from an arbitrary origin, in practice its own start, and the counter wraps after roughly 49 days. Every key, button and property event carries the value, and it is not decoration. Whoever wants to own a selection, take a grab or move focus sends a timestamp along, and the server refuses the request if it is older than the last change. That is how races between clients are settled without the server having to know who is right: the one acting on the most recent user event wins.
The constant CurrentTime, zero, means "now" and is tempting when no event is at hand. ICCCM forbids it for selections, since "now" never loses a race and so makes the rule meaningless; a program with no fresh event is supposed to write zero bytes to a property and read the time out of the PropertyNotify that comes back. The same stamps carry the later layers: _NET_WM_USER_TIME and startup notification record when the user last did something, which is the entire basis of focus stealing prevention.