def ClockUsToTimestamp(clock_us, reference_clock_us, reference_timestamp):
  """Converts a reported clock measurement (in us) to a timestamp.

  Args:
    clock_us: Measured clock [us].
    reference_clock_us: Measured clock at a reference moment [us].
    reference_timestamp: Seconds after 1/1/1970 at the reference moment.

  Returns:
    Timestamp corresponding to clock_us in seconds after 1/1/1970.
  """

  return reference_timestamp + (clock_us - reference_clock_us) / 1.0e6