Rudolf Adamkovič Personal site


Average exercise duration

… is the artihmetic mean of all exercise durations

\[\begin{equation*}
  \frac{\sum_{d \in D} f(d)}{60 \thinspace |D|}
  \approx
  \boxed{42.29} \, \text{minutes},
\end{equation*}
\]

computed by

(defun my-average-exercise-duration ()
  "Return the average exercise duration in minutes."
  (let ((log (my-exercise-log)))
    (format "%0.2f"
            (/ (let ((total-duration 0))
                 (maphash (lambda (day duration)
                            (setq total-duration
                                  (+ total-duration duration)))
                          log)
                 total-duration)
               (* 60 (hash-table-count log))))))

© 2024 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and the secret alien technologies of yesteryear.