def InitializeMacNowFunction(plat):
  """Sets a monotonic clock for the Mac platform.

    Args:
      plat: Platform that is being run on. Unused in GetMacNowFunction. Passed
        for consistency between initilaizers.
  """
  del plat  # Unused
  global _CLOCK  # pylint: disable=global-statement
  global _NOW_FUNCTION  # pylint: disable=global-statement
  _CLOCK = _MAC_CLOCK
  libc = ctypes.CDLL('/usr/lib/libc.dylib', use_errno=True)
  class MachTimebaseInfoData(ctypes.Structure):
    """System timebase info. Defined in <mach/mach_time.h>."""
    _fields_ = (('numer', ctypes.c_uint32),
                ('denom', ctypes.c_uint32))

  mach_absolute_time = libc.mach_absolute_time
  mach_absolute_time.restype = ctypes.c_uint64

  timebase = MachTimebaseInfoData()
  libc.mach_timebase_info(ctypes.byref(timebase))
  ticks_per_second = timebase.numer / timebase.denom * 1.0e9

  def MacNowFunctionImpl():
    return mach_absolute_time() / ticks_per_second
  _NOW_FUNCTION = MacNowFunctionImpl