Skip to content

Instantly share code, notes, and snippets.

@cjvirtucio87
Created February 13, 2018 13:26
Show Gist options
  • Save cjvirtucio87/6d42bdd96b5d857eba66ba669aed0fe5 to your computer and use it in GitHub Desktop.
Save cjvirtucio87/6d42bdd96b5d857eba66ba669aed0fe5 to your computer and use it in GitHub Desktop.
start := time.Now()
getElapsed := func (start time.Time) {
elapsed := time.Now().Sub(start).Seconds()
log.Printf("Completed in %s seconds.", strconv.FormatFloat(elapsed, 'E', -1, 64))
}
defer getElapsed(start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment