parent
aa6a8e03b3
commit
e7a16c663a
@ -1 +1 @@
|
||||
`go install git.tijl.dev/tijl/stopwatch`
|
||||
`go install git.tijl.dev/tijl/stopwatch@latest`
|
||||
|
2
main.go
2
main.go
@ -137,12 +137,14 @@ func timerUI(startTime time.Time) {
|
||||
|
||||
go func() {
|
||||
<-stop
|
||||
fmt.Printf("\n")
|
||||
os.Exit(0)
|
||||
}()
|
||||
|
||||
for {
|
||||
elapsed := time.Until(startTime)
|
||||
if elapsed.Milliseconds() == 0 {
|
||||
fmt.Printf("\n")
|
||||
break
|
||||
}
|
||||
fmt.Printf("\r%02dd %02dh %02dm %02ds %03dms",
|
||||
|
Loading…
x
Reference in New Issue
Block a user