• Home
  • Tutorials
  • API Documentation
  • Asset Store
Show / Hide Table of Contents
  • SuperNet.Netcode.Compress
    • CompressorDeflate
    • CompressorLZF
    • ICompressor
  • SuperNet.Netcode.Crypto
    • CryptoAES
    • CryptoECDH
    • CryptoRandom
    • CryptoRSA
    • Curve25519
    • ICryptoAuthenticator
    • ICryptoEncryptor
    • ICryptoExchanger
    • ICryptoRandom
  • SuperNet.Netcode.Transport
    • ConnectionRequest
    • DisconnectReason
    • Host
    • HostConfig
    • HostEvents
    • HostStatistics
    • HostTimespan
    • HostTimestamp
    • IHostListener
    • IMessage
    • IMessageListener
    • IPeerListener
    • MessageEvents
    • MessageReceived
    • MessageSent
    • Peer
    • PeerConfig
    • PeerEvents
    • PeerStatistics
  • SuperNet.Netcode.Util
    • Allocator
    • ArrayPool<T>
    • CRC32
    • IPComparer
    • IPResolver
    • IWritable
    • ObjectPool<T>
    • Reader
    • Serializer
    • Writer
  • SuperNet.Unity.Components
    • INetworkAuthoritative
    • INetworkRegisterable
    • INetworkRollbackable
    • NetworkAnimation
    • NetworkAnimator
    • NetworkAuthority
    • NetworkPrefab
    • NetworkRegistrar
    • NetworkSpawner
    • NetworkSyncModeMethod
    • NetworkSyncModeVector2
    • NetworkSyncModeVector3
    • NetworkTransform
  • SuperNet.Unity.Core
    • NetworkComponent
    • NetworkHost
    • NetworkIdentity
    • NetworkIdentityExtensions
    • NetworkManager
  • SuperNet.Unity.Editor
    • NetworkAuthorityEditor
    • NetworkHostEditor
    • NetworkHostEditor.BandwithUnit
    • NetworkIdentityDrawer
    • NetworkManagerEditor
    • NetworkPrefabEditor
    • NetworkSpawnerEditor

Struct HostTimestamp

Stores a local timestamp of an event.

Implements
IComparable
IComparable<HostTimestamp>
IEquatable<HostTimestamp>
IFormattable
Namespace: SuperNet.Netcode.Transport
Assembly: cs.temp.dll.dll
Syntax
public struct HostTimestamp : IComparable, IComparable<HostTimestamp>, IEquatable<HostTimestamp>, IFormattable

Fields

MaxValue

Biggest possible timestamp.

Declaration
public static readonly HostTimestamp MaxValue
Field Value
Type Description
HostTimestamp

MinValue

Smallest possible timestamp.

Declaration
public static readonly HostTimestamp MinValue
Field Value
Type Description
HostTimestamp

Start

Timestamp at the time the system started.

Declaration
public static readonly HostTimestamp Start
Field Value
Type Description
HostTimestamp

Properties

Elapsed

Get elapsed time since the creation of this timestamp.

Declaration
public HostTimespan Elapsed { get; }
Property Value
Type Description
HostTimespan

Now

Create a new timestamp at the current time.

Declaration
public static HostTimestamp Now { get; }
Property Value
Type Description
HostTimestamp

Methods

CompareTo(HostTimestamp)

Declaration
public int CompareTo(HostTimestamp other)
Parameters
Type Name Description
HostTimestamp other
Returns
Type Description
System.Int32

CompareTo(Object)

Declaration
public int CompareTo(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Int32

Equals(HostTimestamp)

Declaration
public bool Equals(HostTimestamp other)
Parameters
Type Name Description
HostTimestamp other
Returns
Type Description
System.Boolean

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
Overrides
System.ValueType.Equals(System.Object)

FromDateTimeOffset(DateTimeOffset)

Create a timestamp from the DateTimeOffset object.

Declaration
public static HostTimestamp FromDateTimeOffset(DateTimeOffset time)
Parameters
Type Name Description
DateTimeOffset time

The DateTimeOffset object.

Returns
Type Description
HostTimestamp

A new timestamp.

FromStopwatchTicks(Int64)

Create a timestamp with the provided ticks at stopwatch frequency.

Declaration
public static HostTimestamp FromStopwatchTicks(long ticks)
Parameters
Type Name Description
System.Int64 ticks

Raw ticks.

Returns
Type Description
HostTimestamp

A new timestamp.

FromTicks(Int64, Int64)

Create a timestamp from raw ticks with provided frequency.

Declaration
public static HostTimestamp FromTicks(long ticks, long frequency)
Parameters
Type Name Description
System.Int64 ticks

Raw ticks.

System.Int64 frequency

Ticks per second.

Returns
Type Description
HostTimestamp

A new timestamp.

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.ValueType.GetHashCode()

GetStopwatchTicks()

Get raw ticks with stopwatch frequency.

Declaration
public long GetStopwatchTicks()
Returns
Type Description
System.Int64

Raw stopwatch ticks.

GetTicks(Int64)

Get raw ticks with provided frequency.

Declaration
public long GetTicks(long frequency)
Parameters
Type Name Description
System.Int64 frequency

Ticks per second.

Returns
Type Description
System.Int64

Raw ticks.

ToDateTimeOffset(TimeSpan)

Convert timestamp to a DateTimeOffset object.

Declaration
public DateTimeOffset ToDateTimeOffset(TimeSpan offset)
Parameters
Type Name Description
TimeSpan offset

UTC offset to use.

Returns
Type Description
DateTimeOffset

The DateTimeOffset equivalent.

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.ValueType.ToString()

ToString(String, IFormatProvider)

Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type Name Description
System.String format
IFormatProvider formatProvider
Returns
Type Description
System.String

Operators

Addition(HostTimespan, HostTimestamp)

Declaration
public static HostTimestamp operator +(HostTimespan lhs, HostTimestamp rhs)
Parameters
Type Name Description
HostTimespan lhs
HostTimestamp rhs
Returns
Type Description
HostTimestamp

Addition(HostTimestamp, HostTimespan)

Declaration
public static HostTimestamp operator +(HostTimestamp lhs, HostTimespan rhs)
Parameters
Type Name Description
HostTimestamp lhs
HostTimespan rhs
Returns
Type Description
HostTimestamp

Equality(HostTimestamp, HostTimestamp)

Declaration
public static bool operator ==(HostTimestamp lhs, HostTimestamp rhs)
Parameters
Type Name Description
HostTimestamp lhs
HostTimestamp rhs
Returns
Type Description
System.Boolean

GreaterThan(HostTimestamp, HostTimestamp)

Declaration
public static bool operator>(HostTimestamp lhs, HostTimestamp rhs)
Parameters
Type Name Description
HostTimestamp lhs
HostTimestamp rhs
Returns
Type Description
System.Boolean

GreaterThanOrEqual(HostTimestamp, HostTimestamp)

Declaration
public static bool operator >=(HostTimestamp lhs, HostTimestamp rhs)
Parameters
Type Name Description
HostTimestamp lhs
HostTimestamp rhs
Returns
Type Description
System.Boolean

Inequality(HostTimestamp, HostTimestamp)

Declaration
public static bool operator !=(HostTimestamp lhs, HostTimestamp rhs)
Parameters
Type Name Description
HostTimestamp lhs
HostTimestamp rhs
Returns
Type Description
System.Boolean

LessThan(HostTimestamp, HostTimestamp)

Declaration
public static bool operator <(HostTimestamp lhs, HostTimestamp rhs)
Parameters
Type Name Description
HostTimestamp lhs
HostTimestamp rhs
Returns
Type Description
System.Boolean

LessThanOrEqual(HostTimestamp, HostTimestamp)

Declaration
public static bool operator <=(HostTimestamp lhs, HostTimestamp rhs)
Parameters
Type Name Description
HostTimestamp lhs
HostTimestamp rhs
Returns
Type Description
System.Boolean

Subtraction(HostTimestamp, HostTimespan)

Declaration
public static HostTimestamp operator -(HostTimestamp lhs, HostTimespan rhs)
Parameters
Type Name Description
HostTimestamp lhs
HostTimespan rhs
Returns
Type Description
HostTimestamp

Subtraction(HostTimestamp, HostTimestamp)

Declaration
public static HostTimespan operator -(HostTimestamp lhs, HostTimestamp rhs)
Parameters
Type Name Description
HostTimestamp lhs
HostTimestamp rhs
Returns
Type Description
HostTimespan

Implements

IComparable
IComparable<>
IEquatable<>
IFormattable
Back to top Generated by DocFX