diff options
author | Tamir Duberstein <tamird@google.com> | 2021-05-26 06:47:52 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-05-26 06:49:57 -0700 |
commit | fcad6f91a3f292b6b76be10f03baf05ee5245d3d (patch) | |
tree | fa383878218fe0c69c5c346a08cfd953e398ee2d /pkg/tcpip/tcpip.go | |
parent | b63e61828d0652ad1769db342c17a3529d2d24ed (diff) |
Use the stack clock everywhere
Updates #5939.
Updates #6012.
RELNOTES: n/a
PiperOrigin-RevId: 375931554
Diffstat (limited to 'pkg/tcpip/tcpip.go')
-rw-r--r-- | pkg/tcpip/tcpip.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/tcpip.go b/pkg/tcpip/tcpip.go index ca98da847..91622fa4c 100644 --- a/pkg/tcpip/tcpip.go +++ b/pkg/tcpip/tcpip.go @@ -76,6 +76,11 @@ func (mt MonotonicTime) Before(u MonotonicTime) bool { return mt.nanoseconds < u.nanoseconds } +// After reports whether the monotonic clock reading mt is after u. +func (mt MonotonicTime) After(u MonotonicTime) bool { + return mt.nanoseconds > u.nanoseconds +} + // Add returns the monotonic clock reading mt+d. func (mt MonotonicTime) Add(d time.Duration) MonotonicTime { return MonotonicTime{ |