From fb8e6b99ceec8aa8561c2488a18187c52c74a027 Mon Sep 17 00:00:00 2001 From: Daniel Rocha Date: Thu, 1 Nov 2018 13:36:52 +0100 Subject: [PATCH] Print current time --- htp.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htp.go b/htp.go index 2ce6a68..d6b1e9e 100644 --- a/htp.go +++ b/htp.go @@ -37,5 +37,12 @@ func main() { lo = math.Max(lo, d0-1) hi = math.Min(hi, d1) } - fmt.Println((hi + lo) / 2) + offset := (hi + lo) / 2 + margin := (hi - lo) / 2 + now := time.Now(). + Add(time.Duration(-offset * 1e9)). + Format(time.RFC3339Nano) + + fmt.Printf("%s\n", now) + fmt.Printf("offset: %.3f (± %.3f) sec.\n", offset, margin) }