Skip to content

Commit

Permalink
Print current time
Browse files Browse the repository at this point in the history
  • Loading branch information
danroc committed Nov 1, 2018
1 parent 5ef0e3c commit fb8e6b9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion htp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit fb8e6b9

Please # to comment.