def duration_expired ( start_time , duration_seconds ) : if duration_seconds is not None : delta_seconds = datetime_delta_to_seconds ( dt . datetime . now ( ) - start_time ) if delta_seconds >= duration_seconds : return True return False
how to check python timestamp older than 5 minutes
Return True if duration_seconds have expired since start_time
def duration_expired(start_time, duration_seconds):
    """
    Return True if ``duration_seconds`` have expired since ``start_time``
    """

    if duration_seconds is not None:
        delta_seconds = datetime_delta_to_seconds(dt.datetime.now() - start_time)

        if delta_seconds >= duration_seconds:
            return True

    return False