FakeTimeProvider Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a synthetic time provider that can be used to enable deterministic behavior in tests.
public ref class FakeTimeProvider : TimeProvider
public class FakeTimeProvider : TimeProvider
type FakeTimeProvider = class
inherit TimeProvider
Public Class FakeTimeProvider
Inherits TimeProvider
- Inheritance
Fake |
Initializes a new instance of the FakeTimeProvider class. |
Fake |
Initializes a new instance of the FakeTimeProvider class. |
Auto |
Gets or sets the amount of time by which time advances whenever the clock is read. |
Local |
Gets a TimeZoneInfo object that represents the local time zone according to this TimeProvider's notion of time. |
Start |
Gets the starting date and time for this provider. |
Timestamp |
Gets the amount by which the value from GetTimestamp() increments per second. |
Adjust |
Advances the date and time in the UTC time zone. |
Advance(Time |
Advances time by a specific amount. |
Create |
Creates a new ITimer instance, using TimeSpan values to measure time intervals. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Gets the elapsed time between two timestamps retrieved using GetTimestamp(). (Inherited from TimeProvider) |
Get |
Gets the elapsed time since the |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets a DateTimeOffset value that is set to the current date and time according to this TimeProvider's notion of time based on GetUtcNow(), with the offset set to the LocalTimeZone's offset from Coordinated Universal Time (UTC). (Inherited from TimeProvider) |
Get |
Gets the current high-frequency value designed to measure small time intervals with high accuracy in the timer mechanism. |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Get |
Gets a DateTimeOffset value whose date and time are set to the current Coordinated Universal Time (UTC) date and time and whose offset is Zero, all according to this TimeProvider's notion of time. |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
Set |
Sets the local time zone. |
Set |
Advances the date and time in the UTC time zone. |
To |
Returns a string representation this provider's idea of current time. |
Create |
Initializes a new instance of the CancellationTokenSource class that will be canceled after the specified TimeSpan. |
Delay(Time |
Creates a task that completes after a specified time interval. |
Prodotto | Versioni |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: