def METHOD_NAME(session, is_hardware=False):
    """
    Verify timedrift between host and guest.
    :param session: VM session.
    :param is_hardware: if need to verify guest's hardware time.
    """
    # Command to run to get the current time
    time_command = params["time_command"]
    # Filter which should match a string to be passed to time.strptime()
    time_filter_re = params["time_filter_re"]
    # Time format for time.strptime()
    time_format = params["time_format"]
    timerdevice_drift_threshold = float(params.get(
        "timerdevice_drift_threshold", 3))
    time_type = "system" if not is_hardware else "harware"
    error_context.context("Check the %s time on guest" % time_type,
                          test.log.info)
    host_time, guest_time = utils_test.get_time(session, time_command,
                                                time_filter_re,
                                                time_format)
    if is_hardware:
        guest_time = get_hwtime(session)
    drift = abs(float(host_time) - float(guest_time))
    if drift > timerdevice_drift_threshold:
        test.fail("The guest's %s time is different with"
                  " host's system time. Host time: '%s', guest time:"
                  " '%s'" % (time_type, host_time, guest_time))