Add unified delay

This commit is contained in:
Sergei Maklagin
2025-06-15 19:24:09 +03:00
parent 7c4c2d5ca8
commit 6272596ebc
5 changed files with 39 additions and 4 deletions

View File

@@ -122,6 +122,15 @@ func URLTest(ctx context.Context, link string, detour N.Dialer) (t uint16, err e
return
}
resp.Body.Close()
if IsUnifiedDelayFromContext(ctx) {
second := time.Now()
resp, err = client.Do(req)
if err != nil {
return
}
resp.Body.Close()
start = second
}
t = uint16(time.Since(start) / time.Millisecond)
return
}