Skip to content

Commit

Permalink
Added TimeTrack
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir2217 committed Jan 3, 2025
1 parent 9f38bfc commit b156a78
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Misc/Profiling.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package Misc

import (
"encoding/json"
"log"
"time"
)

func TimeTrack(start time.Time, name string, data map[any]any, logger *log.Logger) {
elapsed := time.Since(start)
datajson, _ := json.Marshal(data)
logger.Printf("%s took %s", name, elapsed)
logger.Printf("Data: %s", string(datajson))
}

0 comments on commit b156a78

Please sign in to comment.