mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
* src/scm/depend.scm (gnc:depend): add optional timing facility.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4731 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
5ab671c635
commit
74162820f5
@ -25,7 +25,20 @@
|
||||
(hash-set! gnc:*_supported-files_* name #t))
|
||||
|
||||
(define (gnc:depend name)
|
||||
(let ((supported? (hash-ref gnc:*_supported-files_* name)))
|
||||
(let ((supported? (hash-ref gnc:*_supported-files_* name))
|
||||
(time-load? #t))
|
||||
(if supported?
|
||||
#t
|
||||
(gnc:load name))))
|
||||
(if time-load?
|
||||
(let* ((start-time (gettimeofday))
|
||||
(result (gnc:load name))
|
||||
(end-time (gettimeofday)))
|
||||
|
||||
(simple-format #t
|
||||
"~A elapsed load time for ~A\n"
|
||||
(+ (- (car end-time) (car start-time))
|
||||
(/ (- (cdr end-time) (cdr start-time))
|
||||
1000000))
|
||||
name)
|
||||
result)
|
||||
(gnc:load name)))))
|
||||
|
Loading…
Reference in New Issue
Block a user