You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
channel := make(chan time.Duration)
|
|
|
|
fmt.Scanln()
|
|
start := time.Now()
|
|
|
|
go func () {
|
|
for {
|
|
channel <- time.Now().Sub(start)
|
|
}
|
|
}()
|
|
|
|
for {
|
|
select {
|
|
case t := <- channel:
|
|
fmt.Printf("%s%s%s\n", t, "\033[B", "\033[A")
|
|
}
|
|
}
|
|
}
|