+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; timing
+
+(define (profile-measurements)
+ (let* ((t (times))
+ (stats (gc-stats)))
+
+ (list
+ (- (tms:utime t)
+ (ly:assoc-get 'gc-time-taken stats))
+
+ ;; difficult to put memory amount stats into here.
+
+ )))
+
+(define (dump-profile name last this)
+ (let*
+ ((outname (format "~a.profile" (basename name ".ly")))
+ (diff (map (lambda (y) (apply - y)) (zip this last))))
+
+ (ly:progress "\nWriting timing to ~a..." outname)
+ (format (open-file outname "w")
+ "time: ~a"
+ (car diff))))
+