Class Timer
public sealed class Timer : IDisposable, Sdl.IDisposeReceiver, IEquatable<Timer>, ISpanFormattable, IFormattable
- Inheritance
-
Timer
- Implements
- Inherited Members
Constructors
Timer(Sdl, uint, TimerMillisecondsCallback)
public Timer(Sdl sdl, uint millisecondsInterval, TimerMillisecondsCallback callback)
Parameters
sdlSdlmillisecondsIntervaluintcallbackTimerMillisecondsCallback
Timer(Sdl, ulong, TimerNanosecondsCallback)
public Timer(Sdl sdl, ulong nanosecondsInterval, TimerNanosecondsCallback callback)
Parameters
sdlSdlnanosecondsIntervalulongcallbackTimerNanosecondsCallback
Properties
Id
public uint Id { get; }
Property Value
MillisecondTicks
public static ulong MillisecondTicks { get; }
Property Value
NanosecondTicks
public static ulong NanosecondTicks { get; }
Property Value
PerformanceCounter
public static ulong PerformanceCounter { get; }
Property Value
PerformanceFrequency
public static ulong PerformanceFrequency { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Equals(Timer?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Timer? other)
Parameters
otherTimerAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
~Timer()
protected ~Timer()
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToString(IFormatProvider?)
public string ToString(IFormatProvider? formatProvider)
Parameters
formatProviderIFormatProvider
Returns
ToString(string?)
public string ToString(string? format)
Parameters
formatstring
Returns
ToString(string?, IFormatProvider?)
Formats the value of the current instance using the specified format.
public string ToString(string? format, IFormatProvider? formatProvider)
Parameters
formatstringThe format to use.
-or-
A null reference (
Nothingin Visual Basic) to use the default format defined for the type of the IFormattable implementation.formatProviderIFormatProviderThe provider to use to format the value.
-or-
A null reference (
Nothingin Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
The value of the current instance in the specified format.
TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)
Tries to format the value of the current instance into the provided span of characters.
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)
Parameters
destinationSpan<char>The span in which to write this instance's value formatted as a span of characters.
charsWrittenintWhen this method returns, contains the number of characters that were written in
destination.formatReadOnlySpan<char>A span containing the characters that represent a standard or custom format string that defines the acceptable format for
destination.providerIFormatProviderAn optional object that supplies culture-specific formatting information for
destination.