add ramp and change seconds to microseconds

This commit is contained in:
cubixle
2021-08-04 19:36:59 +01:00
parent cb8d79fca3
commit 4cde4072b9
6 changed files with 37 additions and 27 deletions
+4 -1
View File
@@ -17,12 +17,15 @@ func DefaultHTTPTester(target string) *Result {
return result
}
req.Header.Add("accept-encoding", "gzip, deflate, br")
req.Header.Add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0")
startTime := time.Now()
rsp, err := client.Do(req)
if err != nil {
result.Error = err
}
result.CompletedIn = time.Since(startTime).Seconds()
result.CompletedIn = float64(time.Since(startTime).Milliseconds())
result.StatusCode = rsp.StatusCode
return result