mirror of
https://github.com/RussellChamp/advent-of-code-2021.git
synced 2026-10-27 21:52:32 +00:00
day 14 and 15
This commit is contained in:
1 parent
6e22bbe567
commit
4737afa383
12 files changed
+678
-3
No files matched your search
+11
-1
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user