Struct TimeStampWrapper
Structure that stores time stamp for the LogMessage
Inherited Members
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
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 |