github.com/mailru/activerecord@v1.12.2/pkg/iproto/util/time/monotonic.go (about) 1 package time 2 3 import "time" 4 5 type MonotonicTimestamp timestamp 6 7 func (m MonotonicTimestamp) Add(d time.Duration) MonotonicTimestamp { 8 return MonotonicTimestamp(timestamp(m).add(d)) 9 } 10 11 func (m MonotonicTimestamp) Sub(u MonotonicTimestamp) time.Duration { 12 return timestamp(m).sub(timestamp(u)) 13 } 14 15 func (m MonotonicTimestamp) Equal(u MonotonicTimestamp) bool { 16 return timestamp(m).equal(timestamp(u)) 17 } 18 19 func (m MonotonicTimestamp) Before(u MonotonicTimestamp) bool { 20 return timestamp(m).before(timestamp(u)) 21 } 22 23 func (m MonotonicTimestamp) After(u MonotonicTimestamp) bool { 24 return timestamp(m).after(timestamp(u)) 25 }