Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "time"
- )
- func main() {
- start := time.Now()
- // Escrever um array de string com 1000 elementos no console
- var arr [1000]string
- for i := 0; i < 1000; i++ {
- arr[i] = "linha " + fmt.Sprintf("%d", i+1)
- }
- fmt.Println(arr)
- elapsed := time.Since(start)
- fmt.Printf("Tempo de execução em segundos: %.6f", elapsed.Seconds())
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement