Answers for "golang sleep"

Go
1

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())
}
Posted by: Guest on November-28-2020

Browse Popular Code Answers by Language