And waits for them. That's pointless.
{
    time_t min_unprocessed_insert_time = 0;
    time_t max_processed_insert_time = 0;
    queue.getInsertTimes(min_unprocessed_insert_time, max_processed_insert_time);
    
    
    time_t queue_update_start_time = last_queue_update_start_time.load();
    time_t queue_update_finish_time = last_queue_update_finish_time.load();
    time_t current_time = time(nullptr);
    if (!queue_update_finish_time)
    {
        
        
        return current_time;
    }
    else if (min_unprocessed_insert_time)
    {
        
        return (current_time > min_unprocessed_insert_time) ? (current_time - min_unprocessed_insert_time) : 0;
    }
    else if (queue_update_start_time > queue_update_finish_time)
    {
        
        
        
        return (current_time > queue_update_start_time) ? (current_time - queue_update_start_time) : 0;
    }