WaitUtils
Namespace: Commissiestrijd.Utils
Assembly: backend.dll
Utility class for waiting until a specific time. This class provides a method to wait until a specified time of day, taking into account the current date and time. The method normalizes the time to ensure it is within the same day, and calculates the delay needed to reach that time.
public static class WaitUtils
Inheritance
Show Inherited Members (7)
Methods
WaitUntilTime(TimeSpan, CancellationToken)
Waits until the specified time of day. This method calculates the next occurrence of the specified time, normalizing it to ensure it is within the same day. If the current time is already past the specified time, it will wait until the next occurrence on the following day.
public static Task WaitUntilTime(TimeSpan runTime, CancellationToken stoppingToken)
Parameters
Name | Type | Description |
---|---|---|
runTime | TimeSpan | The time of day to wait until. |
stoppingToken | CancellationToken | A cancellation token to cancel the waiting operation. |
Returns
Type |
---|
Task |