package monotime

Import Path
	github.com/quic-go/quic-go/internal/monotime (on go.dev)

Dependency Relation
	imports one package, and imported by 5 packages

Involved Source Files Package monotime provides a monotonic time representation that is useful for measuring elapsed time. It is designed as a memory optimized drop-in replacement for time.Time, with a monotime.Time consuming just 8 bytes instead of 24 bytes.
Package-Level Type Names (only one)
/* sort by: | */
A Time represents an instant in monotonic time. Times can be compared using the comparison operators, but the specific value is implementation-dependent and should not be relied upon. The zero value of Time doesn't have any specific meaning. Add returns the time t+d. After reports whether the time instant t is after t2. Before reports whether the time instant t is before t2. Equal reports whether t and t2 represent the same time instant. IsZero reports whether t represents the zero time instant. Sub returns the duration t-t2. If the result exceeds the maximum (or minimum) value that can be stored in a Duration, the maximum (or minimum) duration will be returned. To compute t-d for a duration d, use t.Add(-d). ToTime converts the monotonic time to a time.Time value. The returned time.Time will have the same instant as the monotonic time, but may be subject to clock adjustments. Time : gopkg.in/yaml.v3.IsZeroer func FromTime(t time.Time) Time func Now() Time func Time.Add(d time.Duration) Time func github.com/quic-go/quic-go/internal/ackhandler.(*ReceivedPacketHandler).GetAlarmTimeout() Time func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.GetLossDetectionTimeout() Time func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.TimeUntilSend() Time func github.com/quic-go/quic-go/internal/congestion.Clock.Now() Time func github.com/quic-go/quic-go/internal/congestion.DefaultClock.Now() Time func github.com/quic-go/quic-go/internal/congestion.SendAlgorithm.TimeUntilSend(bytesInFlight protocol.ByteCount) Time func github.com/quic-go/quic-go/internal/congestion.SendAlgorithmWithDebugInfos.TimeUntilSend(bytesInFlight protocol.ByteCount) Time func Since(t Time) time.Duration func Until(t Time) time.Duration func Time.After(t2 Time) bool func Time.Before(t2 Time) bool func Time.Equal(t2 Time) bool func Time.Sub(t2 Time) time.Duration func github.com/quic-go/quic-go/internal/ackhandler.(*ReceivedPacketHandler).GetAckFrame(encLevel protocol.EncryptionLevel, now Time, onlyIfQueued bool) *wire.AckFrame func github.com/quic-go/quic-go/internal/ackhandler.(*ReceivedPacketHandler).ReceivedPacket(pn protocol.PacketNumber, ecn protocol.ECN, encLevel protocol.EncryptionLevel, rcvTime Time, ackEliciting bool) error func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.DropPackets(_ protocol.EncryptionLevel, rcvTime Time) func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.MigratedPath(now Time, initialMaxPacketSize protocol.ByteCount) func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.OnLossDetectionTimeout(now Time) error func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.ReceivedAck(f *wire.AckFrame, encLevel protocol.EncryptionLevel, rcvTime Time) (bool, error) func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.ReceivedBytes(_ protocol.ByteCount, rcvTime Time) func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.ReceivedPacket(protocol.EncryptionLevel, Time) func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.ResetForRetry(rcvTime Time) func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.SendMode(now Time) ackhandler.SendMode func github.com/quic-go/quic-go/internal/ackhandler.SentPacketHandler.SentPacket(t Time, pn, largestAcked protocol.PacketNumber, streamFrames []ackhandler.StreamFrame, frames []ackhandler.Frame, encLevel protocol.EncryptionLevel, ecn protocol.ECN, size protocol.ByteCount, isPathMTUProbePacket, isPathProbePacket bool) func github.com/quic-go/quic-go/internal/congestion.(*Cubic).CongestionWindowAfterAck(ackedBytes protocol.ByteCount, currentCongestionWindow protocol.ByteCount, delayMin time.Duration, eventTime Time) protocol.ByteCount func github.com/quic-go/quic-go/internal/congestion.SendAlgorithm.HasPacingBudget(now Time) bool func github.com/quic-go/quic-go/internal/congestion.SendAlgorithm.OnPacketAcked(number protocol.PacketNumber, ackedBytes protocol.ByteCount, priorInFlight protocol.ByteCount, eventTime Time) func github.com/quic-go/quic-go/internal/congestion.SendAlgorithm.OnPacketSent(sentTime Time, bytesInFlight protocol.ByteCount, packetNumber protocol.PacketNumber, bytes protocol.ByteCount, isRetransmittable bool) func github.com/quic-go/quic-go/internal/congestion.SendAlgorithmWithDebugInfos.HasPacingBudget(now Time) bool func github.com/quic-go/quic-go/internal/congestion.SendAlgorithmWithDebugInfos.OnPacketAcked(number protocol.PacketNumber, ackedBytes protocol.ByteCount, priorInFlight protocol.ByteCount, eventTime Time) func github.com/quic-go/quic-go/internal/congestion.SendAlgorithmWithDebugInfos.OnPacketSent(sentTime Time, bytesInFlight protocol.ByteCount, packetNumber protocol.PacketNumber, bytes protocol.ByteCount, isRetransmittable bool) func github.com/quic-go/quic-go/internal/flowcontrol.ConnectionFlowController.GetWindowUpdate(Time) protocol.ByteCount func github.com/quic-go/quic-go/internal/flowcontrol.StreamFlowController.GetWindowUpdate(Time) protocol.ByteCount func github.com/quic-go/quic-go/internal/flowcontrol.StreamFlowController.UpdateHighestReceived(offset protocol.ByteCount, final bool, now Time) error func github.com/quic-go/quic-go/internal/handshake.ShortHeaderOpener.Open(dst, src []byte, rcvTime Time, pn protocol.PacketNumber, kp protocol.KeyPhaseBit, associatedData []byte) ([]byte, error)
Package-Level Functions (total 4)
FromTime converts a time.Time to a monotonic Time. The conversion is relative to the package's start time and may lose precision if the time.Time is far from the start time.
Now returns the current monotonic time.
Since returns the time elapsed since t. It is shorthand for Now().Sub(t).
Until returns the duration until t. It is shorthand for t.Sub(Now()). If t is in the past, the returned duration will be negative.