Feature/rand init (#4)

* tiny rand init

* init rand

Co-authored-by: Oleg <o.musin@tinkoff.ru>
This commit is contained in:
Oleg 2021-06-22 02:51:56 +03:00 committed by GitHub
parent 0b5fa4d152
commit b9ee7d413c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -2,16 +2,19 @@ package main
import (
"flag"
"github.com/valyala/fasthttp"
"log"
"math/rand"
"strconv"
"time"
"github.com/valyala/fasthttp"
)
var serverPort = flag.Int("p", 8080, "port to use for benchmarks")
func main() {
flag.Parse()
rand.Seed(time.Now().UnixNano())
addr := "localhost:" + strconv.Itoa(*serverPort)
log.Println("Starting HTTP server on:", addr)
log.Fatalln(fasthttp.ListenAndServe(addr, func(c *fasthttp.RequestCtx) {