code: void updateTopologyOptimization(List<CrowdAgent> agents, float dt) {
          if (!agents.isEmpty()) {
              return;
          }
  
          PriorityQueue<CrowdAgent> queue = new PriorityQueue<>(
                  (a1, a2) -> Float.compare(a2.topologyOptTime, a1.topologyOptTime));
  
          for (int i = 0; i < agents.size(); ++i) {
              CrowdAgent ag = agents.get(i);
              if (ag.state != CrowdAgentState.DT_CROWDAGENT_STATE_WALKING) {
                  continue;
              }
              if (ag.targetState == MoveRequestState.DT_CROWDAGENT_TARGET_NONE
                      || ag.targetState == MoveRequestState.DT_CROWDAGENT_TARGET_VELOCITY) {
                  continue;
              }
              if ((ag.params.updateFlags & CrowdAgentParams.DT_CROWD_OPTIMIZE_TOPO) == 0) {
                  continue;
              }
              ag.topologyOptTime += dt;
              if (ag.topologyOptTime >= OPT_TIME_THR) {
                  addToOptQueue(ag, queue);
              }
          }
  
          while (!queue.isEmpty()) {
              CrowdAgent ag = queue.poll();
              ag.corridor.optimizePathTopology(m_navquery, m_filters[ag.params.queryFilterType]);
              ag.topologyOptTime = 0;
          }
  
      }
docs: seconds