4 ms·
Measuring elapsed time in golang is as easy as: start := time.Now() // Code to measure duration := time.Since(start) See the docs for a good write
by alophawen 5y ago
Measuring elapsed time in golang is as easy as:
start := time.Now()
// Code to measure
duration := time.Since(start)
See the docs for a good write-up: https://pkg.go.dev/time#hdr-Monotonic_Clocks https://pkg.go.dev/time#hdr-Monotonic_Clocks
In rust you use https://doc.rust-lang.org/std/time/struct.Instant.html https://doc.rust-lang.org/std/time/struct.Instant.html
- deleted 5y ago[deleted]