Files
advent-of-code-2021/utils/timer/timer.go
T

19 lines
220 B
Go

package timer
import (
"fmt"
"time"
)
var lastTime time.Time
func Start() {
lastTime = time.Now()
}
func Tick() {
now := time.Now()
fmt.Printf("[Time taken: %s]\n", now.Sub(lastTime).String())
lastTime = now
}