Skip to content

Glossary: Data Structures and Algorithms in Go

time.Now and time.Since

Also written: time.Now, time.Since, timing code

Go's way to time code: `time.Now()` reads the clock, and `time.Since(start)` gives the elapsed time as a duration that prints with its unit, such as `2.9ms`.

Where the book teaches it

Related terms

StepsBig-O notation