public boolean hasElectionTimeoutExpired(long currentTimeMs) {
        electionTimer.update(currentTimeMs);
        return electionTimer.isExpired();
    }
Check whether the timeout has expired.

@param currentTimeMs current time in milliseconds
@return true if the timeout has expired, false otherwise
raft/src/main/java/org/apache/kafka/raft/ResignedState.java