Add monotonic clock functions

This adds monotonic clock functions adapted from:

  https://github.com/ThomasHabets/monotonic_clock

see the README.md for license details.