updates
All checks were successful
build / build (push) Successful in 10s

This commit is contained in:
Tijl 2024-09-27 17:56:15 +02:00
parent aa6a8e03b3
commit e7a16c663a
Signed by: tijl
GPG Key ID: DAE24BFCD722F053
2 changed files with 3 additions and 1 deletions

View File

@ -1 +1 @@
`go install git.tijl.dev/tijl/stopwatch` `go install git.tijl.dev/tijl/stopwatch@latest`

View File

@ -137,12 +137,14 @@ func timerUI(startTime time.Time) {
go func() { go func() {
<-stop <-stop
fmt.Printf("\n")
os.Exit(0) os.Exit(0)
}() }()
for { for {
elapsed := time.Until(startTime) elapsed := time.Until(startTime)
if elapsed.Milliseconds() == 0 { if elapsed.Milliseconds() == 0 {
fmt.Printf("\n")
break break
} }
fmt.Printf("\r%02dd %02dh %02dm %02ds %03dms", fmt.Printf("\r%02dd %02dh %02dm %02ds %03dms",