CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 14:30:04 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=7bb9b843f6303e475bbac5f09fb0b3711acc56317e9452645ba5906a64e2172fa%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22I6lNAdLLdu3mk5QlKJpfqvy9xl9Bdpv8%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cf0da0eb349ac4-BLR
Un assaggio di Go - Video 10 - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "net/http"
- "sync"
- "time"
- )
- func main() {
- numeroRichieste := 1000
- start := time.Now()
- // for i := 0; i < numeroRichieste; i++ {
- // resp, err := http.Get("https://httpbin.org/delay/1")
- // if err != nil {
- // fmt.Println("Errore:", err)
- // continue
- // }
- // resp.Body.Close()
- // fmt.Printf("Richiesta %d completata\n", i+1)
- // }
- elapsed := time.Since(start)
- //fmt.Printf("Tempo totale senza goroutine: %s\n", elapsed)
- start = time.Now()
- var wg sync.WaitGroup
- wg.Add(numeroRichieste)
- contatore := 0
- var mu sync.Mutex
- for i := 0; i < numeroRichieste; i++ {
- go func(i int) {
- defer wg.Done()
- mu.Lock()
- contatore++
- mu.Unlock()
- resp, err := http.Get("https://httpbin.org/delay/1")
- if err != nil {
- fmt.Printf("Errore nella richiesta %d: %v\n", i+1, err)
- return
- }
- resp.Body.Close()
- //fmt.Printf("Richiesta %d completata\n", i+1)
- }(i)
- }
- wg.Wait()
- elapsed = time.Since(start)
- fmt.Printf("Tempo totale con goroutine: %s\n", elapsed)
- fmt.Println("Contatore ", contatore)
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Trading Profit Method ✅ NEVER SEEN BEFORE...
JavaScript | 7 sec ago | 0.24 KB
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 16 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ⭐⭐ A
JavaScript | 21 sec ago | 0.24 KB
-
⭐⭐⭐Exploit 500$ in 15 Minutes⭐⭐
Java | 22 sec ago | 0.10 KB
-
⭐✅ MAKE $2000 INSTANTLY ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 25 sec ago | 0.24 KB
-
⭐✅ MAKE $2500 IN 15 MIN⭐⭐⭐ 6
JavaScript | 32 sec ago | 0.24 KB
-
⭐ Free Crypto Method ✅ NEVER SEEN BEFORE ⭐⭐⭐
JavaScript | 34 sec ago | 0.24 KB
-
⭐✅ Exploit 2500$ in 15 Minutes⭐⭐⭐ 3
JavaScript | 43 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand