]> git.donarmstrong.com Git - lilypond.git/commitdiff
only call profile-measurements when appropriate.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 2 Jan 2007 12:56:53 +0000 (13:56 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 2 Jan 2007 12:56:53 +0000 (13:56 +0100)
scm/lily.scm

index 373012008b1b2279cc4c9ce29fa759404b565755..8f2b1e1873a41473f75c7dbc107769d3e3511d81 100644 (file)
@@ -357,7 +357,7 @@ The syntax is the same as `define*-public'."
 (define (profile-measurements)
   (let* ((t (times))
         (stats (gc-stats)))
-
+    
     (list
      (- (tms:utime t)
        (ly:assoc-get 'gc-time-taken stats))
@@ -568,7 +568,7 @@ The syntax is the same as `define*-public'."
        ))
   
   (let* ((failed '())
-        (start-measurements #f)
+        (start-measurements (ly:get-option 'profile-measurements))
         (handler (lambda (key failed-file)
                    (set! failed (append (list failed-file) failed)))))
 
@@ -576,7 +576,8 @@ The syntax is the same as `define*-public'."
      (lambda (x)
 
        (gc)
-       (set! start-measurements (profile-measurements))
+       (if start-measurements
+          (set! start-measurements (profile-measurements)))
        (lilypond-file handler x)
        (if (ly:get-option 'dump-profile)
           (dump-profile x start-measurements (profile-measurements)))