This commit is contained in:
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() {
|
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",
|
||||||
|
Loading…
Reference in New Issue
Block a user