github.com/kelleygo/clashcore@v1.0.2/transport/tuic/congestion_v2/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  }