From 23d5036095e5872b1df1968cea273c93ef759b72 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 18 Jun 2015 16:39:13 -0400 Subject: [PATCH] Use time-apply rather than current-inexact-milliseconds --- observe-all-minimart.rkt | 9 ++++----- observe-all-prospect.rkt | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/observe-all-minimart.rkt b/observe-all-minimart.rkt index 496a6f0..168b767 100644 --- a/observe-all-minimart.rkt +++ b/observe-all-minimart.rkt @@ -26,11 +26,10 @@ (gestalt-union (pub (presence id)) (sub (presence ?) #:level 1)))) - (define start-time (current-inexact-milliseconds)) - (run-ground (for/list [(id (in-range peer-count))] (peer id))) - (define stop-time (current-inexact-milliseconds)) - (define delta (- stop-time start-time)) - (values routing-update-count delta)) + (define boot-actions (for/list [(id (in-range peer-count))] (peer id))) + (define-values (results cpu-time wall-clock-time gc-time) + (time-apply (lambda () (run-ground boot-actions)) '())) + (values routing-update-count (max 1 (- cpu-time gc-time)))) (module+ main (define E (standard-logbook-entry (default-logbook #:verbose? #t) "minimart" "observe-all-minimart")) diff --git a/observe-all-prospect.rkt b/observe-all-prospect.rkt index 3e8e41e..71280eb 100644 --- a/observe-all-prospect.rkt +++ b/observe-all-prospect.rkt @@ -26,11 +26,10 @@ (pub (presence id)) (sub (advertise (presence ?))))) - (define start-time (current-inexact-milliseconds)) - (run-ground (for/list [(id (in-range peer-count))] (peer id))) - (define stop-time (current-inexact-milliseconds)) - (define delta (- stop-time start-time)) - (values routing-update-count delta)) + (define boot-actions (for/list [(id (in-range peer-count))] (peer id))) + (define-values (results cpu-time wall-clock-time gc-time) + (time-apply (lambda () (run-ground boot-actions)) '())) + (values routing-update-count (max 1 (- cpu-time gc-time)))) (module+ main (define E (standard-logbook-entry (default-logbook #:verbose? #t) "minimart" "observe-all-prospect"))