How to convert int variable to time.Duration in Go

1 Answer

0 votes
package main
  
import (
    "fmt"
    "time"
)
  
func main() {
    var N int = 10

    fmt.Println(time.Duration(N))
}



/*
run:

10ns

*/

 



answered Aug 13, 2020 by avibootz

Related questions

1 answer 134 views
134 views asked Aug 13, 2020 by avibootz
1 answer 96 views
1 answer 111 views
1 answer 169 views
1 answer 169 views
169 views asked May 18, 2025 by avibootz
1 answer 158 views
...