optimize edit-tool rendering (#463)

Co-authored-by: opencode <noreply@opencode.ai>
Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com>
This commit is contained in:
Gal Schlezinger
2025-06-28 14:01:10 +03:00
committed by GitHub
parent 7b394b91e2
commit f618e569ab
4 changed files with 88 additions and 9 deletions

View File

@@ -1,8 +1,10 @@
package util
import (
"log/slog"
"os"
"strings"
"time"
tea "github.com/charmbracelet/bubbletea/v2"
)
@@ -35,3 +37,11 @@ func IsWsl() bool {
return false
}
func Measure(tag string) func(...any) {
startTime := time.Now()
return func(tags ...any) {
args := append([]any{"timeTakenMs", time.Since(startTime).Milliseconds()}, tags...)
slog.Info(tag, args...)
}
}