From b4010123f74470eeca0551a151dea3e7a7381bcc Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 3 Aug 2019 19:05:53 +0200 Subject: [PATCH] tun: windows: spin for only a millisecond/80 Performance stays the same as before. --- tun/tun_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tun/tun_windows.go b/tun/tun_windows.go index 30518c6..b0faed8 100644 --- a/tun/tun_windows.go +++ b/tun/tun_windows.go @@ -215,7 +215,7 @@ retry: if tun.close { return 0, os.ErrClosed } - if time.Since(start) >= time.Millisecond*50 { + if time.Since(start) >= time.Millisecond/80 /* ~1gbit/s */ { windows.WaitForSingleObject(tun.rings.send.tailMoved, windows.INFINITE) goto retry }