                                 based-on-closed-child))
         ;; Lines 302-305
         actual-next (max based-on-closed-child recent)
+        mid-time (System/nanoTime)
+        alt (cond-> default-next
+              (= want-ping ::specs/second-1) (do (+ recent (utils/seconds->nanos 1)))
+              (= want-ping ::specs/immediate) (min min-resend-time)
+              ;; If the outgoing buffer is not full
+              ;; And:
+              ;;   If sendeof, but not sendeofprocessed
+              ;;   else (!sendeof):
+              ;;     if there are buffered bytes that have not been sent yet
+              (let [un-ackd-count (count un-ackd-blocks)
+                    un-sent-count(count un-sent-blocks)]
+                (and (< (+ un-ackd-count
+                           un-sent-count)
+                        K/max-outgoing-blocks)
+                     (if send-eof
+                       (not send-eof-processed)
+                       (< 0 un-sent-count)))) (min min-resend-time)
+              (and (not= 0 earliest-time)
+                   (>= rtt-resend-time min-resend-time)) (min rtt-resend-time))
         end-time (System/nanoTime)]
     (log/debug (utils/pre-log message-loop-name)
-               (cl-format nil "Calculating next scheduled time took ~:d nanoseconds"
-                          (- end-time now)))
+               (cl-format nil "Calculating next scheduled time took ~:d nanoseconds and calculated ~:d. Alt approach took ~:d and calculated ~:d"
+                          (- mid-time now)
+                          actual-next
+                          (- end-time mid-time)
+                          alt))
     actual-next))
 
 ;;; I really want to move schedule-next-timeout to flow-control.

                                next-based-on-eof))
        ;; Lines 293-296
        rtt-resend-time (+ earliest-time rtt-timeout)
        next-based-on-earliest-block-time (if (and (not= 0 earliest-time)
                                                   (> rtt-resend-time
                                                      min-resend-time))

    :keys [::specs/message-loop-name
           ::specs/recent]
    :as state}]
  ;;; This amounts to lines 286-305

  ;; I should be able to just completely bypass this if there's
  ;; more new data pending.
  ;; TODO: Figure out how to make that work
