Table of Contents

Class Timer

Namespace
Sdl3Sharp.Timing
Assembly
Sdl3Sharp.dll
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

sdl Sdl
millisecondsInterval uint
callback TimerMillisecondsCallback

Timer(Sdl, ulong, TimerNanosecondsCallback)

public Timer(Sdl sdl, ulong nanosecondsInterval, TimerNanosecondsCallback callback)

Parameters

sdl Sdl
nanosecondsInterval ulong
callback TimerNanosecondsCallback

Properties

Id

public uint Id { get; }

Property Value

uint

MillisecondTicks

public static ulong MillisecondTicks { get; }

Property Value

ulong

NanosecondTicks

public static ulong NanosecondTicks { get; }

Property Value

ulong

PerformanceCounter

public static ulong PerformanceCounter { get; }

Property Value

ulong

PerformanceFrequency

public static ulong PerformanceFrequency { get; }

Property Value

ulong

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

other Timer

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

~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

formatProvider IFormatProvider

Returns

string

ToString(string?)

public string ToString(string? format)

Parameters

format string

Returns

string

ToString(string?, IFormatProvider?)

Formats the value of the current instance using the specified format.

public string ToString(string? format, IFormatProvider? formatProvider)

Parameters

format string

The format to use.

-or-

A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

formatProvider IFormatProvider

The provider to use to format the value.

-or-

A null reference (Nothing in 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

destination Span<char>

The span in which to write this instance's value formatted as a span of characters.

charsWritten int

When this method returns, contains the number of characters that were written in destination.

format ReadOnlySpan<char>

A span containing the characters that represent a standard or custom format string that defines the acceptable format for destination.

provider IFormatProvider

An optional object that supplies culture-specific formatting information for destination.

Returns

bool

true if the formatting was successful; otherwise, false.