import requests


def check_status(address, text):
    """Sends request to address and checks if text is present in reponse

    Args:
        address (str): site address
        text (str): text to be checked in responce

    Returns:
        (status, elapsed): (tuple (str, int)) with status, and responce time
    """

    elapsed = 0
    try:
        r = requests.get(address)
    except requests.ConnectionError:
        status = "Error: CONNECTION_ERROR"
    except Exception as e:
        status = 'Error: {}'.format(str(e))
    else:
        if r.status_code == 200:
            status = 'OK' if text in r.text else 'Error: CON_OK_MISSING_TEXT'
        else:
            status = 'Error: {}'.format(r.status_code)
        elapsed = r.elapsed.total_seconds()

    return status, elapsed