• 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 HostTimespan

Stores a difference between two timestamps as a duration.

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

Fields

Zero

Timespan representing zero time.

Declaration
public static readonly HostTimespan Zero
Field Value
Type Description
HostTimespan

Properties

Days

Duration in number of days.

Declaration
public double Days { get; }
Property Value
Type Description
System.Double

Hours

Duration in number of hours.

Declaration
public double Hours { get; }
Property Value
Type Description
System.Double

Milliseconds

Duration in number of milliseconds.

Declaration
public double Milliseconds { get; }
Property Value
Type Description
System.Double

Minutes

Duration in number of minutes.

Declaration
public double Minutes { get; }
Property Value
Type Description
System.Double

Seconds

Duration in number of seconds.

Declaration
public double Seconds { get; }
Property Value
Type Description
System.Double

Methods

Abs(HostTimespan)

Returns the absolute value of a timespan.

Declaration
public static HostTimespan Abs(HostTimespan timespan)
Parameters
Type Name Description
HostTimespan timespan

Timespan to use.

Returns
Type Description
HostTimespan

The absolute value.

Clamp(HostTimespan, HostTimespan, HostTimespan)

Returns a clamped value of a timespan.

Declaration
public static HostTimespan Clamp(HostTimespan value, HostTimespan min, HostTimespan max)
Parameters
Type Name Description
HostTimespan value

Value to clamp.

HostTimespan min

Lower bound.

HostTimespan max

Upper bound.

Returns
Type Description
HostTimespan

Clamped value.

CompareTo(HostTimespan)

Declaration
public int CompareTo(HostTimespan other)
Parameters
Type Name Description
HostTimespan 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(HostTimespan)

Declaration
public bool Equals(HostTimespan other)
Parameters
Type Name Description
HostTimespan 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)

FromDays(Double)

Create a timespan from days.

Declaration
public static HostTimespan FromDays(double value)
Parameters
Type Name Description
System.Double value

Number of days.

Returns
Type Description
HostTimespan

A new timespan.

FromHours(Double)

Create a timespan from hours.

Declaration
public static HostTimespan FromHours(double value)
Parameters
Type Name Description
System.Double value

Number of hours.

Returns
Type Description
HostTimespan

A new timespan.

FromMilliseconds(Double)

Create a timespan from milliseconds.

Declaration
public static HostTimespan FromMilliseconds(double value)
Parameters
Type Name Description
System.Double value

Number of milliseconds.

Returns
Type Description
HostTimespan

A new timespan.

FromMinutes(Double)

Create a timespan from minutes.

Declaration
public static HostTimespan FromMinutes(double value)
Parameters
Type Name Description
System.Double value

Number of minutes.

Returns
Type Description
HostTimespan

A new timespan.

FromSeconds(Double)

Create a timespan from seconds.

Declaration
public static HostTimespan FromSeconds(double value)
Parameters
Type Name Description
System.Double value

Number of seconds.

Returns
Type Description
HostTimespan

A new timespan.

FromStopwatchTicks(Int64)

Create a timespan with the provided ticks at stopwatch frequency.

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

Raw ticks.

Returns
Type Description
HostTimespan

A new timespan.

FromTicks(Int64, Int64)

Create a timespan from raw ticks with provided frequency.

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

Raw ticks.

System.Int64 frequency

Ticks per second.

Returns
Type Description
HostTimespan

A new timespan.

FromTimeSpan(TimeSpan)

Create a timespan from the TimeSpan object.

Declaration
public static HostTimespan FromTimeSpan(TimeSpan value)
Parameters
Type Name Description
TimeSpan value

The TimeSpan object.

Returns
Type Description
HostTimespan

A new timespan.

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.

Max(HostTimespan, HostTimespan)

Returns the larger of the two timespans.

Declaration
public static HostTimespan Max(HostTimespan a, HostTimespan b)
Parameters
Type Name Description
HostTimespan a

First value.

HostTimespan b

Second value.

Returns
Type Description
HostTimespan

The larger of the two values.

Min(HostTimespan, HostTimespan)

Returns the smaller of the two timespans.

Declaration
public static HostTimespan Min(HostTimespan a, HostTimespan b)
Parameters
Type Name Description
HostTimespan a

First value.

HostTimespan b

Second value.

Returns
Type Description
HostTimespan

The smaller of the two values.

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

ToTimeSpan()

Get the TimeSpan equivalent.

Declaration
public TimeSpan ToTimeSpan()
Returns
Type Description
TimeSpan

Operators

Addition(HostTimespan, HostTimespan)

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

Division(HostTimespan, HostTimespan)

Declaration
public static double operator /(HostTimespan lhs, HostTimespan rhs)
Parameters
Type Name Description
HostTimespan lhs
HostTimespan rhs
Returns
Type Description
System.Double

Equality(HostTimespan, HostTimespan)

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

GreaterThan(HostTimespan, HostTimespan)

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

GreaterThanOrEqual(HostTimespan, HostTimespan)

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

Inequality(HostTimespan, HostTimespan)

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

LessThan(HostTimespan, HostTimespan)

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

LessThanOrEqual(HostTimespan, HostTimespan)

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

Subtraction(HostTimespan, HostTimespan)

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

UnaryNegation(HostTimespan)

Declaration
public static HostTimespan operator -(HostTimespan time)
Parameters
Type Name Description
HostTimespan time
Returns
Type Description
HostTimespan

Implements

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