github.com/apernet/quic-go@v0.43.1-0.20240515053213-5e9e635fd9f0/internal/congestion/clock.go (about)

     1  package congestion
     2  
     3  import "time"
     4  
     5  // A Clock returns the current time
     6  type Clock interface {
     7  	Now() time.Time
     8  }
     9  
    10  // DefaultClock implements the Clock interface using the Go stdlib clock.
    11  type DefaultClock struct{}
    12  
    13  var _ Clock = DefaultClock{}
    14  
    15  // Now gets the current time
    16  func (DefaultClock) Now() time.Time {
    17  	return time.Now()
    18  }