golang sleep
package main
import (
"fmt"
"time"
)
func main() {
fmt.Printf("Current Unix Time: %v\n", time.Now().Unix())
time.Sleep(2 * time.Second)
fmt.Printf("Current Unix Time: %v\n", time.Now().Unix())
}
golang sleep
package main
import (
"fmt"
"time"
)
func main() {
fmt.Printf("Current Unix Time: %v\n", time.Now().Unix())
time.Sleep(2 * time.Second)
fmt.Printf("Current Unix Time: %v\n", time.Now().Unix())
}
sleep n seconds in go
/*
this is golang code but the
java syntax highlighting was
good, so yeah
*/
package main
import (
"fmt"
"time"
)
func main() {
for i := 1; i <= 5; i++ {
fmt.Println(i)
time.Sleep(1 * time.Second) // for 1 second
time.Sleep(1 * time.Millisecond) // for 1 millisecond
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us