Home / Personal / Exercise log
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{AVERAGE-EXERCISE-DURATION} \, \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))))))