forked from quic-go/quic-go
implement a memory-optimized time.Time replacement (#5334)
* implement a memory-optimized time.Time replacement * monotime: properly handle systems with bad timer resolution (Windows) * monotime: simplify Since
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/quic-go/quic-go/internal/monotime"
|
||||
"github.com/quic-go/quic-go/internal/protocol"
|
||||
"github.com/quic-go/quic-go/internal/wire"
|
||||
|
||||
@@ -25,7 +26,7 @@ func TestPacketQueue(t *testing.T) {
|
||||
}
|
||||
|
||||
require.Empty(t, getPackets())
|
||||
now := time.Now()
|
||||
now := monotime.Now()
|
||||
|
||||
q.Add(packetEntry{Time: now, Raw: []byte("p3")})
|
||||
require.Equal(t, []string{"p3"}, getPackets())
|
||||
|
||||
Reference in New Issue
Block a user