From 6f16086fb0d0d588e37821330516af094d73e76d Mon Sep 17 00:00:00 2001 From: Tamer Tas Date: Mon, 27 Feb 2017 10:05:43 +0300 Subject: [PATCH] profiling/timing: elaborate on deferred function evaluation --- profiling/timing.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/profiling/timing.md b/profiling/timing.md index 2413a85..575356a 100644 --- a/profiling/timing.md +++ b/profiling/timing.md @@ -26,6 +26,8 @@ func Duration(invocation time.Time, name string) { ```go func BigIntFactorial(x big.Int) *big.Int { + // Arguments to a defer statement is immediately evaluated and stored. + // The deferred function receives the pre-evaluated values when its invoked. defer profile.Duration(time.Now(), "IntFactorial") y := big.NewInt(1)