Problem: code for zclock_mono is slightly too complex

Solution: refactor functions that are used only once, to make the
code easier to reuse.