def _base(last, now, lap, offset, multiple, attr):
    """
    last - last datetime
    now - current datetime
    lap - at what point to "roll over"
    offset - how many seconds between laps
    attr - what to look at
    multiple - what to multiply attr by to get seconds
    """
    # last started before :X, so if now > :X

    # handle windows timestamp issues
    try:
        now_ts = now.timestamp()
    except OSError:
        now_ts = 0
    try:
        last_ts = last.timestamp()
    except OSError:
        last_ts = 0

    diff = round(now_ts, 0) - round(last_ts, 0)
    min_gap = offset - getattr(last, attr) * multiple
    if diff > offset:
        return True
    if getattr(last, attr) < lap:
        if getattr(now, attr) >= lap:
            return True
        return False
    # last started after :X, so if now > last + interval, or if now > :X
    elif getattr(now, attr) >= lap and diff >= min_gap:
        return True
    return False