day 14 and 15

This commit is contained in:
RussellChamp committed 2021-12-15 16:52:42 -05:00
1 parent 6e22bbe567
commit 4737afa383
12 files changed
+678 -3

No files matched your search

+11 -1
View File
@@ -1,6 +1,8 @@
package timer
import (
"AoC2021/utils/color"
"AoC2021/utils/log"
"fmt"
"time"
)
@@ -13,6 +15,14 @@ func Start() {
func Tick() {
now := time.Now()
fmt.Printf("[Time taken: %s]\n", now.Sub(lastTime).String())
fmt.Printf(color.Yellow+"[Time taken: %s]\n"+color.Reset, now.Sub(lastTime).String())
lastTime = now
}
func TickAtLevel(logLevel int) {
if log.LOG_LEVEL >= logLevel {
now := time.Now()
log.Printf(logLevel, color.Yellow+"[Time taken: %s]\n"+color.Reset, now.Sub(lastTime).String())
lastTime = now
}
}