Feature/rand init (#4)
* tiny rand init * init rand Co-authored-by: Oleg <o.musin@tinkoff.ru>
This commit is contained in:
parent
0b5fa4d152
commit
b9ee7d413c
|
@ -2,16 +2,19 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"github.com/valyala/fasthttp"
|
|
||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/valyala/fasthttp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var serverPort = flag.Int("p", 8080, "port to use for benchmarks")
|
var serverPort = flag.Int("p", 8080, "port to use for benchmarks")
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
rand.Seed(time.Now().UnixNano())
|
||||||
addr := "localhost:" + strconv.Itoa(*serverPort)
|
addr := "localhost:" + strconv.Itoa(*serverPort)
|
||||||
log.Println("Starting HTTP server on:", addr)
|
log.Println("Starting HTTP server on:", addr)
|
||||||
log.Fatalln(fasthttp.ListenAndServe(addr, func(c *fasthttp.RequestCtx) {
|
log.Fatalln(fasthttp.ListenAndServe(addr, func(c *fasthttp.RequestCtx) {
|
||||||
|
|
Loading…
Reference in New Issue