mirror of
https://github.com/RussellChamp/advent-of-code-2021.git
synced 2026-10-27 21:52:32 +00:00
improved template added timer
This commit is contained in:
1 parent
f6f6a849ec
commit
2992d3ba43
4 files changed
+62
-21
No files matched your search
@@ -0,0 +1,18 @@
|
||||
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
|
||||
}
|
||||
Reference in new issue
Block a user