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:
@@ -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...)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user