Skip to content

Commit 708af25

Browse files
committed
Adding execution time to kfxdump
1 parent b09e90f commit 708af25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/debug/kfxdump/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"slices"
1010
"strconv"
1111
"strings"
12+
"time"
1213

1314
"github.com/h2non/filetype"
1415

@@ -30,6 +31,11 @@ func main() {
3031
os.Exit(2)
3132
}
3233

34+
defer func(startedAt time.Time) {
35+
duration := time.Since(startedAt)
36+
fmt.Fprintf(os.Stderr, "\nExecution time: %s\n", duration)
37+
}(time.Now())
38+
3339
path := flag.Arg(0)
3440
b, err := os.ReadFile(path)
3541
if err != nil {

0 commit comments

Comments
 (0)