docs.unity3d.com
    Show / Hide Table of Contents

    Struct TimeStampWrapper

    Structure that stores time stamp for the LogMessage

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Logging.Internal
    Syntax
    public struct TimeStampWrapper

    Fields

    TimestampFormat

    Current Timestamp string format

    Declaration
    public static string TimestampFormat
    Field Value
    Type Description
    String

    TimestampFormatDefault

    Default Timestamp string format

    Declaration
    public const string TimestampFormatDefault = "yyyy/MM/dd HH:mm:ss.fff"
    Field Value
    Type Description
    String

    Methods

    GetFormattedTimeStampString(Int64, ref UnsafeText)

    Writes human-readable timestamp representation into buffer

    Declaration
    public static int GetFormattedTimeStampString(long timestamp, ref UnsafeText messageOutput)
    Parameters
    Type Name Description
    Int64 timestamp

    UTC timestamp in nanoseconds to write

    UnsafeText messageOutput

    UnsafeText to write to

    Returns
    Type Description
    Int32

    Length written to the buffer

    GetFormattedTimeStampStringForFileName(Int64)

    Timestamp to filename FixedString64Bytes

    Declaration
    public static FixedString64Bytes GetFormattedTimeStampStringForFileName(long timestamp)
    Parameters
    Type Name Description
    Int64 timestamp

    UTC timestamp in nanoseconds

    Returns
    Type Description
    FixedString64Bytes

    FixedString64Bytes to be used for the filename

    GetTimeStamp()

    Returns current UTC timestamp in nanoseconds

    Declaration
    public static long GetTimeStamp()
    Returns
    Type Description
    Int64

    UTC timestamp in nanoseconds

    Initialize()

    Initializes everything needed for Timestamps to be captured. Should be called from managed (non-burst) environment

    Declaration
    [BurstDiscard]
    public static void Initialize()

    SetHandlerForTimestamp(TimeStampWrapper.CustomGetTimestampHandler, Boolean)

    Set a custom function-handler to get a timestamp in nanoseconds

    Declaration
    public static void SetHandlerForTimestamp(TimeStampWrapper.CustomGetTimestampHandler handler, bool isBurstable = false)
    Parameters
    Type Name Description
    TimeStampWrapper.CustomGetTimestampHandler handler

    Function-handler of TimeStampWrapper.CustomGetTimestampHandler type

    Boolean isBurstable

    True if the function-handler is burst compatible

    TotalMillisecondsSince(Int64)

    Function that calculates difference in milliseconds between and 'now' (to get 'now' it calls GetTimeStamp()). Timestamps are in nanoseconds

    Declaration
    public static long TotalMillisecondsSince(long sinceTimestamp)
    Parameters
    Type Name Description
    Int64 sinceTimestamp

    Timestamp to calculate the difference with

    Returns
    Type Description
    Int64

    Milliseconds between and 'now'

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023