def calculate_cpu_mhz(cpu_mhz, previous_time, current_time,
                      previous_cpu_time, current_cpu_time):
    """ Calculate the average CPU utilization in MHz for a period of time.

    :param cpu_mhz: The frequency of a core of the physical CPU in MHz.
     :type cpu_mhz: int

    :param previous_time: The previous time.
     :type previous_time: float

    :param current_time: The current time.
     :type current_time: float

    :param previous_cpu_time: The previous CPU time of the domain.
     :type previous_cpu_time: number

    :param current_cpu_time: The current CPU time of the domain.
     :type current_cpu_time: number

    :return: The average CPU utilization in MHz.
     :rtype: int,>=0
    """
    return int(cpu_mhz * float(current_cpu_time - previous_cpu_time) / \
               ((current_time - previous_time) * 1000000000))