def check_convergence(new_measure, old_measure, direction, threshold):
    """Check if the performance meets the given threshold

    Args:
        new_measure (float): New performance
        old_measure (float): Old performance
        direction (str): String to indicate how to compare two measures
        threshold (float): The given threshold

    Returns:
        True if the new measure satisfies threshold, False otherwise

    """

    sign = 1.0 if direction == 'higher' else -1.0

    if sign * (new_measure - old_measure) / old_measure < threshold:
        return True
    else:
        return False