design/12914-monotonic: fix example in comment
t.Sub(u) would be -20 milliseconds.
The right computation is u.Sub(t), but rewrite to be even clearer.
Thanks to Karsten Weiss for catching this.
Change-Id: I5c87ce3bbaa9a05402b0534e6ed2474848062c2a
Reviewed-on: https://go-review.googlesource.com/46970
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/design/12914-monotonic.md b/design/12914-monotonic.md
index c3246c1..b4d1d4f 100644
--- a/design/12914-monotonic.md
+++ b/design/12914-monotonic.md
@@ -333,10 +333,10 @@
> approximately 20 milliseconds, even if the wall clock is reset
> during the operation being timed:
>
-> t := time.Now()
+> start := time.Now()
> ... operation that takes 20 milliseconds ...
-> u := time.Now()
-> elapsed := t.Sub(u)
+> t := time.Now()
+> elapsed := t.Sub(start)
>
> Other idioms, such as time.Since(start), time.Until(deadline),
> and time.Now().Before(deadline), are similarly robust against