public Task Delay(TimeSpan timeSpan, CancellationToken cancellationToken)
Returns a task which will complete after the given delay. Whether the returned
awaitable is configured to capture the current context or not is implementation-specific.
(A test implementation may capture the current context to enable reliable testing.)
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis webpage provides documentation for the \u003ccode\u003eSystemScheduler\u003c/code\u003e class, a singleton implementation of the \u003ccode\u003eIScheduler\u003c/code\u003e interface within the \u003ccode\u003eGoogle.Api.Gax\u003c/code\u003e namespace.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSystemScheduler\u003c/code\u003e uses \u003ccode\u003eDelay(TimeSpan, CancellationToken)\u003c/code\u003e to manage task delays.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of \u003ccode\u003eSystemScheduler\u003c/code\u003e documented here is 4.10.0, and older versions from 4.8.0 to 3.2.0 are available.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eInstance\u003c/code\u003e property retrieves the singleton \u003ccode\u003eSystemScheduler\u003c/code\u003e instance for use.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDelay(TimeSpan, CancellationToken)\u003c/code\u003e method returns a task that completes after a specified delay, with an option for cancellation using \u003ccode\u003eCancellationToken\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class SystemScheduler (4.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.10.0 (latest)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.SystemScheduler)\n- [4.8.0](/dotnet/docs/reference/Google.Api.Gax/4.8.0/Google.Api.Gax.SystemScheduler)\n- [4.4.0](/dotnet/docs/reference/Google.Api.Gax/4.4.0/Google.Api.Gax.SystemScheduler)\n- [4.3.1](/dotnet/docs/reference/Google.Api.Gax/4.3.1/Google.Api.Gax.SystemScheduler)\n- [4.2.0](/dotnet/docs/reference/Google.Api.Gax/4.2.0/Google.Api.Gax.SystemScheduler)\n- [4.0.0](/dotnet/docs/reference/Google.Api.Gax/4.0.0/Google.Api.Gax.SystemScheduler)\n- [3.2.0](/dotnet/docs/reference/Google.Api.Gax/3.2.0/Google.Api.Gax.SystemScheduler) \n\n public sealed class SystemScheduler : IScheduler\n\nSingleton implementation of [IScheduler](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IScheduler) which uses [Delay(TimeSpan, CancellationToken)](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task.delay#system-threading-tasks-task-delay(system-timespan-system-threading-cancellationtoken)). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SystemScheduler \n\nImplements\n----------\n\n[IScheduler](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IScheduler) \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Api.Gax](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax)\n\nAssembly\n--------\n\nGoogle.Api.Gax.dll\n\nProperties\n----------\n\n### Instance\n\n public static SystemScheduler Instance { get; }\n\nRetrieves the singleton instance.\n\nMethods\n-------\n\n### Delay(TimeSpan, CancellationToken)\n\n public Task Delay(TimeSpan timeSpan, CancellationToken cancellationToken)\n\nReturns a task which will complete after the given delay. Whether the returned\nawaitable is configured to capture the current context or not is implementation-specific.\n(A test implementation may capture the current context to enable reliable testing.)\n\nExtension Method\n----------------\n\n[SchedulerExtensions.Sleep(IScheduler, TimeSpan, CancellationToken)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.SchedulerExtensions#Google_Api_Gax_SchedulerExtensions_Sleep_Google_Api_Gax_IScheduler_System_TimeSpan_System_Threading_CancellationToken_)"]]