From fef7b7b508410aa4c83e7c2825287b3dc313229a Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Thu, 29 Aug 2013 11:23:28 -0400 Subject: [PATCH] Fix timing in class type-checking (make sure the timing goes away if the flag is off) original commit: ee3e83856c6f6973c29ada0c809a5ecb50d871aa --- .../typed-racket/typecheck/check-class-unit.rkt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt index 2415bdfc..edb2d807 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt @@ -43,9 +43,14 @@ e ...)) #'(begin e ...))])) -(define (do-timestamp [str ""]) - (log-info (format "TR class time @ ~a: ~a" - str (- (current-inexact-milliseconds) (start-time))))) +(define-syntax (do-timestamp stx) + (syntax-case stx () + [(_ str) + (if (syntax-local-value #'do-timing) + #'(log-info + (format "TR class time @ ~a: ~a" + str (- (current-inexact-milliseconds) (start-time)))) + #'(void))])) ;; Syntax classes for use in functions below (define-syntax-class name-pair