derp: use tstime (#8634)

Updates #8587

Signed-off-by: Claire Wang <claire@tailscale.com>
This commit is contained in:
Claire Wang
2023-07-27 15:56:33 -04:00
committed by GitHub
parent 2315bf246a
commit 90a7d3066c
8 changed files with 43 additions and 27 deletions

View File

@ -27,13 +27,13 @@ func (c *sclient) statsLoop(ctx context.Context) error {
const statsInterval = 10 * time.Second
ticker := time.NewTicker(statsInterval)
ticker, tickerChannel := c.s.clock.NewTicker(statsInterval)
defer ticker.Stop()
statsLoop:
for {
select {
case <-ticker.C:
case <-tickerChannel:
rtt, err := tcpinfo.RTT(conn)
if err != nil {
continue statsLoop