<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cpu_speed(self, silent=False):
 """Retrieves the CPU speed of the target. If the target does not support CPU frequency detection, this function will return ``0``. Args: self (JLink):
 the ``JLink`` instance silent (bool):
 ``True`` if the CPU detection should not report errors to the error handler on failure. Returns: The measured CPU frequency on success, otherwise ``0`` if the core does not support CPU frequency detection. Raises: JLinkException: on hardware error. """

        res = self._dll.JLINKARM_MeasureCPUSpeedEx(-1, 1, int(silent))
        if res < 0:
            raise errors.JLinkException(res)
        return res