needsUpdate method

bool needsUpdate(
  1. DistanceVectorRoutingTable<T> routingTable,
  2. DateTime currentTime
)

Checks if routing table needs updating based on time intervals

routingTable - Current routing table currentTime - Current time for comparison

Returns true if update is needed

Implementation

bool needsUpdate(
  DistanceVectorRoutingTable<T> routingTable,
  DateTime currentTime,
) {
  return currentTime.difference(routingTable.lastUpdate) >= updateInterval;
}