Emergent physical time from a cycle count: formulation of mechanics and thermodynamic | Synapse