268 instantiations of TimeSpan
BinaryFormatTests (2)
FormatTests\FormattedObject\ListTests.cs (1)
108new List<TimeSpan>() { new(0, 0, 50) }
FormatTests\FormattedObject\PrimitiveTypeTests.cs (1)
165PrimitiveType.TimeSpan => new TimeSpan(reader.ReadInt64()),
dotnet-svcutil-lib (25)
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\SqlUtils.cs (2)
881return SQLBaseDate.Add(new TimeSpan(dateticks * TimeSpan.TicksPerDay + 977DateTimeOffset dto = new DateTimeOffset(dateTicks + timeTicks + zoneTicks, new TimeSpan(zoneTicks));
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDateTime.cs (9)
374return new DateTime(_dt.Subtract(new TimeSpan(ZoneHour, ZoneMinute, 0)).Ticks, DateTimeKind.Utc); 377return new DateTime(_dt.Add(new TimeSpan(ZoneHour, ZoneMinute, 0)).Ticks, DateTimeKind.Utc); 431ticks = result.Ticks - new TimeSpan(xdt.ZoneHour, xdt.ZoneMinute, 0).Ticks; 444ticks = result.Ticks + new TimeSpan(xdt.ZoneHour, xdt.ZoneMinute, 0).Ticks; 486result = new DateTimeOffset(dt, new TimeSpan(xdt.ZoneHour, xdt.ZoneMinute, 0)); 489result = new DateTimeOffset(dt, new TimeSpan(-xdt.ZoneHour, -xdt.ZoneMinute, 0)); 492result = new DateTimeOffset(dt, new TimeSpan(0)); 697return _dt.Subtract(new TimeSpan(ZoneHour, ZoneMinute, 0)); 699return _dt.Add(new TimeSpan(ZoneHour, ZoneMinute, 0));
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDuration.cs (3)
369result = new TimeSpan(Int64.MinValue); 373result = new TimeSpan(-((long)ticks)); 378result = new TimeSpan((long)ticks);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DateTimeOffsetAdapter.cs (2)
50return new DateTimeOffset(value.UtcDateTime, new TimeSpan(0, value.OffsetMinutes, 0)); 58return deserialized.ToOffset(new TimeSpan(0, value.OffsetMinutes, 0));
FrameworkFork\System.Runtime.Serialization\System\Xml\ValueHandle.cs (1)
412return new TimeSpan(GetInt64());
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlConverter.cs (1)
987TimeSpan ts = new TimeSpan(hourDelta, minuteDelta, 0);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Ticks.cs (1)
38return new TimeSpan(ticks);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
32private static CacheControlHeaderValue s_requestCacheHeader = new CacheControlHeaderValue { NoCache = true, MaxAge = new TimeSpan(0) };
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (4)
1071throw Fx.Exception.AsError(new TimeoutException(InternalSR.TaskTimedOutError(new TimeSpan(ReadTimeout)))); 1074throw WebSocketHelper.ConvertAndTraceException(ex, new TimeSpan(ReadTimeout), WebSocketHelper.ReceiveOperation); 1151throw Fx.Exception.AsError(new TimeoutException(InternalSR.TaskTimedOutError(new TimeSpan(WriteTimeout)))); 1154throw WebSocketHelper.ConvertAndTraceException(ex, new TimeSpan(WriteTimeout), WebSocketHelper.SendOperation);
FrameworkFork\System.ServiceModel\System\ServiceModel\Diagnostics\TraceUtility.cs (1)
75TimeSpan elapsedTime = new TimeSpan(DateTime.UtcNow.Ticks - startTicks);
FilesWebSite (2)
Controllers\DownloadFilesController.cs (2)
30var lastModified = new DateTimeOffset(year: 1999, month: 11, day: 04, hour: 3, minute: 0, second: 0, offset: new TimeSpan(0)); 44var lastModified = new DateTimeOffset(year: 1999, month: 11, day: 04, hour: 3, minute: 0, second: 0, offset: new TimeSpan(0));
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
Binding\FormDataMapperTests.cs (2)
2127{ "02:01:03", typeof(TimeSpan?), new TimeSpan?(new TimeSpan(02, 01, 03))}, 2212{ "02:01:03", typeof(TimeSpan), new TimeSpan(02, 01, 03) },
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (6)
EndpointMetadataApiDescriptionProviderTest.cs (6)
312() => TypedResults.Created("https://example.com", new TimeSpan())); 340() => new GenericClass<TimeSpan> { Value = new TimeSpan() }); 359() => TypedResults.Ok(new GenericClass<TimeSpan> { Value = new TimeSpan() })); 378() => new List<TimeSpan> { new() }); 397() => TypedResults.Ok(new List<TimeSpan> { new() })); 496() => TypedResults.Created("https://example.com", new TimeSpan()));
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
DefaultValuesTest.cs (1)
104TimeSpan timeSpan = new TimeSpan(10, 10, 10);
Microsoft.AspNetCore.Server.HttpSys (1)
TimeoutManager.cs (1)
174return new TimeSpan(0, 0, (int)_timeouts[(int)type]);
Microsoft.Build.Framework (2)
BinaryTranslator.cs (1)
447value = new System.TimeSpan(ticks);
Telemetry\BuildCheckTelemetry.cs (1)
51TimeSpan totalRuntime = new TimeSpan(runtimeTicks);
Microsoft.Extensions.AI.Abstractions.Tests (1)
test\Shared\JsonSchemaExporter\TestTypes.cs (1)
90Value: new(hours: 5, minutes: 13, seconds: 3),
Microsoft.Extensions.Caching.Memory (1)
CacheEntry.cs (1)
73var offset = new TimeSpan(_absoluteExpirationOffsetMinutes * TimeSpan.TicksPerMinute);
Microsoft.Extensions.Caching.StackExchangeRedis (1)
RedisCache.cs (1)
515slidingExpiration = new TimeSpan(slidingExpirationTicks.Value);
Microsoft.Extensions.Http (1)
ValueStopwatch.cs (1)
36return new TimeSpan(ticks);
Microsoft.Extensions.Http.Polly (1)
src\Shared\ValueStopwatch\ValueStopwatch.cs (1)
31return new TimeSpan(ticks);
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
92P2 = new TimeSpan(1234),
Microsoft.Maui.Controls (1)
TimePicker\TimePicker.cs (1)
23 public static readonly BindableProperty TimeProperty = BindableProperty.Create(nameof(Time), typeof(TimeSpan), typeof(TimePicker), new TimeSpan(0), BindingMode.TwoWay,
Microsoft.ML.Data (2)
DataLoadSave\Binary\Codecs.cs (1)
746value = new DateTimeOffset(new DateTime(ticks == long.MinValue ? default : ticks), new TimeSpan(0, offset == short.MinValue ? default : offset, 0));
DataLoadSave\Binary\UnsafeTypeOps.cs (1)
185return new TimeSpan(ticks == long.MinValue ? default : ticks);
Microsoft.ML.Tests (16)
Scenarios\Api\TestApi.cs (16)
423DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(1, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 0) 427DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(2, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 10) 431DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(1, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 10) 435DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(2, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 0) 439DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(3, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 20) 443DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(4, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 30) 447DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(3, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 30) 451DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(4, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 20)
Microsoft.Net.Http.Headers (1)
CacheControlHeaderValue.cs (1)
784timeSpan = new TimeSpan(0, 0, seconds);
Microsoft.Net.Http.Headers.Tests (26)
CacheControlHeaderValueTest.cs (25)
34TimeSpan timeSpan = new TimeSpan(1, 2, 3); 83cacheControl.MaxAge = new TimeSpan(0, 1, 10); 87cacheControl.MaxStaleLimit = new TimeSpan(0, 2, 5); 89cacheControl.MinFresh = new TimeSpan(0, 3, 0); 182values[0].MaxAge = new TimeSpan(0, 1, 1); 183values[1].MaxStaleLimit = new TimeSpan(0, 1, 1); 184values[2].MinFresh = new TimeSpan(0, 1, 1); 185values[3].SharedMaxAge = new TimeSpan(0, 1, 1); 199values[0].MaxStaleLimit = new TimeSpan(0, 1, 2); 202values[1].MaxAge = new TimeSpan(0, 1, 1); 203values[1].MaxStaleLimit = new TimeSpan(0, 1, 2); 296values[0].MaxAge = new TimeSpan(0, 1, 1); 297values[1].MaxStaleLimit = new TimeSpan(0, 1, 1); 298values[2].MinFresh = new TimeSpan(0, 1, 1); 299values[3].SharedMaxAge = new TimeSpan(0, 1, 1); 313values[0].MaxStaleLimit = new TimeSpan(0, 1, 2); 316values[1].MaxAge = new TimeSpan(0, 1, 1); 317values[1].MaxStaleLimit = new TimeSpan(0, 1, 2); 326value2.MaxStaleLimit = new TimeSpan(1, 2, 3); 390expected.MaxAge = new TimeSpan(0, 0, 125); 395expected.MinFresh = new TimeSpan(0, 0, 123); 413expected.SharedMaxAge = new TimeSpan(0, 0, 1234567890); 414expected.MaxAge = new TimeSpan(0, 0, 987654321); 482expected.MinFresh = new TimeSpan(0, 2, 3); 519expected.MinFresh = new TimeSpan(0, 2, 3);
ContentDispositionHeaderValueTest.cs (1)
403contentDisposition.CreationDate = new DateTimeOffset(new DateTime(2011, 2, 15), new TimeSpan(-8, 0, 0));
PresentationCore (4)
System\Windows\Media\Animation\AnimationTimeline.cs (1)
129return new TimeSpan(0, 0, 1);
System\Windows\Media\Animation\TimeManager.cs (3)
62_globalTime = new TimeSpan(-1); 63_lastTickTime = new TimeSpan(-1); 66ParallelTimeline timeManagerTimeline = new ParallelTimeline(new TimeSpan(0), Duration.Forever);
PresentationCore.Tests (4)
System\Windows\DurationConverter.Tests.cs (4)
60yield return new object?[] { "17.22:10:15.4571230", CultureInfo.InvariantCulture, new Duration(new TimeSpan(17, 22, 10, 15, 457, 123)), true }; 61yield return new object?[] { "17.22:10:15.4571230", new CultureInfo("ru-RU"), new Duration(new TimeSpan(17, 22, 10, 15, 457, 123)), true }; 73Assert.Throws<ArgumentNullException>(() => converter.ConvertTo(new Duration(new TimeSpan(17, 22, 10, 15, 457, 123)), destinationType: null!)); 88Assert.Throws<NotSupportedException>(() => converter.ConvertTo(null, null, new Duration(new TimeSpan(17, 22, 10, 15, 457, 123)), destinationType));
PresentationFramework (12)
MS\Internal\Documents\TextBoxView.cs (1)
1089Interval = new TimeSpan(0, 0, _throttleBackgroundSeconds)
MS\Internal\PtsHost\BackgroundFormatInfo.cs (1)
94Interval = new TimeSpan(0, 0, (int)_throttleBackgroundSeconds)
System\Windows\Controls\AVElementHelper.cs (1)
56_position = new SettableState<TimeSpan>(new TimeSpan(0));
System\Windows\Controls\Control.cs (1)
490plainText = (string)Dispatcher.Invoke(DispatcherPriority.Send, new TimeSpan(0, 0, 0, 0, 20), new DispatcherOperationCallback(delegate(object o) {
System\Windows\Controls\HeaderedContentControl.cs (1)
400Dispatcher.Invoke(DispatcherPriority.Send, new TimeSpan(0, 0, 0, 0, 20), new DispatcherOperationCallback(delegate(object o)
System\Windows\Controls\HeaderedItemsControl.cs (1)
349Dispatcher.Invoke(DispatcherPriority.Send, new TimeSpan(0, 0, 0, 0, 20), new DispatcherOperationCallback(delegate(object o)
System\Windows\Controls\Primitives\Popup.cs (1)
2902internal static TimeSpan AnimationDelayTime = new TimeSpan(0, 0, 0, 0, AnimationDelay);
System\Windows\Controls\Primitives\RangeBase.cs (1)
374Dispatcher.Invoke(DispatcherPriority.Send, new TimeSpan(0, 0, 0, 0, 20), new DispatcherOperationCallback(delegate(object o)
System\Windows\Controls\Primitives\ToggleButton.cs (1)
296Dispatcher.Invoke(DispatcherPriority.Send, new TimeSpan(0, 0, 0, 0, 20), new DispatcherOperationCallback(delegate(object o)
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
11389DefaultConstructor = delegate () { return new System.TimeSpan(); },
System\Windows\VisualTransition.cs (1)
86private Duration _generatedDuration = new Duration(new TimeSpan());
System\Windows\Window.cs (1)
6476_taskbarRetryTimer = new DispatcherTimer { Interval = new TimeSpan(0, 1, 0) };
Shared.Tests (1)
JsonSchemaExporter\TestTypes.cs (1)
90Value: new(hours: 5, minutes: 13, seconds: 3),
System.Data.Common (8)
System\Data\Common\SQLConvert.cs (4)
497StorageType.Int32 => new TimeSpan((int)value), 498StorageType.Int64 => new TimeSpan((long)value), 643StorageType.Int32 => new TimeSpan((int)value), 644StorageType.Int64 => new TimeSpan((long)value),
System\Data\Common\TimeSpanStorage.cs (2)
194return new TimeSpan((int)value); 198return new TimeSpan((long)value);
System\Data\Filter\FunctionNode.cs (1)
561return new DateTimeOffset((DateTime)argumentValues[0], new TimeSpan((int)argumentValues[1], (int)argumentValues[2], 0));
System\Data\SQLTypes\SQLDateTime.cs (1)
199return new TimeSpan(value.m_day * TimeSpan.TicksPerDay +
System.Data.Odbc (2)
Common\System\Data\ProviderBase\DbBuffer.cs (1)
698return new TimeSpan(
Common\System\Data\ProviderBase\DbConnectionPoolOptions.cs (1)
30_loadBalanceTimeout = new TimeSpan(0, 0, loadBalanceTimeout);
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Activity.cs (1)
766Duration = new TimeSpan(1); // We want Duration of 0 to mean 'EndTime not set)
System.DirectoryServices.Protocols (5)
System\DirectoryServices\Protocols\common\DirectoryConnection.cs (1)
14internal TimeSpan _connectionTimeOut = new TimeSpan(0, 0, 30);
System\DirectoryServices\Protocols\common\DirectoryRequest.cs (1)
318private TimeSpan _directoryTimeLimit = new TimeSpan(0);
System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs (3)
216return new TimeSpan(result * TimeSpan.TicksPerSecond); 255return new TimeSpan(result * TimeSpan.TicksPerMillisecond); 397return new TimeSpan(result * TimeSpan.TicksPerSecond);
System.Formats.Asn1 (5)
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (4)
316TimeSpan tmp = new TimeSpan(offsetHour, offsetMinute, 0); 358fractionSpan = new TimeSpan((long)(frac * TimeSpan.TicksPerHour)); 368fractionSpan = new TimeSpan((long)(frac * TimeSpan.TicksPerMinute)); 374fractionSpan = new TimeSpan((long)(frac * TimeSpan.TicksPerSecond));
System\Formats\Asn1\AsnDecoder.UtcTime.cs (1)
204TimeSpan offset = new TimeSpan(offsetHour, offsetMinute, 0);
System.Formats.Nrbf (6)
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (2)
239values[i] = (T)(object)new TimeSpan(reader.ReadInt64()); 313values.Add((T)(object)new TimeSpan(reader.ReadInt64()));
System\Formats\Nrbf\ClassWithIdRecord.cs (1)
69MemberPrimitiveTypedRecord<TimeSpan> => Create(new TimeSpan(reader.ReadInt64())),
System\Formats\Nrbf\NrbfDecoder.cs (1)
259PrimitiveType.TimeSpan => new MemberPrimitiveTypedRecord<TimeSpan>(new TimeSpan(reader.ReadInt64())),
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (1)
67(PrimitiveType.Int64, "System.TimeSpan", "_ticks") => Create(new TimeSpan(reader.ReadInt64())),
System\Formats\Nrbf\Utils\BinaryReaderExtensions.cs (1)
97PrimitiveType.TimeSpan => new TimeSpan(reader.ReadInt64()),
System.Net.Http (5)
System\Net\Http\Headers\CacheControlHeaderValue.cs (1)
551timeSpan = new TimeSpan(0, 0, seconds);
System\Net\Http\Headers\RetryConditionHeaderValue.cs (2)
25_delta = new TimeSpan(DeltaNotSetTicksSentinel); 140parsedValue = new RetryConditionHeaderValue(new TimeSpan(0, 0, deltaSeconds));
System\Net\Http\Headers\TimeSpanHeaderParser.cs (1)
43parsedValue = new TimeSpan(0, 0, result);
System\Net\Http\SocketsHttpHandler\Http2StreamWindowManager.cs (1)
179public TimeSpan MinRtt => new TimeSpan(_minRtt);
System.Net.Mail (10)
System\Net\Mime\SmtpDateTime.cs (10)
67{ "EDT", new TimeSpan(-4, 0, 0) }, // -0400 68{ "EST", new TimeSpan(-5, 0, 0) }, // -0500 69{ "CDT", new TimeSpan(-5, 0, 0) }, // -0500 70{ "CST", new TimeSpan(-6, 0, 0) }, // -0600 71{ "MDT", new TimeSpan(-6, 0, 0) }, // -0600 72{ "MST", new TimeSpan(-7, 0, 0) }, // -0700 73{ "PDT", new TimeSpan(-7, 0, 0) }, // -0700 74{ "PST", new TimeSpan(-8, 0, 0) }, // -0800 324timeZone = new TimeSpan(hours, minutes, 0); 340TimeSpan sanitizedTimeSpan = new TimeSpan(span.Days, span.Hours, span.Minutes, 0, 0);
System.Private.CoreLib (68)
src\libraries\Common\src\System\TimeProvider.cs (1)
117return new TimeSpan((long)((endingTimestamp - startingTimestamp) * ((double)TimeSpan.TicksPerSecond / timestampFrequency)));
src\libraries\System.Private.CoreLib\src\System\AppDomain.Unix.cs (1)
21return new TimeSpan((long)userTime100Nanoseconds);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (1)
116private static TimeSpan NullOffset => new TimeSpan(DateTimeFormat.NullOffset);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.Helpers.cs (1)
42value = new DateTimeOffset(ticks: dateTime.Ticks, offset: new TimeSpan(ticks: offsetTicks));
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpan.cs (1)
174timeSpan = new TimeSpan(ticks);
src\libraries\System.Private.CoreLib\src\System\CurrentSystemTimeZone.cs (2)
39TimeSpan offset = new TimeSpan(m_ticksOffset); 155return new TimeSpan(CalculateUtcOffset(time, GetDaylightChanges(time.Year)).Ticks + m_ticksOffset);
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (3)
1540public TimeSpan TimeOfDay => new TimeSpan((long)(UTicks % TimeSpan.TicksPerDay)); 1652return new TimeSpan(Ticks - value.Ticks); 1869public static TimeSpan operator -(DateTime d1, DateTime d2) => new TimeSpan(d1.Ticks - d2.Ticks);
src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (3)
414public TimeSpan Offset => new TimeSpan(_offsetMinutes * TimeSpan.TicksPerMinute); 739public TimeSpan Subtract(DateTimeOffset value) => new TimeSpan(UtcTicks - value.UtcTicks); 986new TimeSpan(left.UtcTicks - right.UtcTicks);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Stopwatch.cs (2)
76public TimeSpan Elapsed => new(ElapsedTimeSpanTicks); 107new((long)((endingTimestamp - startingTimestamp) * s_tickFrequency));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (2)
160_nextPollingTimeStamp = DateTime.UtcNow + new TimeSpan(0, 0, (int)pollingIntervalInSeconds); 296if (counterGroup._nextPollingTimeStamp < now + new TimeSpan(0, 0, 0, 0, 1))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSource.cs (8)
90_gen0GCCounter ??= new IncrementingPollingCounter("gen-0-gc-count", this, () => GC.CollectionCount(0)) { DisplayName = "Gen 0 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 91_gen1GCCounter ??= new IncrementingPollingCounter("gen-1-gc-count", this, () => GC.CollectionCount(1)) { DisplayName = "Gen 1 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 92_gen2GCCounter ??= new IncrementingPollingCounter("gen-2-gc-count", this, () => GC.CollectionCount(2)) { DisplayName = "Gen 2 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 95_monitorContentionCounter ??= new IncrementingPollingCounter("monitor-lock-contention-count", this, () => Monitor.LockContentionCount) { DisplayName = "Monitor Lock Contention Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; 97_completedItemsCounter ??= new IncrementingPollingCounter("threadpool-completed-items-count", this, () => ThreadPool.CompletedWorkItemCount) { DisplayName = "ThreadPool Completed Work Item Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; 98_allocRateCounter ??= new IncrementingPollingCounter("alloc-rate", this, () => GC.GetTotalAllocatedBytes()) { DisplayName = "Allocation Rate", DisplayUnits = "B", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; 106_exceptionCounter ??= new IncrementingPollingCounter("exception-count", this, () => Exception.GetExceptionCount()) { DisplayName = "Exception Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; 118_jitTimeCounter ??= new IncrementingPollingCounter("time-in-jit", this, () => Runtime.JitInfo.GetCompilationTime().TotalMilliseconds) { DisplayName = "Time spent in JIT", DisplayUnits = "ms", DisplayRateTimeScale = new TimeSpan(0, 0, 1) };
src\libraries\System.Private.CoreLib\src\System\Environment.UnixOrBrowser.cs (2)
93return new ProcessCpuUsage { UserTime = new TimeSpan((long)userTime100Nanoseconds), PrivilegedTime = new TimeSpan((long)kernelTime100Nanoseconds) };
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (2)
918Format(dateTime, format, provider, new TimeSpan(NullOffset)); 1030TryFormat(dateTime, destination, out charsWritten, format, provider, new TimeSpan(NullOffset));
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (9)
560result = new TimeSpan(hourOffset, minuteOffset, 0); 1109result.timeZoneOffset = new TimeSpan(0); 3284result = (new TimeSpan(hourOffset, minuteOffset, 0)); 3988result.timeZoneOffset = new TimeSpan(0); 4287TimeSpan tempTimeZoneOffset = new TimeSpan(0); 4310result.timeZoneOffset = new TimeSpan(0); 4336result.timeZoneOffset = new TimeSpan(0); 4342TimeSpan tempTimeZoneOffset = new TimeSpan(0); 5181result.timeZoneOffset = new TimeSpan(offsetHours, offsetMinutes, 0);
src\libraries\System.Private.CoreLib\src\System\Globalization\JulianCalendar.cs (1)
319return new DateTime(DateToTicks(year, month, day) + (new TimeSpan(0, hour, minute, second, millisecond)).Ticks);
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (7)
826result.parsedTimeSpan = new TimeSpan(ticks); 954result.parsedTimeSpan = new TimeSpan(ticks); 1080result.parsedTimeSpan = new TimeSpan(ticks); 1151result.parsedTimeSpan = new TimeSpan(ticks); 1220result.parsedTimeSpan = new TimeSpan(ticks); 1409result.parsedTimeSpan = new TimeSpan(ticks); 1564result.parsedTimeSpan = new TimeSpan(time);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (2)
599return new TimeSpan(_store.ReadInt64()); 700return new TimeSpan(ticks);
src\libraries\System.Private.CoreLib\src\System\Threading\Timeout.cs (1)
11public static readonly TimeSpan InfiniteTimeSpan = new TimeSpan(0, 0, 0, 0, Infinite);
src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (2)
283return new TimeSpan(diff + ((diff >> 63) & TimeSpan.TicksPerDay)); 384public TimeSpan ToTimeSpan() => new TimeSpan((long)_ticks);
src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (9)
230public static readonly TimeSpan Zero = new TimeSpan(0); 232public static readonly TimeSpan MaxValue = new TimeSpan(MaxTicks); 233public static readonly TimeSpan MinValue = new TimeSpan(MinTicks); 422return new TimeSpan(_ticks >= 0 ? _ticks : -_ticks); 655return new TimeSpan((long)ticks); 695public static TimeSpan FromTicks(long value) => new TimeSpan(value); 874return new TimeSpan(-t._ticks); 888return new TimeSpan(result); 904return new TimeSpan(result);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.StringSerializer.cs (1)
349return new TimeSpan(hours: 0, minutes: token, seconds: 0);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (6)
118_baseUtcOffset = new TimeSpan(_baseUtcOffset.Hours, _baseUtcOffset.Minutes, 0); 658result = new TimeSpan(result.Hours, result.Minutes, 0); 727daylightSavingsTimeSpan = new TimeSpan(1, 0, 0); 789result = new TimeSpan(hours, 0, 0); 819timeOffset = new TimeSpan(timeOffset.GetValueOrDefault().Hours, timeOffset.GetValueOrDefault().Minutes, timeOffset.GetValueOrDefault().Seconds); 1306UtcOffset = new TimeSpan(0, 0, TZif_ToInt32(data, index + 00));
src\System\GC.CoreCLR.cs (1)
865return new TimeSpan(_GetTotalPauseDuration());
System.Private.DataContractSerialization (4)
System\Runtime\Serialization\DateTimeOffsetAdapter.cs (2)
45return new DateTimeOffset(value.UtcDateTime, new TimeSpan(0, value.OffsetMinutes, 0)); 53return deserialized.ToOffset(new TimeSpan(0, value.OffsetMinutes, 0));
System\Xml\ValueHandle.cs (1)
400return new TimeSpan(GetInt64());
System\Xml\XmlConverter.cs (1)
947TimeSpan ts = new TimeSpan(hourDelta, minuteDelta, 0);
System.Private.Windows.Core (2)
System\IO\BinaryReaderExtensions.cs (1)
176values.Add((T)(object)new TimeSpan(reader.ReadInt64()));
System\Value.PackedDateTimeOffset.cs (1)
70TimeSpan offset = new(
System.Private.Xml (12)
System\Xml\BinaryXml\SqlUtils.cs (2)
588return SQLBaseDate.Add(new TimeSpan(dateticks * TimeSpan.TicksPerDay + 664DateTimeOffset dto = new DateTimeOffset(dateTicks + timeTicks + zoneTicks, new TimeSpan(zoneTicks));
System\Xml\Schema\XsdDateTime.cs (7)
358XsdDateTimeKind.LocalEastOfZulu => new DateTime(_dt.Subtract(new TimeSpan(ZoneHour, ZoneMinute, 0)).Ticks, DateTimeKind.Utc), 359XsdDateTimeKind.LocalWestOfZulu => new DateTime(_dt.Add(new TimeSpan(ZoneHour, ZoneMinute, 0)).Ticks, DateTimeKind.Utc), 412ticks = result.Ticks - new TimeSpan(xdt.ZoneHour, xdt.ZoneMinute, 0).Ticks; 425ticks = result.Ticks + new TimeSpan(xdt.ZoneHour, xdt.ZoneMinute, 0).Ticks; 467result = new DateTimeOffset(dt, new TimeSpan(xdt.ZoneHour, xdt.ZoneMinute, 0)); 470result = new DateTimeOffset(dt, new TimeSpan(-xdt.ZoneHour, -xdt.ZoneMinute, 0)); 473result = new DateTimeOffset(dt, new TimeSpan(0));
System\Xml\Schema\XsdDuration.cs (3)
309result = new TimeSpan(long.MinValue); 313result = new TimeSpan(-((long)ticks)); 318result = new TimeSpan((long)ticks);
System.Resources.Extensions (2)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (2)
599return new TimeSpan(_store.ReadInt64()); 700return new TimeSpan(ticks);
System.Runtime.Caching (9)
System\Runtime\Caching\CacheExpires.cs (6)
88private static readonly TimeSpan s_COUNT_INTERVAL = new TimeSpan(CacheExpires._tsPerBucket.Ticks / COUNTS_LENGTH); 760internal static readonly TimeSpan MIN_UPDATE_DELTA = new TimeSpan(0, 0, 1); 761internal static readonly TimeSpan MIN_FLUSH_INTERVAL = new TimeSpan(0, 0, 1); 762internal static readonly TimeSpan _tsPerBucket = new TimeSpan(0, 0, 20); 765private static readonly TimeSpan s_tsPerCycle = new TimeSpan(NUMBUCKETS * _tsPerBucket.Ticks); 845TimeSpan due = _tsPerBucket - (new TimeSpan(utcNow.Ticks % _tsPerBucket.Ticks));
System\Runtime\Caching\CacheUsage.cs (2)
821internal static readonly TimeSpan NEWADD_INTERVAL = new TimeSpan(0, 0, 10); 822internal static readonly TimeSpan CORRELATED_REQUEST_TIMEOUT = new TimeSpan(0, 0, 1);
System\Runtime\Caching\MemoryCache.cs (1)
28private static readonly TimeSpan s_oneYear = new TimeSpan(365, 0, 0, 0);
System.ServiceModel.Http (5)
System\ServiceModel\Channels\HttpChannelFactory.cs (1)
31private static CacheControlHeaderValue s_requestCacheHeader = new CacheControlHeaderValue { NoCache = true, MaxAge = new TimeSpan(0) };
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (4)
1043throw Fx.Exception.AsError(new TimeoutException(InternalSR.TaskTimedOutError(new TimeSpan(ReadTimeout)))); 1046throw WebSocketHelper.ConvertAndTraceException(ex, new TimeSpan(ReadTimeout), WebSocketHelper.ReceiveOperation); 1123throw Fx.Exception.AsError(new TimeoutException(InternalSR.TaskTimedOutError(new TimeSpan(WriteTimeout)))); 1126throw WebSocketHelper.ConvertAndTraceException(ex, new TimeSpan(WriteTimeout), WebSocketHelper.SendOperation);
System.ServiceModel.Primitives (3)
Internals\System\Runtime\Ticks.cs (1)
39return new TimeSpan(ticks);
System\ServiceModel\Diagnostics\TraceUtility.cs (1)
86TimeSpan elapsedTime = new TimeSpan(DateTime.UtcNow.Ticks - startTicks);
System\ServiceModel\Security\IssuanceTokenProviderBase.cs (1)
313DateTime effectiveExpirationTime = TimeoutHelper.Add(serviceToken.ValidFrom.ToUniversalTime(), new TimeSpan(effectiveTicksInterval));
System.Text.Json (1)
System\Text\Json\JsonHelpers.Date.cs (1)
434value = new DateTimeOffset(ticks: dateTime.Ticks, offset: new TimeSpan(ticks: offsetTicks));
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\RegexMatchTimeoutException.cs (1)
61MatchTimeout = new TimeSpan(info.GetInt64("timeoutTicks"));
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\SlidingWindowRateLimiter.cs (1)
82_replenishmentPeriod = new TimeSpan(_options.Window.Ticks / _options.SegmentsPerWindow);
System.Transactions.Local (2)
System\Transactions\TransactionManager.cs (2)
313return new TimeSpan(Interlocked.Read(ref s_defaultTimeoutTicks)); 378Interlocked.Exchange(ref s_defaultTimeoutTicks, ValidateTimeout(new TimeSpan(defaultTimeoutTicks)).Ticks);
System.Windows.Controls.Ribbon (2)
Microsoft\Windows\Controls\Ribbon\RibbonGroup.cs (2)
1306TimeSpan twoTenthsOfASeconds = new TimeSpan(0, 0, 0, 0, 200); 1311TimeSpan fourTenthsOfASeconds = new TimeSpan(0, 0, 0, 0, 400);
12334 references to TimeSpan
AnalyzerRunner (3)
PerformanceTracker.cs (2)
38public TimeSpan Elapsed => _stopwatch.Elapsed; 49var elapsedTime = Elapsed;
Program.cs (1)
103await Task.Delay(TimeSpan.FromSeconds(5)).ConfigureAwait(false);
aspire (9)
Backchannel\ExtensionBackchannel.cs (3)
88using var timer = new PeriodicTimer(TimeSpan.FromMilliseconds(50)); 107var waitingFor = DateTimeOffset.UtcNow - startTime; 108if (waitingFor > TimeSpan.FromSeconds(10))
Commands\PublishCommandBase.cs (1)
642public override IRenderable Render(RenderOptions options, ProgressTask task, TimeSpan deltaTime)
DotNet\DotNetCliRunner.cs (3)
582using var timer = new PeriodicTimer(TimeSpan.FromMilliseconds(50)); 621var waitingFor = DateTimeOffset.UtcNow - startTime; 622if (waitingFor > TimeSpan.FromSeconds(10))
NuGet\NuGetPackageCache.cs (1)
61entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(1);
NuGet\NuGetPackagePrefetcher.cs (1)
77using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(1));
Aspire.Azure.AI.OpenAI.Tests (2)
AspireAzureAIOpenAIExtensionsTests.cs (2)
159var networkTimeout = TimeSpan.FromSeconds(123);
Aspire.Cli.Tests (20)
CliTestConstants.cs (4)
8public static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(10); 9public static readonly TimeSpan LongTimeout = TimeSpan.FromSeconds(10);
Hosting\CliOrphanDetectorTests.cs (15)
28await detector.StartAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 47await detector.StartAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 70await detector.StartAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 91await detector.StartAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 121await detector.StartAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 125fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 129fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 163await detector.StartAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 189await detector.StartAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 192fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 195fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 198fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 201fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 231await resourcesCreatedTcs.Task.WaitAsync(TimeSpan.FromSeconds(60)); 234await pendingRun.WaitAsync(TimeSpan.FromSeconds(60));
TestServices\TestAppHostBackchannel.cs (1)
77using var timer = new PeriodicTimer(TimeSpan.FromSeconds(1));
Aspire.Components.Common.TestUtilities (1)
ActivityNotifier.cs (1)
18public async Task<List<Activity>> TakeAsync(int count, TimeSpan timeout)
Aspire.Confluent.Kafka (19)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\InstrumentedConsumer.cs (7)
105public ConsumeResult<TKey, TValue>? Consume(TimeSpan timeout) 227public List<TopicPartitionOffset> Committed(TimeSpan timeout) 232public List<TopicPartitionOffset> Committed(IEnumerable<TopicPartition> partitions, TimeSpan timeout) 242public List<TopicPartitionOffset> OffsetsForTimes(IEnumerable<TopicPartitionTimestamp> timestampsToSearch, TimeSpan timeout) 252public WatermarkOffsets QueryWatermarkOffsets(TopicPartition topicPartition, TimeSpan timeout) 311private static void RecordReceive(TopicPartition topicPartition, TimeSpan duration, string? errorType = null) 345TimeSpan duration = endTime - startTime;
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\InstrumentedProducer.cs (12)
76TimeSpan duration = end - start; 123TimeSpan duration = end - start; 166TimeSpan duration = end - start; 207TimeSpan duration = end - start; 216public int Poll(TimeSpan timeout) 221public int Flush(TimeSpan timeout) 231public void InitTransactions(TimeSpan timeout) 241public void CommitTransaction(TimeSpan timeout) 251public void AbortTransaction(TimeSpan timeout) 261public void SendOffsetsToTransaction(IEnumerable<TopicPartitionOffset> offsets, IConsumerGroupMetadata groupMetadata, TimeSpan timeout) 309private static void RecordPublish(string topic, TimeSpan duration, string? errorType = null) 317private static void RecordPublish(TopicPartition topicPartition, TimeSpan duration, string? errorType = null)
Aspire.Confluent.Kafka.Tests (2)
ProducerConformanceTests.cs (1)
58service.Flush(TimeSpan.FromMilliseconds(1000));
ProducerExtensions.cs (1)
12while (producer.Flush(TimeSpan.FromMilliseconds(100)) != 0)
Aspire.Dashboard (75)
Components\Controls\Chart\ChartBase.cs (9)
26private TimeSpan _tickDuration; 56public required TimeSpan Duration { get; set; } 106else if (_lastUpdateTime.Add(TimeSpan.FromSeconds(0.2)) < TimeProvider.GetUtcNow()) 126var pointDuration = Duration / pointCount; 223start = start.Subtract(TimeSpan.FromSeconds(1)); 224end = end.Add(TimeSpan.FromSeconds(1)); 379var pointDuration = Duration / pointCount; 479private static DateTimeOffset CalcOffset(int pointIndex, DateTimeOffset now, TimeSpan pointDuration) 521return TimeProvider.GetUtcNow().Subtract(TimeSpan.FromSeconds(1)); // Compensate for delay in receiving metrics from services.
Components\Controls\Chart\ChartContainer.razor.cs (3)
35public required TimeSpan Duration { get; set; } 70_tickTimer = new PeriodicTimer(TimeSpan.FromSeconds(0.2)); 189var startDate = endDate.Subtract(Duration + TimeSpan.FromSeconds(30));
Components\Controls\Chart\MetricTable.razor.cs (1)
45if (inProgressDataTime - _lastUpdate < TimeSpan.FromSeconds(1))
Components\Pages\ConsoleLogs.razor.cs (2)
66public TimeSpan GetCancelElapsedTime() => Stopwatch.GetElapsedTime(_cancelTimestamp); 198await loadingTcs.Task.WaitAsync(TimeSpan.FromSeconds(5), _resourceSubscriptionToken);
Components\Pages\Metrics.razor.cs (13)
22private List<SelectViewModel<TimeSpan>> _durations = null!; 23private static readonly TimeSpan s_defaultDuration = TimeSpan.FromMinutes(5); 84_durations = new List<SelectViewModel<TimeSpan>> 86new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastOneMinute)], Id = TimeSpan.FromMinutes(1) }, 87new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastFiveMinutes)], Id = TimeSpan.FromMinutes(5) }, 88new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastFifteenMinutes)], Id = TimeSpan.FromMinutes(15) }, 89new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastThirtyMinutes)], Id = TimeSpan.FromMinutes(30) }, 90new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastHour)], Id = TimeSpan.FromHours(1) }, 91new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastThreeHours)], Id = TimeSpan.FromHours(3) }, 92new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastSixHours)], Id = TimeSpan.FromHours(6) }, 93new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastTwelveHours)], Id = TimeSpan.FromHours(12) }, 261public SelectViewModel<TimeSpan> SelectedDuration { get; set; } = null!;
DashboardWebApplication.cs (1)
799options.ExpireTimeSpan = TimeSpan.FromDays(3);
Model\DashboardCommandExecutor.cs (1)
78await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
Model\Otlp\SpanWaterfallViewModel.cs (2)
142var relativeStart = span.StartTime - traceStart; 162var logRelativeStart = log.TimeStamp - traceStart;
Model\TraceLinkHelpers.cs (1)
80await Task.Delay(TimeSpan.FromSeconds(0.5), cts.Token).ConfigureAwait(false);
Model\TracesViewModel.cs (1)
30public TimeSpan MaxDuration { get; private set; }
Otlp\Model\DurationFormatter.cs (14)
21new UnitStep { Unit = "d", Ticks = TimeSpan.TicksPerDay, Threshold = TimeSpan.TicksPerDay }, 22new UnitStep { Unit = "h", Ticks = TimeSpan.TicksPerHour, Threshold = TimeSpan.TicksPerHour }, 23new UnitStep { Unit = "m", Ticks = TimeSpan.TicksPerMinute, Threshold = TimeSpan.TicksPerMinute }, 24new UnitStep { Unit = "s", Ticks = TimeSpan.TicksPerSecond, Threshold = TimeSpan.TicksPerSecond / 10, IsDecimal = true }, 25new UnitStep { Unit = "ms", Ticks = TimeSpan.TicksPerMillisecond, Threshold = TimeSpan.TicksPerMillisecond / 100, IsDecimal = true }, 26new UnitStep { Unit = "μs", Ticks = TimeSpan.TicksPerMicrosecond, Threshold = TimeSpan.TicksPerMicrosecond, IsDecimal = true }, 29public static string FormatDuration(TimeSpan duration) 49public static string GetUnit(TimeSpan duration)
Otlp\Model\OtlpHelpers.cs (1)
180return (long)(nanoseconds / TimeSpan.NanosecondsPerTick);
Otlp\Model\OtlpSpan.cs (1)
43public TimeSpan Duration => EndTime - StartTime;
Otlp\Model\OtlpTrace.cs (1)
21public TimeSpan Duration
Otlp\Storage\GetTracesResponse.cs (1)
11public required TimeSpan MaxDuration { get; init; }
Otlp\Storage\TelemetryRepository.cs (4)
33internal TimeSpan _subscriptionMinExecuteInterval = TimeSpan.FromMilliseconds(100); 503MaxDuration = TimeSpan.Zero 558var maxDuration = pagedResults.TotalItemCount > 0 ? results.Max(r => r.Duration) : default;
ServiceClient\DashboardClient.cs (9)
122KeepAlivePingDelay = TimeSpan.FromSeconds(20), 123KeepAlivePingTimeout = TimeSpan.FromSeconds(10), 155InitialBackoff = TimeSpan.FromSeconds(1), 156MaxBackoff = TimeSpan.FromSeconds(5), 314var delay = ExponentialBackOff(retryContext.ErrorCount, maxSeconds: 15); 340static TimeSpan ExponentialBackOff(int errorCount, double maxSeconds) 342return TimeSpan.FromSeconds(Math.Min(Math.Pow(2, errorCount - 1), maxSeconds)); 591await foreach (var batch in channel.GetBatchesAsync(minReadInterval: TimeSpan.FromMilliseconds(100), cancellationToken: enumeratorCancellationToken).ConfigureAwait(false)) 685await foreach (var batch in channel.GetBatchesAsync(TimeSpan.FromMilliseconds(100), combinedTokens.Token).ConfigureAwait(false))
src\Shared\ChannelExtensions.cs (3)
27TimeSpan? minReadInterval = null, 40var s = lastRead.Value.Add(minReadInterval.Value) - DateTime.UtcNow; 41if (s > TimeSpan.Zero)
Utils\CallbackThrottler.cs (5)
14public CallbackThrottler(string name, ILogger logger, TimeSpan minExecuteInterval, Func<Task> callback, ExecutionContext? executionContext) 28private readonly TimeSpan _minExecuteInterval; 48var minExecuteInterval = _minExecuteInterval; 49var s = lastExecute.Value.Add(minExecuteInterval) - DateTime.UtcNow; 50if (s > TimeSpan.Zero)
Utils\DashboardUIHelpers.cs (2)
30public static readonly TimeSpan ToastTimeout = TimeSpan.FromMilliseconds(5000);
Aspire.Dashboard.Components.Tests (28)
Controls\PlotlyChartTests.cs (1)
85builder.Add(p => p.Duration, TimeSpan.FromSeconds(1));
Layout\MainLayoutTests.cs (3)
75await messageShownTcs.Task.WaitAsync(TimeSpan.FromSeconds(5)); 81Assert.True(await dismissedSettingSetTcs.Task.WaitAsync(TimeSpan.FromSeconds(5))); 120var completedTask = await Task.WhenAny(messageShownTcs.Task, timeoutTask).WaitAsync(TimeSpan.FromSeconds(5));
Pages\MetricsTests.cs (1)
360Assert.Equal(TimeSpan.FromMinutes(720), viewModel.SelectedDuration.Id);
Shared\DashboardPageTestContext.cs (1)
12DefaultWaitTimeout = TimeSpan.FromSeconds(10);
Shared\TestTimeProvider.cs (2)
17UtcNow = new DateTimeOffset(2025, 12, 20, 23, 59, 59, TimeSpan.Zero); 25public override TimeZoneInfo LocalTimeZone => _localTimeZone ??= TimeZoneInfo.CreateCustomTimeZone(nameof(TestTimeProvider), TimeSpan.FromHours(1), nameof(TestTimeProvider), nameof(TestTimeProvider));
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (2)
238TimeSpan? subscriptionMinExecuteInterval = null, 280var timeSinceEpoch = dateTime.ToUniversalTime() - unixEpoch;
Aspire.Dashboard.Tests (66)
ChannelExtensionsTests.cs (6)
69var minReadInterval = TimeSpan.FromMilliseconds(500); 99var elapsed = stopwatch.Elapsed; 113var minReadInterval = TimeSpan.FromMilliseconds(50000); 152var elapsed = stopwatch.Elapsed;
CustomAssert.cs (3)
10public static void AssertExceedsMinInterval(TimeSpan duration, TimeSpan minInterval) 13Assert.True(duration >= minInterval.Subtract(TimeSpan.FromMilliseconds(50)), $"Elapsed time {duration} should be greater than min interval {minInterval}.");
DurationFormatterTests.cs (30)
26Assert.Equal(unit, DurationFormatter.GetUnit(TimeSpan.FromTicks(ticks))); 32Assert.Equal("1μs", DurationFormatter.FormatDuration(TimeSpan.FromTicks(1 * TimeSpan.TicksPerMicrosecond))); 38var input = 10 * TimeSpan.TicksPerDay + 13 * TimeSpan.TicksPerHour + 30 * TimeSpan.TicksPerMinute; 39Assert.Equal("10d 14h", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 45var input = 2 * TimeSpan.TicksPerDay + 5 * TimeSpan.TicksPerMinute; 46Assert.Equal("2d", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 52var input = 2 * TimeSpan.TicksPerMillisecond + 357 * TimeSpan.TicksPerMicrosecond; 53Assert.Equal(2.36m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 59var input = 2 * TimeSpan.TicksPerSecond + 357 * TimeSpan.TicksPerMillisecond; 60Assert.Equal(2.36m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 66var input = 2 * TimeSpan.TicksPerMinute + 30 * TimeSpan.TicksPerSecond + 555 * TimeSpan.TicksPerMillisecond; 67Assert.Equal("2m 31s", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 73var input = 2 * TimeSpan.TicksPerHour + 30 * TimeSpan.TicksPerMinute + 30 * TimeSpan.TicksPerSecond; 74Assert.Equal("2h 31m", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 81Assert.Equal(0.92m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 87var input = 915 * TimeSpan.TicksPerMillisecond; 88Assert.Equal(0.92m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 94var input = (double)TimeSpan.TicksPerMicrosecond / 10; 95Assert.Equal(0.1m.ToString("0.##μs", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks((long)input))); 102Assert.Equal("0μs", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input)));
Integration\IntegrationTestHelpers.cs (2)
168InitialBackoff = TimeSpan.FromSeconds(1), 169MaxBackoff = TimeSpan.FromSeconds(5),
TelemetryRepositoryTests\LogTests.cs (3)
705var minExecuteInterval = TimeSpan.FromMilliseconds(500); 773var elapsed = stopwatch.Elapsed;
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (2)
238TimeSpan? subscriptionMinExecuteInterval = null, 280var timeSinceEpoch = dateTime.ToUniversalTime() - unixEpoch;
tests\Shared\TestCertificateLoader.cs (2)
12private static readonly TimeSpan s_mutexTimeout = TimeSpan.FromSeconds(120);
Aspire.EndToEnd.Tests (15)
tests\Shared\TemplatesTesting\AspireProject.cs (12)
116.WithTimeout(TimeSpan.FromMinutes(5)); 275var startupTimeoutTask = Task.Delay(TimeSpan.FromSeconds(AppStartupWaitTimeoutSecs), token); 298var allOutputCompleteTimeoutTask = Task.Delay(TimeSpan.FromSeconds(5), token); 366cts.CancelAfter(TimeSpan.FromSeconds(DashboardAvailabilityTimeoutSecs)); 384Delay = TimeSpan.FromSeconds(1) 474.WithTimeout(TimeSpan.FromSeconds(30)); 487.WithTimeout(TimeSpan.FromSeconds(30)); 515handler.PooledConnectionLifetime = TimeSpan.FromSeconds(5); 516handler.ConnectTimeout = TimeSpan.FromSeconds(5); 522options.AttemptTimeout.Timeout = TimeSpan.FromMinutes(2); 523options.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(5); // needs to be at least double the AttemptTimeout to pass options validation 524options.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(10);
tests\Shared\TemplatesTesting\ToolCommand.cs (3)
13private TimeSpan? _timeout; 74public ToolCommand WithTimeout(TimeSpan timeSpan) 164var completedTask = await Task.WhenAny(waitForExitTask, Task.Delay(TimeSpan.FromSeconds(5), token)).ConfigureAwait(false);
Aspire.Hosting (50)
Cli\CliOrphanDetector.cs (1)
66using var periodic = new PeriodicTimer(TimeSpan.FromSeconds(1), timeProvider);
Dashboard\DashboardServiceHost.cs (2)
191var elapsed = Stopwatch.GetElapsedTime(startTime); 193if (elapsed > TimeSpan.FromSeconds(2))
Dcp\DcpDependencyCheck.cs (1)
77processResult = await task.WaitAsync(TimeSpan.FromSeconds(_dcpOptions.DependencyCheckTimeout), cancellationToken).ConfigureAwait(false);
Dcp\DcpExecutor.cs (2)
53private static readonly TimeSpan s_disposeTimeout = TimeSpan.FromSeconds(10);
Dcp\DcpHost.cs (3)
91bool requireContainerRuntimeInitialization = _dcpOptions.ContainerRuntimeInitializationTimeout > TimeSpan.Zero; 101await Task.Delay(TimeSpan.FromSeconds(2), timeoutCancellation.Token).ConfigureAwait(false); 437using var timer = new PeriodicTimer(TimeSpan.FromSeconds(5), _timeProvider);
Dcp\DcpOptions.cs (3)
81public TimeSpan ContainerRuntimeInitializationTimeout { get; set; } 83public TimeSpan ServiceStartupWatchTimeout { get; set; } = TimeSpan.FromSeconds(10);
Dcp\DcpPipelineBuilder.cs (4)
18Delay = TimeSpan.FromMilliseconds(200), 21MaxDelay = TimeSpan.FromSeconds(3), 44MaxDelay = TimeSpan.FromSeconds(1), 72MaxDelay = TimeSpan.FromSeconds(30),
Dcp\KubernetesService.cs (10)
84private static readonly TimeSpan s_initialRetryDelay = TimeSpan.FromMilliseconds(100); 92public TimeSpan MaxRetryDuration { get; set; } = TimeSpan.FromSeconds(20); 293await foreach (var item in PeriodicRestartAsyncEnumerable.CreateAsync(innerWatchFactory, restartInterval: TimeSpan.FromMinutes(5), cancellationToken: cancellationToken).ConfigureAwait(false)) 418MaxDelay = TimeSpan.FromSeconds(1), 468var delay = s_initialRetryDelay; 514MaxDelay = TimeSpan.FromSeconds(5), 536MaxDelay = TimeSpan.FromMilliseconds(dcpOptions.Value.KubernetesConfigReadRetryIntervalMilliseconds), 586await Task.Delay(TimeSpan.FromMilliseconds(dcpOptions.Value.KubernetesConfigReadRetryIntervalMilliseconds), cancellationToken).ConfigureAwait(false);
Dcp\Model\ModelCommon.cs (3)
376public TimeSpan? Interval { get; set; } 382public TimeSpan? Timeout { get; set; } 388public TimeSpan? InitialDelay { get; set; }
Dcp\Process\ProcessUtil.cs (2)
18private static readonly TimeSpan s_processExitTimeout = TimeSpan.FromSeconds(5);
DistributedApplication.cs (3)
205TimeSpan timeout = TimeSpan.FromSeconds(30); 209timeout = TimeSpan.FromSeconds(timeoutSeconds);
Health\ResourceHealthCheckService.cs (9)
19internal TimeSpan HealthyHealthCheckInterval { get; set; } = TimeSpan.FromSeconds(30); 20internal TimeSpan NonHealthyHealthCheckStepInterval { get; set; } = TimeSpan.FromSeconds(1); 136if (lastDelayInterrupted && TimeSpan.FromSeconds(1) - timeProvider.GetElapsedTime(lastHealthCheckTimestamp) is { Ticks: > 0 } delay) 156report = new HealthReport(registrationKeysToCheck.ToDictionary(k => k, k => new HealthReportEntry(HealthStatus.Unhealthy, "Error calling HealthCheckService.", TimeSpan.Zero, ex, data: null)), TimeSpan.Zero); 209var delayInterval = nonHealthyReportCount == 0 348internal async Task<bool> DelayAsync(ResourceEvent? currentEvent, TimeSpan delay, CancellationToken cancellationToken)
src\Shared\ChannelExtensions.cs (3)
27TimeSpan? minReadInterval = null, 40var s = lastRead.Value.Add(minReadInterval.Value) - DateTime.UtcNow; 41if (s > TimeSpan.Zero)
Utils\PeriodicRestartAsyncEnumerable.cs (2)
20public static async IAsyncEnumerable<T> CreateAsync<T>(Func<T?, CancellationToken, Task<IAsyncEnumerable<T>>> enumerableFactory, TimeSpan restartInterval, [EnumeratorCancellation] CancellationToken cancellationToken) where T : struct 76public static async IAsyncEnumerable<T> CreateAsync<T>(Func<T?, CancellationToken, Task<IAsyncEnumerable<T>>> enumerableFactory, TimeSpan restartInterval, [EnumeratorCancellation] CancellationToken cancellationToken) where T : class?
VersionChecking\VersionCheckService.cs (2)
21private static readonly TimeSpan s_checkInterval = TimeSpan.FromDays(2);
Aspire.Hosting.Azure (5)
Provisioning\Internal\DefaultArmOperation.cs (2)
23public override ValueTask<Response<T>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => throw new NotSupportedException(); 25public override Response<T> WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => throw new NotSupportedException();
Provisioning\Internal\DefaultTokenCredentialProvider.cs (1)
35CredentialProcessTimeout = TimeSpan.FromSeconds(15)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (2)
18private static readonly TimeSpan s_processExitTimeout = TimeSpan.FromSeconds(5);
Aspire.Hosting.Azure.ServiceBus (7)
AzureServiceBusQueueResource.cs (3)
56public TimeSpan? DefaultMessageTimeToLive { get; set; } 62public TimeSpan? DuplicateDetectionHistoryTimeWindow { get; set; } 79public TimeSpan? LockDuration { get; set; }
AzureServiceBusSubscriptionResource.cs (2)
56public TimeSpan? DefaultMessageTimeToLive { get; set; } 73public TimeSpan? LockDuration { get; set; }
AzureServiceBusTopicResource.cs (2)
50public TimeSpan? DefaultMessageTimeToLive { get; set; } 56public TimeSpan? DuplicateDetectionHistoryTimeWindow { get; set; }
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
182RetentionInterval = TimeSpan.FromHours(1),
Aspire.Hosting.Azure.Tests (51)
AzureAIFoundryExtensionsTests.cs (1)
72var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
AzureBicepProvisionerTests.cs (1)
50var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
AzureCosmosDBEmulatorFunctionalTests.cs (6)
27var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 68var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 73Delay = TimeSpan.FromSeconds(10), 139var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 144Delay = TimeSpan.FromSeconds(10), 272var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10));
AzureDeployerTests.cs (1)
112await runTask.WaitAsync(TimeSpan.FromSeconds(10));
AzureEventHubsExtensionsTests.cs (4)
25var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 66var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 103await foreach (var partitionEvent in consumerClient.ReadEventsAsync(new ReadEventOptions { MaximumWaitTime = TimeSpan.FromSeconds(5) })) 118var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10));
AzureServiceBusExtensionsTests.cs (27)
26.WithProperties(queue => queue.DefaultMessageTimeToLive = TimeSpan.FromSeconds(1)); 30topic.DefaultMessageTimeToLive = TimeSpan.FromSeconds(1); 73var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 116var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 210queue.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 211queue.DuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(20); 213queue.LockDuration = TimeSpan.FromMinutes(5); 222topic.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 223topic.DuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(20); 230sub.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 231sub.LockDuration = TimeSpan.FromMinutes(5); 270Assert.Equal(TimeSpan.FromMinutes(1), queue.DefaultMessageTimeToLive.Value); 271Assert.Equal(TimeSpan.FromSeconds(20), queue.DuplicateDetectionHistoryTimeWindow.Value); 273Assert.Equal(TimeSpan.FromMinutes(5), queue.LockDuration.Value); 280Assert.Equal(TimeSpan.FromMinutes(1), topic.DefaultMessageTimeToLive.Value); 281Assert.Equal(TimeSpan.FromSeconds(20), topic.DuplicateDetectionHistoryTimeWindow.Value); 287Assert.Equal(TimeSpan.FromMinutes(1), subscription.DefaultMessageTimeToLive.Value); 288Assert.Equal(TimeSpan.FromMinutes(5), subscription.LockDuration.Value); 318queue.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 319queue.DuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(20); 321queue.LockDuration = TimeSpan.FromMinutes(5); 330topic.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 331topic.DuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(20); 338sub.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 339sub.LockDuration = TimeSpan.FromMinutes(5); 458queue.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 776var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10));
AzureSignalREmulatorFunctionalTest.cs (3)
42var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 78var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 83Delay = TimeSpan.FromSeconds(10),
AzureStorageEmulatorFunctionalTests.cs (6)
21var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 70var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 113var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 156var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 212var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 251var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
ProvisioningTestHelpers.cs (2)
434public override ValueTask<Response<T>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => new ValueTask<Response<T>>(Response.FromValue(Value, new MockResponse(200))); 436public override Response<T> WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => Response.FromValue(Value, new MockResponse(200));
Aspire.Hosting.Containers.Tests (3)
DockerSocketBindMountTests.cs (1)
38using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
WithDockerfileTests.cs (2)
729private static async Task WaitForResourceAsync(DistributedApplication app, string resourceName, string resourceState, TimeSpan? timeout = null) 731await app.ResourceNotifications.WaitForResourceAsync(resourceName, resourceState).WaitAsync(timeout ?? TimeSpan.FromMinutes(3));
Aspire.Hosting.Docker.Tests (1)
DockerComposePublisherTests.cs (1)
156await app.RunAsync().WaitAsync(TimeSpan.FromSeconds(60));
Aspire.Hosting.Garnet (7)
GarnetBuilderExtensions.cs (7)
156var interval = (persistenceAnnotation.Interval ?? TimeSpan.FromSeconds(60)).TotalMilliseconds.ToString(CultureInfo.InvariantCulture); 178/// Use <see cref="WithPersistence(IResourceBuilder{GarnetResource}, TimeSpan?)"/> to adjust Garnet persistence configuration, e.g.: 213/// Use <see cref="WithPersistence(IResourceBuilder{GarnetResource}, TimeSpan?)"/> to adjust Garnet persistence configuration, e.g.: 261TimeSpan? interval, long keysChangedThreshold) 282TimeSpan? interval = null) 289private sealed class PersistenceAnnotation(TimeSpan? interval) : IResourceAnnotation 291public TimeSpan? Interval => interval;
Aspire.Hosting.Garnet.Tests (8)
AddGarnetTests.cs (2)
307.WithPersistence(TimeSpan.FromSeconds(10)); 324.WithPersistence(TimeSpan.FromSeconds(60));
GarnetFunctionalTests.cs (5)
21var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 59var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 61.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(3) }) 103var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 105.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(10) })
GarnetPublicApiTests.cs (1)
95TimeSpan? interval = null;
Aspire.Hosting.GitHub.Models.Tests (18)
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Kafka.Tests (23)
KafkaFunctionalTests.cs (5)
60var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 88.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<ProduceException<string, string>>() }) 116var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 175.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<ProduceException<string, string>>() }) 228.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<ConsumeException>() })
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.MongoDB.Tests (9)
MongoDbFunctionalTests.cs (9)
33var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 70var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 72.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1) }) 108var cts = new CancellationTokenSource(TimeSpan.FromMinutes(6)); 110.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1) }) 254var cts = new CancellationTokenSource(TimeSpan.FromMinutes(6)); 256.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 352var cts = new CancellationTokenSource(TimeSpan.FromMinutes(6)); 354.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) })
Aspire.Hosting.MySql.Tests (29)
MySqlFunctionalTests.cs (11)
70.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() }) 124.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 303.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() }) 390.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() }) 474.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() }) 616var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 618.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 690var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 692.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 765var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 815var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Nats.Tests (3)
NatsFunctionalTests.cs (3)
67var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 109var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 323var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
Aspire.Hosting.NodeJs.Tests (19)
NodeAppFixture.cs (1)
42using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.OpenAI (5)
OpenAIExtensions.cs (1)
49timeout: TimeSpan.FromSeconds(5),
StatusPageHealthCheck.cs (4)
18private readonly TimeSpan _timeout; 31TimeSpan? timeout = null) 36_timeout = timeout ?? TimeSpan.FromSeconds(5); 127TimeSpan? timeout = null,
Aspire.Hosting.OpenAI.Tests (18)
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Oracle.Tests (8)
OracleFunctionalTests.cs (8)
32var cts = new CancellationTokenSource(TimeSpan.FromMinutes(15)); 80var cts = new CancellationTokenSource(TimeSpan.FromMinutes(15)); 87Delay = TimeSpan.FromSeconds(2) 252var cts = new CancellationTokenSource(TimeSpan.FromMinutes(15)); 259Delay = TimeSpan.FromSeconds(2) 350var cts = new CancellationTokenSource(TimeSpan.FromMinutes(15)); 357Delay = TimeSpan.FromSeconds(2) 443var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
Aspire.Hosting.PostgreSQL.Tests (33)
PostgresFunctionalTests.cs (15)
99var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 101.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<NpgsqlException>() }) 195var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 197.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<NpgsqlException>() }) 362var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 364.AddRetry(new() { MaxRetryAttempts = 3, Delay = TimeSpan.FromSeconds(2) }) 450var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 452.AddRetry(new() { MaxRetryAttempts = 3, Delay = TimeSpan.FromSeconds(2) }) 534var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 570await app.StopAsync(cts.Token).WaitAsync(TimeSpan.FromMinutes(1), cts.Token); 593var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 638var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 683var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 685.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 760var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Python.Tests (3)
AddPythonAppTests.cs (3)
103await app.ResourceNotifications.WaitForResourceAsync("pyproj", "Finished").WaitAsync(TimeSpan.FromSeconds(30)); 298var createVirtualEnvironmentProcessResult = createVirtualEnvironmentProcess!.WaitForExit(TimeSpan.FromMinutes(2)); 328var installRequirementsProcessResult = installRequirementsProcess!.WaitForExit(TimeSpan.FromMinutes(2));
Aspire.Hosting.Qdrant.Tests (5)
QdrantFunctionalTests.cs (5)
27var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 29.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<RpcException>() }) 91var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 93.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<RpcException>() }) 254var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
Aspire.Hosting.RabbitMQ.Tests (19)
RabbitMQFunctionalTests.cs (1)
98var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Redis (6)
RedisBuilderExtensions.cs (6)
116var interval = (persistenceAnnotation.Interval ?? TimeSpan.FromSeconds(60)).TotalSeconds.ToString(CultureInfo.InvariantCulture); 297/// Use <see cref="WithPersistence(IResourceBuilder{RedisResource}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.: 327/// Use <see cref="WithPersistence(IResourceBuilder{RedisResource}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.: 370public static IResourceBuilder<RedisResource> WithPersistence(this IResourceBuilder<RedisResource> builder, TimeSpan? interval = null, long keysChangedThreshold = 1) 378private sealed class PersistenceAnnotation(TimeSpan? interval, long keysChangedThreshold) : IResourceAnnotation 380public TimeSpan? Interval => interval;
Aspire.Hosting.Redis.Tests (8)
AddRedisTests.cs (2)
655.WithPersistence(TimeSpan.FromSeconds(10), 2); 676.WithPersistence(TimeSpan.FromSeconds(60));
RedisFunctionalTests.cs (6)
32var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 130var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 182var cts2 = new CancellationTokenSource(TimeSpan.FromSeconds(2)); 437var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 550.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 598var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
Aspire.Hosting.SqlServer.Tests (12)
SqlServerFunctionalTests.cs (12)
24var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 64var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 66.AddRetry(new() { MaxRetryAttempts = int.MaxValue, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 129var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 131.AddRetry(new() { MaxRetryAttempts = int.MaxValue, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 339var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 341.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 405var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 407.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 458var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 460.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 534var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
Aspire.Hosting.Testing (5)
DistributedApplicationFactory.cs (5)
30private TimeSpan _shutdownTimeout = TimeSpan.FromSeconds(10); 438static TimeSpan GetConfiguredTimeout() 448return TimeSpan.FromSeconds((int)timeoutInSeconds); 451return TimeSpan.FromMinutes(5);
Aspire.Hosting.Testing.Tests (23)
ResourceLoggerForwarderServiceTests.cs (2)
91await subscribedTcs.Task.WaitAsync(TimeSpan.FromSeconds(15)); 105await expectedLogCountTcs.Task.WaitAsync(TimeSpan.FromSeconds(15));
TestingBuilderTests.cs (16)
20private static readonly TimeSpan s_appAliveCheckTimeout = TimeSpan.FromMinutes(1); 179await app.WaitForTextAsync("Application started.").WaitAsync(TimeSpan.FromMinutes(1)); 238await app.WaitForTextAsync("Application started.").WaitAsync(TimeSpan.FromMinutes(1)); 276await app.WaitForTextAsync("Application started.").WaitAsync(TimeSpan.FromMinutes(1)); 319await app.WaitForTextAsync("Application started.").WaitAsync(TimeSpan.FromMinutes(1)); 370await app.WaitForTextAsync("Application started.").WaitAsync(TimeSpan.FromMinutes(1)); 419await app.WaitForTextAsync("Application started.").WaitAsync(TimeSpan.FromMinutes(1)); 444var timeout = TimeSpan.FromMinutes(5); 489var timeout = TimeSpan.FromMinutes(5); 497await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(10)); 510var timeout = TimeSpan.FromMinutes(5); 534await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(10));
TestingFactoryCrashTests.cs (2)
20var timeout = TimeSpan.FromMinutes(5);
TestingFactoryTests.cs (2)
52await _app.WaitForTextAsync("Application started.", "mywebapp1").WaitAsync(TimeSpan.FromMinutes(1)); 79await _app.ResourceNotifications.WaitForResourceAsync("mywebapp1").WaitAsync(TimeSpan.FromSeconds(60));
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (1)
63return new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero);
Aspire.Hosting.Tests (81)
Backchannel\AppHostBackchannelTests.cs (10)
37await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 39var backchannelReadyEvent = await backchannelReadyTaskCompletionSource.Task.WaitAsync(TimeSpan.FromSeconds(60)); 43await socket.ConnectAsync(endpoint).WaitAsync(TimeSpan.FromSeconds(60)); 45_ = await backchannelConnectedTaskCompletionSource.Task.WaitAsync(TimeSpan.FromSeconds(60)); 50await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 75await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 77var backchannelReadyEvent = await backchannelReadyTaskCompletionSource.Task.WaitAsync(TimeSpan.FromSeconds(60)); 81await socket.ConnectAsync(endpoint).WaitAsync(TimeSpan.FromSeconds(60)); 89).WaitAsync(TimeSpan.FromSeconds(60)); 100await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60));
Backchannel\Exec\ContainerResourceExecTests.cs (2)
38await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 62await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60));
Backchannel\Exec\ExecTestsBase.cs (1)
26var cts = new CancellationTokenSource(TimeSpan.FromSeconds(timeoutSec));
Backchannel\Exec\ProjectResourceExecTests.cs (5)
32await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 55await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 76await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 100await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 123await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60));
Codespaces\CodespacesUrlRewriterTests.cs (2)
28var abortToken = new CancellationTokenSource(TimeSpan.FromSeconds(60)); 64var abortToken = new CancellationTokenSource(TimeSpan.FromSeconds(60));
Dcp\DcpHostNotificationTests.cs (8)
79using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 129using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); 184using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); 238using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 289using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 308timeProvider.Advance(TimeSpan.FromSeconds(5)); 352using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 366await Task.Delay(TimeSpan.FromMilliseconds(100));
DistributedApplicationTests.cs (3)
63cts.CancelAfter(TimeSpan.FromMinutes(1)); 104cts.CancelAfter(TimeSpan.FromMinutes(1)); 1068ConnectTimeout = TimeSpan.FromSeconds(2)
Eventing\DistributedApplicationBuilderEventingTests.cs (2)
219var fired = countdownEvent.Wait(TimeSpan.FromSeconds(10)); 262TimeSpan.FromSeconds(10)
Health\ResourceHealthCheckServiceTests.cs (6)
263rhcs.NonHealthyHealthCheckStepInterval = TimeSpan.FromMilliseconds(10); 319timeProvider.Advance(TimeSpan.FromSeconds(5)); 322timeProvider.Advance(TimeSpan.FromSeconds(5)); 328var duration = thirdCheck - firstCheck; 329Assert.Equal(TimeSpan.FromSeconds(10), duration); 483rhcs.HealthyHealthCheckInterval = TimeSpan.FromSeconds(1);
Orchestrator\ParameterProcessorTests.cs (4)
91await watchTask.WaitAsync(TimeSpan.FromSeconds(5)); 320var logs = await logsTask.WaitAsync(TimeSpan.FromSeconds(5)); 344var logs = await logsTask.WaitAsync(TimeSpan.FromSeconds(5)); 387var logs = await logsTask.WaitAsync(TimeSpan.FromSeconds(5));
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (1)
63return new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero);
Utils\DockerUtils.cs (2)
21var exited = process.WaitForExit(TimeSpan.FromSeconds(3)); 37var exited = process.WaitForExit(TimeSpan.FromSeconds(3));
Utils\PeriodicRestartAsyncEnumerableTests.cs (10)
15cts.CancelAfter(TimeSpan.FromSeconds(1)); 20var innerFactory = (int? lastValue, CancellationToken cancellationToken) => Task.FromResult(CountingAsyncEnumerable(0, TimeSpan.FromMilliseconds(50), cancellationToken)); 22await foreach (var _ in PeriodicRestartAsyncEnumerable.CreateAsync(innerFactory, restartInterval: TimeSpan.FromSeconds(2), cancellationToken: cts.Token).ConfigureAwait(false)) 24if (DateTime.UtcNow - start > TimeSpan.FromSeconds(2)) 39cts.CancelAfter(TimeSpan.FromSeconds(1)); 43var innerFactory = (int? lastValue, CancellationToken cancellationToken) => Task.FromResult(RefCountingAsyncEnumerable(0, TimeSpan.FromMilliseconds(10), cancellationToken)); 45await foreach (var _ in PeriodicRestartAsyncEnumerable.CreateAsync(innerFactory, restartInterval: TimeSpan.FromMilliseconds(100), cancellationToken: cts.Token).ConfigureAwait(false)) 47if (DateTime.UtcNow - start > TimeSpan.FromSeconds(2)) 58static async IAsyncEnumerable<int> CountingAsyncEnumerable(int start, TimeSpan delay, [EnumeratorCancellation] CancellationToken cancellationToken) 70static async IAsyncEnumerable<int> RefCountingAsyncEnumerable(int start, TimeSpan delay, [EnumeratorCancellation] CancellationToken cancellationToken)
VersionChecking\VersionCheckServiceTests.cs (4)
70var currentDate = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero); 105var currentDate = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero); 145var currentDate = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero); 269public DateTimeOffset UtcNow { get; set; } = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero);
WaitForTests.cs (3)
246).WaitAsync(TimeSpan.FromSeconds(15)); 270).WaitAsync(TimeSpan.FromSeconds(15)); 299.WaitAsync(TimeSpan.FromSeconds(15));
Aspire.Hosting.Valkey (6)
ValkeyBuilderExtensions.cs (6)
168var interval = (persistenceAnnotation.Interval ?? TimeSpan.FromSeconds(60)).TotalSeconds.ToString(CultureInfo.InvariantCulture); 193/// Use <see cref="WithPersistence(IResourceBuilder{ValkeyResource}, TimeSpan?, long)"/> to adjust Valkey persistence configuration, e.g.: 230/// Use <see cref="WithPersistence(IResourceBuilder{ValkeyResource}, TimeSpan?, long)"/> to adjust Valkey persistence configuration, e.g.: 276TimeSpan? interval = null, 285private sealed class PersistenceAnnotation(TimeSpan? interval, long keysChangedThreshold) : IResourceAnnotation 287public TimeSpan? Interval => interval;
Aspire.Hosting.Valkey.Tests (21)
AddValkeyTests.cs (2)
297.WithPersistence(TimeSpan.FromSeconds(10), 2); 314.WithPersistence(TimeSpan.FromSeconds(60));
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
ValkeyFunctionalTests.cs (1)
200var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
Aspire.Hosting.Yarp.Tests (8)
YarpConfigGeneratorTests.cs (7)
27Timeout = TimeSpan.FromSeconds(1), 139ReactivationPeriod = TimeSpan.FromMinutes(5) 144Interval = TimeSpan.FromSeconds(4), 145Timeout = TimeSpan.FromSeconds(6), 162Expiration = TimeSpan.FromHours(3), 165MaxAge = TimeSpan.FromDays(1), 188ActivityTimeout = TimeSpan.FromSeconds(60),
YarpFunctionalTests.cs (1)
29var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
EntityFrameworkCoreCosmosSettings.cs (1)
54public TimeSpan? RequestTimeout { get; set; }
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (13)
AspireAzureEfCoreCosmosDBExtensionsTests.cs (9)
31cosmosBuilder.RequestTimeout(TimeSpan.FromSeconds(608)); 44Assert.Equal(TimeSpan.FromSeconds(608), extension.RequestTimeout); 70configureSettings: useSettings ? settings => settings.RequestTimeout = TimeSpan.FromSeconds(608) : null); 81Assert.Equal(TimeSpan.FromSeconds(608), extension.RequestTimeout); 107cosmosBuilder.RequestTimeout(TimeSpan.FromSeconds(123)); 110configureSettings: useSettings ? settings => settings.RequestTimeout = TimeSpan.FromSeconds(300) : null); 121Assert.Equal(TimeSpan.FromSeconds(123), extension.RequestTimeout); 374Assert.Equal(TimeSpan.Parse("60"), capturedSettings.RequestTimeout); 403Assert.Equal(TimeSpan.Parse("120"), capturedSettings.RequestTimeout);
EnrichCosmosDbTests.cs (4)
59builder.RequestTimeout(TimeSpan.FromSeconds(123)); 75Assert.Equal(TimeSpan.FromSeconds(123), extension.RequestTimeout); 128optionsBuilder.UseCosmos(ConnectionString, DatabaseName, builder => builder.RequestTimeout(TimeSpan.FromSeconds(123))); 131builder.EnrichCosmosDbContext<TestDbContext>(settings => settings.RequestTimeout = TimeSpan.FromSeconds(456));
Aspire.MongoDB.Driver (1)
AspireMongoDBDriverExtensions.cs (1)
184settings.HealthCheckTimeout > 0 ? TimeSpan.FromMilliseconds(settings.HealthCheckTimeout.Value) : null));
Aspire.NATS.Net.Tests (1)
AspireNatsClientExtensionsTests.cs (1)
227var activityList = await notifier.TakeAsync(1, TimeSpan.FromSeconds(10));
Aspire.Playground.Tests (27)
AppHostTests.cs (7)
50await Task.WhenAll(tasks).WaitAsync(TimeSpan.FromMinutes(5)); 70await app.WaitForResources().WaitAsync(TimeSpan.FromMinutes(5)); 75var timeout = TimeSpan.FromMinutes(5); 79await app.WaitForResource(ResourceName, TargetState).WaitAsync(TimeSpan.FromMinutes(5)); 124resilience.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(120); 125resilience.AttemptTimeout.Timeout = TimeSpan.FromSeconds(60);
Infrastructure\DistributedApplicationExtensions.cs (1)
246applyMigrationsHttpClient.Timeout = TimeSpan.FromSeconds(240);
ProjectSpecificTests.cs (1)
160cts.CancelAfter(TimeSpan.FromSeconds(timeoutSecs));
tests\Shared\AsyncTestHelpers.cs (18)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 76public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 91public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 106public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 121public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 126public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 159public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 193private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Pomelo.EntityFrameworkCore.MySql (2)
AspireEFMySqlExtensions.cs (2)
87Delay = TimeSpan.FromSeconds(1), 88MaxDelay = TimeSpan.FromSeconds(30),
Aspire.Qdrant.Client (1)
QdrantClientSettings.cs (1)
40public TimeSpan? HealthCheckTimeout { get; set; }
Aspire.RabbitMQ.Client (1)
AspireRabbitMQExtensions.cs (1)
188Delay = TimeSpan.FromSeconds(1),
Aspire.RabbitMQ.Client.Tests (2)
AspireRabbitMQExtensionsTests.cs (1)
157Assert.Equal(TimeSpan.FromSeconds(3), connectionFactory.SocketReadTimeout);
AspireRabbitMQLoggingTests.cs (1)
68await tsc.Task.WaitAsync(TimeSpan.FromMinutes(1));
Aspire.RabbitMQ.Client.v7.Tests (2)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQExtensionsTests.cs (1)
157Assert.Equal(TimeSpan.FromSeconds(3), connectionFactory.SocketReadTimeout);
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (1)
68await tsc.Task.WaitAsync(TimeSpan.FromMinutes(1));
Aspire.StackExchange.Redis (3)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
115if (parent.Duration == TimeSpan.Zero)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisInstrumentationOptions.cs (2)
18public TimeSpan FlushInterval { get; set; } = TimeSpan.FromSeconds(10);
Aspire.StackExchange.Redis.DistributedCaching.Tests (2)
DistributedCacheConformanceTests.cs (2)
56builder.Services.Configure<StackExchangeRedisInstrumentationOptions>(options => options.FlushInterval = TimeSpan.Zero); 67var activityList = await notifier.TakeAsync(3, TimeSpan.FromSeconds(10));
Aspire.StackExchange.Redis.OutputCaching.Tests (2)
OutputCacheConformanceTests.cs (2)
56builder.Services.Configure<StackExchangeRedisInstrumentationOptions>(options => options.FlushInterval = TimeSpan.Zero); 67var activityList = await notifier.TakeAsync(3, TimeSpan.FromSeconds(10));
Aspire.StackExchange.Redis.Tests (3)
AspireRedisExtensionsTests.cs (3)
277builder.Services.Configure<StackExchangeRedisInstrumentationOptions>(options => options.FlushInterval = TimeSpan.Zero); 291var activityList = await notifier.TakeAsync(1, TimeSpan.FromSeconds(10)); 379await outputCache.SetAsync("outputKey", [1, 2, 3, 4], tags: null, validFor: TimeSpan.MaxValue, cancellationToken: default);
Aspire.Templates.Tests (19)
PerTestFrameworkTemplatesTests.cs (1)
48.WithTimeout(TimeSpan.FromMinutes(3));
TemplateTestsBase.cs (3)
187cts.CancelAfter(TimeSpan.FromSeconds(timeoutSecs)); 326.WithTimeout(TimeSpan.FromSeconds(testRunTimeoutSecs)); 333.WithTimeout(TimeSpan.FromSeconds(testRunTimeoutSecs));
tests\Shared\TemplatesTesting\AspireProject.cs (12)
116.WithTimeout(TimeSpan.FromMinutes(5)); 275var startupTimeoutTask = Task.Delay(TimeSpan.FromSeconds(AppStartupWaitTimeoutSecs), token); 298var allOutputCompleteTimeoutTask = Task.Delay(TimeSpan.FromSeconds(5), token); 366cts.CancelAfter(TimeSpan.FromSeconds(DashboardAvailabilityTimeoutSecs)); 384Delay = TimeSpan.FromSeconds(1) 474.WithTimeout(TimeSpan.FromSeconds(30)); 487.WithTimeout(TimeSpan.FromSeconds(30)); 515handler.PooledConnectionLifetime = TimeSpan.FromSeconds(5); 516handler.ConnectTimeout = TimeSpan.FromSeconds(5); 522options.AttemptTimeout.Timeout = TimeSpan.FromMinutes(2); 523options.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(5); // needs to be at least double the AttemptTimeout to pass options validation 524options.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(10);
tests\Shared\TemplatesTesting\ToolCommand.cs (3)
13private TimeSpan? _timeout; 74public ToolCommand WithTimeout(TimeSpan timeSpan) 164var completedTask = await Task.WhenAny(waitForExitTask, Task.Delay(TimeSpan.FromSeconds(5), token)).ConfigureAwait(false);
AuthSamples.FunctionalTests (4)
CustomPolicyProviderTests.cs (4)
51var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 20)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture)); 67var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 5)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture)); 82var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 55)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture)); 98var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 20)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture));
AzureAppConfiguration.Web (1)
Program.cs (1)
11refresh.SetRefreshInterval(TimeSpan.FromSeconds(10));
AzureSearch.ApiService (1)
Program.cs (1)
172await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken);
BasicWebSite (2)
Controllers\DefaultValuesController.cs (2)
26TimeSpan timeSpan = default(TimeSpan))
BinaryFormatTests (7)
FormatTests\FormattedObject\HashTableTests.cs (2)
213{ TimeSpan.MinValue, TimeSpan.MaxValue }
FormatTests\FormattedObject\ListTests.cs (2)
33TimeSpan.MaxValue, 108new List<TimeSpan>() { new(0, 0, 50) }
FormatTests\FormattedObject\PrimitiveTypeTests.cs (3)
84{ (byte)PrimitiveType.TimeSpan, TimeSpan.MinValue }, 85{ (byte)PrimitiveType.TimeSpan, TimeSpan.MaxValue }, 135TimeSpan.MaxValue,
Binding.Http.IntegrationTests (2)
MtomBindingTestHelper.cs (2)
78binding.SendTimeout = TimeSpan.FromMinutes(5); 79binding.ReceiveTimeout = TimeSpan.FromMinutes(5);
Binding.ReliableSession.IntegrationTests (4)
NetHttpBindingTests.cs (2)
360TimeSpan keepAliveInterval = TimeSpan.FromSeconds(2);
WSHttpBindingTests.cs (2)
360TimeSpan keepAliveInterval = TimeSpan.FromSeconds(2);
Binding.Tcp.IntegrationTests (5)
NetTcpBindingTests.4.0.0.cs (5)
137binding.OpenTimeout = TimeSpan.FromSeconds(10); 138binding.SendTimeout = binding.ReceiveTimeout = TimeSpan.FromMinutes(10); 144Thread.Sleep(binding.OpenTimeout + TimeSpan.FromSeconds(5)); 175SendTimeout = TimeSpan.MaxValue, 176ReceiveTimeout = TimeSpan.MaxValue
CdkSample.AppHost (2)
Program.cs (2)
61queue.LockDuration = TimeSpan.FromMinutes(5); 77subscription.LockDuration = TimeSpan.FromMinutes(5);
Client.ChannelLayer.IntegrationTests (3)
DuplexChannelShapeTests.4.0.0.cs (1)
54replyMessage = channel.Receive(TimeSpan.FromSeconds(5));
DuplexChannelShapeTests.4.1.0.cs (2)
51replyMessage = channel.Receive(TimeSpan.FromSeconds(5)); 111replyMessage = channel.Receive(TimeSpan.FromSeconds(5));
Client.ClientBase.IntegrationTests (2)
ClientBaseTests.4.0.0.cs (1)
359TimeSpan timeout = ScenarioTestHelpers.TestTimeout;
SessionTests.cs (1)
186Thread.Sleep(TimeSpan.FromSeconds(10));
Client.ExpectedExceptions.IntegrationTests (15)
ExpectedExceptionTests.4.0.0.cs (9)
58TimeSpan serviceOperationTimeout = TimeSpan.FromMilliseconds(10000); 72binding.SendTimeout = TimeSpan.FromMilliseconds(5000); 105TimeSpan serviceOperationTimeout = TimeSpan.FromMilliseconds(5000); 119binding.SendTimeout = TimeSpan.FromMilliseconds(0); 249TimeSpan serverDelayTimeSpan = TimeSpan.FromMilliseconds(serverDelayMs); 258binding.SendTimeout = TimeSpan.FromMilliseconds(timeoutMs);
ExpectedExceptionTests.4.1.0.cs (6)
32binding.SendTimeout = TimeSpan.FromMilliseconds(40000); 164binding.SendTimeout = TimeSpan.FromMilliseconds(10000); 202binding.SendTimeout = TimeSpan.FromMilliseconds(10000); 499TimeSpan serverDelayTimeSpan = TimeSpan.FromMilliseconds(serverDelayMs); 508binding.SendTimeout = TimeSpan.FromMilliseconds(timeoutMs);
Client.TypedClient.IntegrationTests (3)
TypedProxyTests.4.0.0.cs (3)
25static TimeSpan maxTestWaitTime = TimeSpan.FromSeconds(10); 312replyMessage = channel.Request(requestMessage, TimeSpan.FromSeconds(60));
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\KnownTypeSymbols.cs (1)
81TimeSpan = compilation.GetBestTypeByMetadataName(typeof(TimeSpan));
ConfigurationSchemaGenerator.Tests (7)
GeneratorTests.cs (2)
1625Assert.True(TimeSpan.TryParse(validTimeSpanString, CultureInfo.InvariantCulture, out _)); 1637Assert.False(TimeSpan.TryParse(invalidTimeSpanString, CultureInfo.InvariantCulture, out _));
VariousTypes.cs (5)
46/// A value of type <see cref="TimeSpan"/>. 48public TimeSpan PropertyOfTimeSpan { get; set; } 81/// A <see cref="IDictionary{TKey,TValue}"/> of <see cref="string"/> to <see cref="TimeSpan"/>. 83public IDictionary<string, TimeSpan> PropertyOfStringToTimeSpan { get; } = new Dictionary<string, TimeSpan>();
Consumer (1)
ConsumerWorker.cs (1)
21result = consumer.Consume(TimeSpan.FromSeconds(1));
Contract.Service.IntegrationTests (8)
ServiceContractTests.4.1.0.cs (8)
247binding.SendTimeout = TimeSpan.FromMilliseconds(sendTimeoutMs); 309binding.SendTimeout = TimeSpan.FromMilliseconds(sendTimeoutMs); 679TimeSpan delayOperation = TimeSpan.FromSeconds(3); 769TimeSpan delayOperation = TimeSpan.FromSeconds(3); 859TimeSpan delayOperation = TimeSpan.FromSeconds(3);
CookieSample (1)
Program.cs (1)
15options.ExpireTimeSpan = TimeSpan.FromSeconds(20);
CookieSessionSample (1)
MemoryCacheTicketStore.cs (1)
36options.SetSlidingExpiration(TimeSpan.FromHours(1)); // TODO: configurable.
CosmosEndToEnd.ApiService (1)
Program.cs (1)
17configureDbContextOptions.RequestTimeout = TimeSpan.FromSeconds(120);
CustomResources.AppHost (1)
TestResource.cs (1)
54using var timer = new PeriodicTimer(TimeSpan.FromSeconds(seconds));
dotnet-dev-certs (4)
Program.cs (2)
48public static readonly TimeSpan HttpsCertificateValidity = TimeSpan.FromDays(365);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
276TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
dotnet-getdocument (1)
Exe.cs (1)
52if (!process.WaitForExit((int)(TimeSpan.FromMinutes(2).TotalMilliseconds)))
dotnet-openapi (1)
DebugMode.cs (1)
22Thread.Sleep(TimeSpan.FromSeconds(3));
dotnet-svcutil-lib (1310)
CodeDomFixup\MethodCreationHelper.cs (2)
1350private static CodeExpression CreateTimeSpanExpression(TimeSpan value) 1352return new CodeObjectCreateExpression(typeof(TimeSpan), new CodePrimitiveExpression(value.Ticks));
CodeDomFixup\System.ServiceModel.FederationCodeGen.cs (2)
71public static readonly TimeSpan DefaultMaxIssuedTokenCachingTime = default; 81public TimeSpan MaxIssuedTokenCachingTime { get => default; set { } }
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\SqlUtils.cs (5)
723private static void WriteTimeZone(StringBuilder sb, TimeSpan zone) 881return SQLBaseDate.Add(new TimeSpan(dateticks * TimeSpan.TicksPerDay + 882millisecond * TimeSpan.TicksPerMillisecond)); 1048return (data[p] | data[p + 1] << 8 | data[p + 2] << 16) * TimeSpan.TicksPerDay; 1083return (short)(data[pos] | data[pos + 1] << 8) * TimeSpan.TicksPerMinute;
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWriter.cs (1)
309if (value.Offset != TimeSpan.Zero)
FrameworkFork\Microsoft.Xml\Xml\schema\DatatypeImplementation.cs (7)
1878private static readonly Type s_atomicValueType = typeof(TimeSpan); 1879private static readonly Type s_listValueType = typeof(TimeSpan[]); 1912return ((TimeSpan)value1).CompareTo((TimeSpan)value2); 1929TimeSpan timeSpanValue; 1964TimeSpan timeSpanValue; 2003TimeSpan timeSpanValue;
FrameworkFork\Microsoft.Xml\Xml\schema\FacetChecker.cs (17)
830internal virtual Exception CheckValueFacets(TimeSpan value, XmlSchemaDatatype datatype) 1212TimeSpan timeSpanValue = (TimeSpan)datatype.ValueConverter.ChangeType(value, typeof(TimeSpan)); 1216internal override Exception CheckValueFacets(TimeSpan value, XmlSchemaDatatype datatype) 1223if (TimeSpan.Compare(value, (TimeSpan)restriction.MaxInclusive) > 0) 1231if (TimeSpan.Compare(value, (TimeSpan)restriction.MaxExclusive) >= 0) 1239if (TimeSpan.Compare(value, (TimeSpan)restriction.MinInclusive) < 0) 1247if (TimeSpan.Compare(value, (TimeSpan)restriction.MinExclusive) <= 0) 1263return MatchEnumeration((TimeSpan)value, enumeration); 1266private bool MatchEnumeration(TimeSpan value, ArrayList enumeration) 1270if (TimeSpan.Compare(value, (TimeSpan)enumeration[i]) == 0)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (15)
371protected static readonly Type TimeSpanType = typeof(TimeSpan); 623protected static TimeSpan StringToDayTimeDuration(string value) 629protected static TimeSpan StringToDuration(string value) 745protected static TimeSpan StringToYearMonthDuration(string value) 776protected static string DayTimeDurationToString(TimeSpan value) 781protected static string DurationToString(TimeSpan value) 870protected static string YearMonthDurationToString(TimeSpan value) 2074case XmlTypeCode.DayTimeDuration: return DayTimeDurationToString((TimeSpan)value); 2075case XmlTypeCode.Duration: return DurationToString((TimeSpan)value); 2076case XmlTypeCode.YearMonthDuration: return YearMonthDurationToString((TimeSpan)value); 2196case XmlTypeCode.DayTimeDuration: return ((TimeSpan)value); 2197case XmlTypeCode.Duration: return ((TimeSpan)value); 2198case XmlTypeCode.YearMonthDuration: return ((TimeSpan)value); 2652if (sourceType == TimeSpanType) return DurationToString((TimeSpan)value); 3527if (itemTypeDst == TimeSpanType) return ToArray<TimeSpan>(value, nsResolver);
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDateTime.cs (4)
179TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(dateTime); 211TimeSpan zoneOffset = dateTimeOffset.Offset; 414TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day); 474TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day);
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDuration.cs (17)
73public XsdDuration(TimeSpan timeSpan) : this(timeSpan, DurationType.Duration) 81public XsdDuration(TimeSpan timeSpan, DurationType durationType) 101int years = (int)(ticksPos / ((ulong)TimeSpan.TicksPerDay * 365)); 102int months = (int)((ticksPos % ((ulong)TimeSpan.TicksPerDay * 365)) / ((ulong)TimeSpan.TicksPerDay * 30)); 124_days = (int)(ticksPos / (ulong)TimeSpan.TicksPerDay); 125_hours = (int)((ticksPos / (ulong)TimeSpan.TicksPerHour) % 24); 126_minutes = (int)((ticksPos / (ulong)TimeSpan.TicksPerMinute) % 60); 127_seconds = (int)((ticksPos / (ulong)TimeSpan.TicksPerSecond) % 60); 298public TimeSpan ToTimeSpan() 307public TimeSpan ToTimeSpan(DurationType durationType) 309TimeSpan result; 318internal Exception TryToTimeSpan(out TimeSpan result) 323internal Exception TryToTimeSpan(DurationType durationType, out TimeSpan result) 355ticks *= (ulong)TimeSpan.TicksPerSecond; 361ticks *= (ulong)TimeSpan.TicksPerDay; 385result = TimeSpan.MinValue;
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (5)
820public static string ToString(TimeSpan value) 1279public static TimeSpan ToTimeSpan(string s) 1282TimeSpan timeSpan; 1299internal static Exception TryToTimeSpan(string s, out TimeSpan result) 1307result = TimeSpan.MinValue;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (1)
926else if (type == typeof(TimeSpan))
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (1)
184s_typeOfTimeSpan = typeof(TimeSpan);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\PrimitiveDataContract.cs (2)
743internal TimeSpanDataContract(XmlDictionaryString name, XmlDictionaryString ns) : base(typeof(TimeSpan), name, ns) 752writer.WriteTimeSpan((TimeSpan)obj);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlReaderDelegator.cs (1)
528internal TimeSpan ReadElementContentAsTimeSpan()
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlWriterDelegator.cs (3)
357WriteTimeSpan((TimeSpan)value); 601internal void WriteTimeSpan(TimeSpan value) 608internal void WriteTimeSpan(TimeSpan value, XmlDictionaryString name, XmlDictionaryString ns)
FrameworkFork\System.Runtime.Serialization\System\Xml\ArrayHelper.cs (6)
368internal class TimeSpanArrayHelperWithString : ArrayHelper<string, TimeSpan> 372protected override int ReadArray(XmlDictionaryReader reader, string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 377protected override void WriteArray(XmlDictionaryWriter writer, string prefix, string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 383internal class TimeSpanArrayHelperWithDictionaryString : ArrayHelper<XmlDictionaryString, TimeSpan> 387protected override int ReadArray(XmlDictionaryReader reader, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count) 392protected override void WriteArray(XmlDictionaryWriter writer, string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\ValueHandle.cs (2)
213return typeof(TimeSpan); 409public TimeSpan ToTimeSpan()
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseReader.cs (5)
1595public override TimeSpan ReadContentAsTimeSpan() 1600TimeSpan value = node.Value.ToTimeSpan(); 1664else if (type == typeof(TimeSpan)) 1838public override TimeSpan[] ReadTimeSpanArray(string localName, string namespaceUri) 1843public override TimeSpan[] ReadTimeSpanArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseWriter.cs (3)
1204else if (value is TimeSpan) 1206WriteValue((TimeSpan)value); 1404public override void WriteValue(TimeSpan value)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryReader.cs (6)
238public override TimeSpan ReadElementContentAsTimeSpan() 245TimeSpan value = BufferReader.ReadTimeSpan(); 1173type = typeof(TimeSpan); 1498private int ReadArray(TimeSpan[] array, int offset, int count) 1510public override int ReadArray(string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 1517public override int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryWriter.cs (5)
897public override void WriteTimeSpanText(TimeSpan value) 972public void WriteTimeSpanArray(TimeSpan[] array, int offset, int count) 1214else if (type == typeof(TimeSpan)) 1609public override void WriteArray(string prefix, string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 1622public override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBufferReader.cs (2)
486public TimeSpan ReadTimeSpan() 492return TimeSpan.FromTicks(value);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlConverter.cs (7)
293static public TimeSpan ToTimeSpan(string value) 313static public TimeSpan ToTimeSpan(byte[] buffer, int offset, int count) 423static public string ToString(TimeSpan value) { return XmlConvert.ToString(value); } 448else if (value is TimeSpan) 449return ToString((TimeSpan)value); 987TimeSpan ts = new TimeSpan(hourDelta, minuteDelta, 0); 1108TimeSpan ts = TimeZoneInfo.Local.GetUtcOffset(value);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryAsyncCheckWriter.cs (3)
375public override void WriteValue(TimeSpan value) 516public override void WriteArray(string prefix, string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 522public override void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryReader.cs (7)
561public virtual TimeSpan ReadContentAsTimeSpan() 813public virtual TimeSpan ReadElementContentAsTimeSpan() 816TimeSpan value; 1173public virtual TimeSpan[] ReadTimeSpanArray(string localName, string namespaceUri) 1178public virtual TimeSpan[] ReadTimeSpanArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri) 1183public virtual int ReadArray(string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 1195public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryWriter.cs (5)
184public virtual void WriteValue(TimeSpan value) 276else if (type == typeof(TimeSpan)) 305else if (type == typeof(TimeSpan)) 571public virtual void WriteArray(string prefix, string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 582public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlNodeWriter.cs (1)
87public abstract void WriteTimeSpanText(TimeSpan value);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlUTF8TextWriter.cs (1)
800public override void WriteTimeSpanText(TimeSpan value)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InputQueue.cs (17)
75public IAsyncResult BeginDequeue(TimeSpan timeout, AsyncCallback callback, object state) 113public IAsyncResult BeginWaitForItem(TimeSpan timeout, AsyncCallback callback, object state) 146public T Dequeue(TimeSpan timeout) 159public bool Dequeue(TimeSpan timeout, out T value) 392public bool WaitForItem(TimeSpan timeout) 804public AsyncQueueReader(InputQueue<T> inputQueue, TimeSpan timeout, AsyncCallback callback, object state) 812if (timeout != TimeSpan.MaxValue) 814_timer = new Timer(new TimerCallback(s_timerCallback), this, timeout, TimeSpan.FromMilliseconds(-1)); 840_timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 867public AsyncQueueWaiter(TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state) 869if (timeout != TimeSpan.MaxValue) 871_timer = new Timer(new TimerCallback(s_timerCallback), this, timeout, TimeSpan.FromMilliseconds(-1)); 896timely = (_timer == null) || _timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 1031public bool Wait(TimeSpan timeout, out T value) 1093public bool Wait(TimeSpan timeout)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TaskHelpers.cs (5)
153public static async Task<bool> AwaitWithTimeout(this Task task, TimeSpan timeout) 160if (timeout == TimeSpan.MaxValue || timeout == Timeout.InfiniteTimeSpan) 193public static bool WaitWithTimeSpan(this Task task, TimeSpan timeout) 206public static void Wait(this Task task, TimeSpan timeout, Action<Exception, TimeSpan, string> exceptionConverter, string operationType)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Ticks.cs (4)
23return checked((long)milliseconds * TimeSpan.TicksPerMillisecond); 28return checked((int)(ticks / TimeSpan.TicksPerMillisecond)); 31public static long FromTimeSpan(TimeSpan duration) 36public static TimeSpan ToTimeSpan(long ticks)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TimeoutHelper.cs (47)
14public static readonly TimeSpan MaxWait = TimeSpan.FromMilliseconds(Int32.MaxValue); 22private TimeSpan _originalTimeout; 24public TimeoutHelper(TimeSpan timeout) 26Contract.Assert(timeout >= TimeSpan.Zero, "timeout must be non-negative"); 31_deadlineSet = (timeout == TimeSpan.MaxValue); 43var timeout = RemainingTime(); 48else if (timeout > TimeSpan.Zero) 63public TimeSpan OriginalTimeout 68public static bool IsTooLarge(TimeSpan timeout) 70return (timeout > TimeoutHelper.MaxWait) && (timeout != TimeSpan.MaxValue); 73public static TimeSpan FromMilliseconds(int milliseconds) 77return TimeSpan.MaxValue; 81return TimeSpan.FromMilliseconds(milliseconds); 85public static int ToMilliseconds(TimeSpan timeout) 87if (timeout == TimeSpan.MaxValue) 94if (ticks / TimeSpan.TicksPerMillisecond > int.MaxValue) 102public static TimeSpan Min(TimeSpan val1, TimeSpan val2) 114public static TimeSpan Add(TimeSpan timeout1, TimeSpan timeout2) 119public static DateTime Add(DateTime time, TimeSpan timeout) 121if (timeout >= TimeSpan.Zero && DateTime.MaxValue - time <= timeout) 125if (timeout <= TimeSpan.Zero && DateTime.MinValue - time >= timeout) 132public static DateTime Subtract(DateTime time, TimeSpan timeout) 134return Add(time, TimeSpan.Zero - timeout); 137public static TimeSpan Divide(TimeSpan timeout, int factor) 139if (timeout == TimeSpan.MaxValue) 141return TimeSpan.MaxValue; 147public TimeSpan RemainingTime() 156return TimeSpan.MaxValue; 160TimeSpan remaining = _deadline - DateTime.UtcNow; 161if (remaining <= TimeSpan.Zero) 163return TimeSpan.Zero; 172public TimeSpan ElapsedTime() 184public static void ThrowIfNegativeArgument(TimeSpan timeout) 189public static void ThrowIfNegativeArgument(TimeSpan timeout, string argumentName) 191if (timeout < TimeSpan.Zero) 197public static void ThrowIfNonPositiveArgument(TimeSpan timeout) 202public static void ThrowIfNonPositiveArgument(TimeSpan timeout, string argumentName) 204if (timeout <= TimeSpan.Zero) 210public static bool WaitOne(WaitHandle waitHandle, TimeSpan timeout) 213if (timeout == TimeSpan.MaxValue) 226internal static TimeoutException CreateEnterTimedOutException(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\IdentityModel\SecurityUtils.cs (2)
51return new DateTime(DateTime.MaxValue.Ticks - TimeSpan.TicksPerDay, DateTimeKind.Utc); 60return new DateTime(DateTime.MinValue.Ticks + TimeSpan.TicksPerDay, DateTimeKind.Utc);
FrameworkFork\System.ServiceModel\System\ServiceModel\ChannelFactory.cs (8)
53protected override TimeSpan DefaultCloseTimeout 68protected override TimeSpan DefaultOpenTimeout 307protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 317internal protected override async Task OnCloseAsync(TimeSpan timeout) 333protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 343protected internal override async Task OnOpenAsync(TimeSpan timeout) 359protected override void OnClose(TimeSpan timeout) 367protected override void OnOpen(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Binding.cs (12)
12private TimeSpan _closeTimeout = ServiceDefaults.CloseTimeout; 15private TimeSpan _openTimeout = ServiceDefaults.OpenTimeout; 16private TimeSpan _receiveTimeout = ServiceDefaults.ReceiveTimeout; 17private TimeSpan _sendTimeout = ServiceDefaults.SendTimeout; 46public TimeSpan CloseTimeout 51if (value < TimeSpan.Zero) 100public TimeSpan OpenTimeout 105if (value < TimeSpan.Zero) 118public TimeSpan ReceiveTimeout 123if (value < TimeSpan.Zero) 146public TimeSpan SendTimeout 151if (value < TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferedConnection.cs (26)
19private TimeSpan _flushTimeout; 20private TimeSpan _pendingTimeout; 23public BufferedConnection(IConnection connection, TimeSpan flushTimeout, int writeBufferSize) 35public override void Close(TimeSpan timeout, bool asyncAndLinger) 46_flushTimer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 47_pendingTimeout = TimeSpan.Zero; 51private void Flush(TimeSpan timeout) 61private void FlushCore(TimeSpan timeout) 77_pendingTimeout = TimeSpan.Zero; 96_flushTimer = new Timer(new TimerCallback(new Action<object>(OnFlushTimer)), null, TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 99_flushTimer.Change(_flushTimeout, TimeSpan.FromMilliseconds(-1)); 102public override void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, BufferManager bufferManager) 111if (immediate || _flushTimeout == TimeSpan.Zero) 122public override void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout) 131if (immediate || _flushTimeout == TimeSpan.Zero) 141private void WriteNow(byte[] buffer, int offset, int size, TimeSpan timeout) 146private void WriteNow(byte[] buffer, int offset, int size, TimeSpan timeout, BufferManager bufferManager) 184private void WriteLater(byte[] buffer, int offset, int size, TimeSpan timeout) 238public override AsyncCompletionResult BeginWrite(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, Action<object> callback, object state) 270private TimeSpan _flushTimeout; 273public BufferedConnectionInitiator(IConnectionInitiator connectionInitiator, TimeSpan flushTimeout, int writeBufferSize) 280protected TimeSpan FlushTimeout 296public IConnection Connect(Uri uri, TimeSpan timeout) 301public async Task<IConnection> ConnectAsync(Uri uri, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChainedAsyncResult.cs (9)
10internal delegate IAsyncResult ChainedBeginHandler(TimeSpan timeout, AsyncCallback asyncCallback, object state); 22protected ChainedAsyncResult(TimeSpan timeout, AsyncCallback callback, object state) 28public ChainedAsyncResult(TimeSpan timeout, AsyncCallback callback, object state, ChainedBeginHandler begin1, ChainedEndHandler end1, ChainedBeginHandler begin2, ChainedEndHandler end2) 132public ChainedCloseAsyncResult(TimeSpan timeout, AsyncCallback callback, object state, ChainedBeginHandler begin1, ChainedEndHandler end1, IList<ICommunicationObject> collection) 140public ChainedCloseAsyncResult(TimeSpan timeout, AsyncCallback callback, object state, ChainedBeginHandler begin1, ChainedEndHandler end1, params ICommunicationObject[] objs) 152private IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 167public ChainedOpenAsyncResult(TimeSpan timeout, AsyncCallback callback, object state, ChainedBeginHandler begin1, ChainedEndHandler end1, IList<ICommunicationObject> collection) 175public ChainedOpenAsyncResult(TimeSpan timeout, AsyncCallback callback, object state, ChainedBeginHandler begin1, ChainedEndHandler end1, params ICommunicationObject[] objs) 187private IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelBase.cs (8)
24TimeSpan IDefaultCommunicationTimeouts.CloseTimeout 29TimeSpan IDefaultCommunicationTimeouts.OpenTimeout 34TimeSpan IDefaultCommunicationTimeouts.ReceiveTimeout 39TimeSpan IDefaultCommunicationTimeouts.SendTimeout 44protected override TimeSpan DefaultCloseTimeout 49protected override TimeSpan DefaultOpenTimeout 54protected TimeSpan DefaultReceiveTimeout 59protected TimeSpan DefaultSendTimeout
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelFactoryBase.cs (13)
12private TimeSpan _closeTimeout = ServiceDefaults.CloseTimeout; 13private TimeSpan _openTimeout = ServiceDefaults.OpenTimeout; 14private TimeSpan _receiveTimeout = ServiceDefaults.ReceiveTimeout; 15private TimeSpan _sendTimeout = ServiceDefaults.SendTimeout; 26protected override TimeSpan DefaultCloseTimeout 31protected override TimeSpan DefaultOpenTimeout 36protected override TimeSpan DefaultReceiveTimeout 41protected override TimeSpan DefaultSendTimeout 61protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 66protected internal override Task OnCloseAsync(TimeSpan timeout) 71protected override void OnClose(TimeSpan timeout) 167protected override void OnClose(TimeSpan timeout) 177protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelManagerBase.cs (8)
13protected abstract TimeSpan DefaultReceiveTimeout { get; } 14protected abstract TimeSpan DefaultSendTimeout { get; } 16internal TimeSpan InternalReceiveTimeout 21internal TimeSpan InternalSendTimeout 26TimeSpan IDefaultCommunicationTimeouts.CloseTimeout 31TimeSpan IDefaultCommunicationTimeouts.OpenTimeout 36TimeSpan IDefaultCommunicationTimeouts.ReceiveTimeout 41TimeSpan IDefaultCommunicationTimeouts.SendTimeout
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (3)
42protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 52protected override void OnOpen(TimeSpan timeout) 57protected internal override async Task OnOpenAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CloseCollectionAsyncResult.cs (1)
18public CloseCollectionAsyncResult(TimeSpan timeout, AsyncCallback otherCallback, object state, IList<ICommunicationObject> collection)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CommunicationObject.cs (28)
67protected abstract TimeSpan DefaultCloseTimeout { get; } 68protected abstract TimeSpan DefaultOpenTimeout { get; } 70internal TimeSpan InternalCloseTimeout 75internal TimeSpan InternalOpenTimeout 121public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 131public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 141public void Close(TimeSpan timeout) 146private async Task CloseAsyncInternal(TimeSpan timeout) 152async Task IAsyncCommunicationObject.CloseAsync(TimeSpan timeout) 154if (timeout < TimeSpan.Zero) 316public void Open(TimeSpan timeout) 321private async Task OpenAsyncInternal(TimeSpan timeout) 327async Task IAsyncCommunicationObject.OpenAsync(TimeSpan timeout) 329if (timeout < TimeSpan.Zero) 348TimeSpan remainingTime = actualTimeout.RemainingTime(); 746protected abstract void OnClose(TimeSpan timeout); 748protected abstract IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state); 752protected abstract void OnOpen(TimeSpan timeout); 754protected abstract IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state); 758internal protected virtual Task OnCloseAsync(TimeSpan timeout) 764internal protected virtual Task OnOpenAsync(TimeSpan timeout) 798public static TimeSpan GetInternalCloseTimeout(this CommunicationObject communicationObject) 803public static void OnClose(CommunicationObject communicationObject, TimeSpan timeout) 808public static IAsyncResult OnBeginClose(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, object state) 818public static void OnOpen(CommunicationObject communicationObject, TimeSpan timeout) 823public static IAsyncResult OnBeginOpen(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, object state) 828public static async Task OnCloseAsyncInternal(CommunicationObject communicationObject, TimeSpan timeout) 834public static async Task OnOpenAsyncInternal(CommunicationObject communicationObject, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Connection.cs (31)
22void Close(TimeSpan timeout, bool asyncAndLinger); 24AsyncCompletionResult BeginWrite(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, 27void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout); 28void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, BufferManager bufferManager); 30int Read(byte[] buffer, int offset, int size, TimeSpan timeout); 31AsyncCompletionResult BeginRead(int offset, int size, TimeSpan timeout, Action<object> callback, object state); 38IConnection Connect(Uri uri, TimeSpan timeout); 39Task<IConnection> ConnectAsync(Uri uri, TimeSpan timeout); 72public virtual void Close(TimeSpan timeout, bool asyncAndLinger) 77public virtual AsyncCompletionResult BeginWrite(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, 88public virtual void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout) 93public virtual void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, BufferManager bufferManager) 98public virtual int Read(byte[] buffer, int offset, int size, TimeSpan timeout) 103public virtual AsyncCompletionResult BeginRead(int offset, int size, TimeSpan timeout, 154public override int Read(byte[] buffer, int offset, int size, TimeSpan timeout) 170public override AsyncCompletionResult BeginRead(int offset, int size, TimeSpan timeout, Action<object> callback, object state) 202private TimeSpan _closeTimeout; 244public TimeSpan CloseTimeout 426protected int Read(byte[] buffer, int offset, int count, TimeSpan timeout) 536public void Close(TimeSpan timeout, bool asyncAndLinger) 549public AsyncCompletionResult BeginWrite(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, 614public void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout) 628public void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, BufferManager bufferManager) 634private void SetReadTimeout(TimeSpan timeout) 644private void SetWriteTimeout(TimeSpan timeout) 654public int Read(byte[] buffer, int offset, int size, TimeSpan timeout) 667public AsyncCompletionResult BeginRead(int offset, int size, TimeSpan timeout, Action<object> callback, object state) 744internal static void CloseNoThrow(IConnection connection, TimeSpan timeout) 814internal static async Task WriteAsync(this IConnection connection, byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout) 828internal static async Task<int> ReadAsync(this IConnection connection, int offset, int size, TimeSpan timeout) 846internal static async Task<int> ReadAsync(this IConnection connection, byte[] buffer, int offset, int size, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionOrientedTransportBindingElement.cs (2)
17private TimeSpan _maxOutputDelay; 126internal TimeSpan MaxOutputDelay
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionOrientedTransportChannelFactory.cs (12)
24private TimeSpan _idleTimeout; 27private TimeSpan _maxOutputDelay; 35string connectionPoolGroupName, TimeSpan idleTimeout, int maxOutboundConnectionsPerEndpoint, bool supportsImpersonationDuringAsyncOpen) 107public TimeSpan IdleTimeout 131public TimeSpan MaxOutputDelay 197internal abstract void ReleaseConnectionPool(ConnectionPool pool, TimeSpan timeout); 244ReleaseConnectionPool(localConnectionPool, TimeSpan.Zero); 254protected override void OnClose(TimeSpan timeout) 282protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 292protected override void OnOpen(TimeSpan timeout) 301protected internal override async Task OnOpenAsync(TimeSpan timeout) 310protected internal override async Task OnCloseAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionPool.cs (19)
47protected abstract void CloseItem(TItem item, TimeSpan timeout); 48protected abstract void CloseItemAsync(TItem item, TimeSpan timeout); 57public bool Close(TimeSpan timeout) 120private EndpointConnectionPool GetEndpointPool(TKey key, TimeSpan timeout) 169private void OnClose(TimeSpan timeout) 193public void AddConnection(TKey key, TItem connection, TimeSpan timeout) 200public TItem TakeConnection(EndpointAddress address, Uri via, TimeSpan timeout, out TKey key) 208public void ReturnConnection(TKey key, TItem connection, bool connectionIsStillGood, TimeSpan timeout) 295protected virtual void CloseItem(TItem item, TimeSpan timeout) 300protected virtual void CloseItemAsync(TItem item, TimeSpan timeout) 325public void Close(TimeSpan timeout) 384public void AddConnection(TItem connection, TimeSpan timeout) 417public TItem TakeConnection(TimeSpan timeout) 471public void ReturnConnection(TItem connection, bool connectionIsStillGood, TimeSpan timeout) 509public void CloseIdleConnection(TItem connection, TimeSpan timeout) 602private TimeSpan _maxOutputDelay; 605protected ConnectionPool(IConnectionOrientedTransportChannelFactorySettings settings, TimeSpan leaseTimeout) 623protected override void CloseItem(IConnection item, TimeSpan timeout) 628protected override void CloseItemAsync(IConnection item, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionPoolHelper.cs (12)
46protected abstract TimeoutException CreateNewConnectionTimeoutException(TimeSpan timeout, TimeoutException innerException); 48private IConnection TakeConnection(TimeSpan timeout) 53public async Task<IConnection> EstablishConnectionAsync(TimeSpan timeout) 90_connectionPool.ReturnConnection(_connectionKey, localRawConnection, false, TimeSpan.Zero); 100TimeSpan connectTimeout = timeoutHelper.RemainingTime(); 135public IConnection EstablishConnection(TimeSpan timeout) 172_connectionPool.ReturnConnection(_connectionKey, localRawConnection, false, TimeSpan.Zero); 182TimeSpan connectTimeout = timeoutHelper.RemainingTime(); 228_connectionPool.ReturnConnection(_connectionKey, rawConnection, false, TimeSpan.Zero); 246ReleaseConnection(true, TimeSpan.Zero); 249public void Close(TimeSpan timeout) 254private void ReleaseConnection(bool abort, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionPoolRegistry.cs (1)
62public void Release(ConnectionPool pool, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (31)
30private TimeSpan _readFinTimeout; 51_sendTimeout = _receiveTimeout = TimeSpan.MaxValue; 65_sendTimer = new Timer(s_onSendTimeout, this, TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 83_receiveTimer = new Timer(s_onReceiveTimeout, this, TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 221_receiveTimer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 229_sendTimer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 311private void ContinueClose(TimeSpan timeout) 341protected override void ShutdownCore(TimeSpan timeout) 351ConvertSendException(socketException, TimeSpan.MaxValue)); 367protected override AsyncCompletionResult BeginWriteCore(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, 403ConvertSendException(socketException, TimeSpan.MaxValue)); 464_asyncWriteException = ConvertSendException(socketException, TimeSpan.MaxValue); 519protected override void WriteCore(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout) 577protected override int ReadCore(byte[] buffer, int offset, int size, TimeSpan timeout, bool closing) 626protected override AsyncCompletionResult BeginReadCore(int offset, int size, TimeSpan timeout, 664throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(ConvertReceiveException(socketException, TimeSpan.MaxValue)); 704_asyncReadException = ConvertReceiveException(socketException, TimeSpan.MaxValue); 793private void SetReadTimeout(TimeSpan timeout, bool synchronous, bool closing) 800if (timeout <= TimeSpan.Zero) 822if (timeout == TimeSpan.MaxValue) 828ReceiveTimer.Change(timeout, TimeSpan.FromMilliseconds(-1)); 833private void SetWriteTimeout(TimeSpan timeout, bool synchronous) 840if (timeout <= TimeSpan.Zero) 859if (timeout == TimeSpan.MaxValue) 865SendTimer.Change(timeout, TimeSpan.FromMilliseconds(-1)); 870private bool UpdateTimeout(TimeSpan oldTimeout, TimeSpan newTimeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\DnsCache.cs (2)
24private static readonly TimeSpan s_cacheTimeout = TimeSpan.FromSeconds(2);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingChannels.cs (15)
52protected override void CloseOutputSessionCore(TimeSpan timeout) 57protected override Task CloseOutputSessionCoreAsync(TimeSpan timeout) 62protected override void CompleteClose(TimeSpan timeout) 76protected override void OnSendCore(Message message, TimeSpan timeout) 88protected override AsyncCompletionResult BeginCloseOutput(TimeSpan timeout, Action<object> callback, object state) 99protected override AsyncCompletionResult StartWritingBufferedMessage(Message message, ArraySegment<byte> messageData, bool allowOutputBatching, TimeSpan timeout, Action<object> callback, object state) 105protected override AsyncCompletionResult StartWritingStreamedMessage(Message message, TimeSpan timeout, Action<object> callback, object state) 219protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 241private async Task<IConnection> SendPreambleAsync(IConnection connection, ArraySegment<byte> preamble, TimeSpan timeout) 315protected internal override async Task OnOpenAsync(TimeSpan timeout) 343protected override void OnOpen(TimeSpan timeout) 371protected override void ReturnConnectionIfNecessary(bool abort, TimeSpan timeout) 425protected override TimeoutException CreateNewConnectionTimeoutException(TimeSpan timeout, TimeoutException innerException) 447Uri via, string contentType, TimeSpan timeout) 560ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (15)
362private SecurityTokenProviderContainer CreateAndOpenTokenProvider(TimeSpan timeout, AuthenticationSchemes authenticationScheme, 480protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 490protected override void OnOpen(TimeSpan timeout) 504internal protected override Task OnOpenAsync(TimeSpan timeout) 510protected internal override Task OnCloseAsync(TimeSpan timeout) 646private void CreateAndOpenTokenProvidersCore(EndpointAddress to, Uri via, ChannelParameterCollection channelParameters, TimeSpan timeout, out SecurityTokenProviderContainer tokenProvider) 652internal void CreateAndOpenTokenProviders(EndpointAddress to, Uri via, ChannelParameterCollection channelParameters, TimeSpan timeout, out SecurityTokenProviderContainer tokenProvider) 729private void CreateAndOpenTokenProviders(TimeSpan timeout) 738private void CloseTokenProviders(TimeSpan timeout) 755protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 765protected override void OnOpen(TimeSpan timeout) 770internal protected override Task OnOpenAsync(TimeSpan timeout) 788protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 798protected override void OnClose(TimeSpan timeout) 803protected internal override async Task OnCloseAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpsChannelFactory.cs (8)
115protected override void OnOpen(TimeSpan timeout) 121internal SecurityTokenProvider CreateAndOpenCertificateTokenProvider(EndpointAddress target, Uri via, ChannelParameterCollection channelParameters, TimeSpan timeout) 254private void CreateAndOpenTokenProvider(TimeSpan timeout) 262private void CloseTokenProvider(TimeSpan timeout) 278protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 285protected override void OnOpen(TimeSpan timeout) 298protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 305protected override void OnClose(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpTransportBindingElement.cs (4)
30private TimeSpan _requestInitializationTimeout; 295[DefaultValue(typeof(TimeSpan), HttpTransportDefaults.RequestInitializationTimeoutString)] 296public TimeSpan RequestInitializationTimeout 304if (value < TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IChannelAcceptor.cs (4)
10TChannel AcceptChannel(TimeSpan timeout); 11IAsyncResult BeginAcceptChannel(TimeSpan timeout, AsyncCallback callback, object state); 14bool WaitForChannel(TimeSpan timeout); 15IAsyncResult BeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IChannelListener.cs (4)
13bool WaitForChannel(TimeSpan timeout); 14IAsyncResult BeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state); 22TChannel AcceptChannel(TimeSpan timeout); 24IAsyncResult BeginAcceptChannel(TimeSpan timeout, AsyncCallback callback, object state);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IdlingCommunicationPool.cs (18)
18private TimeSpan _idleTimeout; 19private TimeSpan _leaseTimeout; 21protected IdlingCommunicationPool(int maxCount, TimeSpan idleTimeout, TimeSpan leaseTimeout) 28public TimeSpan IdleTimeout 33protected TimeSpan LeaseTimeout 38protected override void CloseItemAsync(TItem item, TimeSpan timeout) 46if (_idleTimeout != TimeSpan.MaxValue || _leaseTimeout != TimeSpan.MaxValue) 77protected override void CloseItemAsync(TItem item, TimeSpan timeout) 83protected override void CloseItem(TItem item, TimeSpan timeout) 104private TimeSpan _idleTimeout; 105private TimeSpan _leaseTimeout; 185_idleTimer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 200_idleTimer = new Timer(new TimerCallback(new Action<object>(s_onIdle)), this, _idleTimeout, TimeSpan.FromMilliseconds(-1)); 204_idleTimer.Change(_idleTimeout, TimeSpan.FromMilliseconds(-1)); 285_idleTimer.Change(_idleTimeout, TimeSpan.FromMilliseconds(-1));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IDuplexSession.cs (2)
12void CloseOutputSession(TimeSpan timeout); 14IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IInputChannel.cs (6)
16Message Receive(TimeSpan timeout); 18IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state); 21bool TryReceive(TimeSpan timeout, out Message message); 22IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state); 25bool WaitForMessage(TimeSpan timeout); 26IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IMessageSource.cs (4)
12Task<Message> ReceiveAsync(TimeSpan timeout); 13Message Receive(TimeSpan timeout); 15Task<bool> WaitForMessageAsync(TimeSpan timeout); 16bool WaitForMessage(TimeSpan timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IOutputChannel.cs (2)
16void Send(Message message, TimeSpan timeout); 18IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IReceiveContextSettings.cs (1)
10TimeSpan ValidityDuration { get; }
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IReplyChannel.cs (6)
12RequestContext ReceiveRequest(TimeSpan timeout); 14IAsyncResult BeginReceiveRequest(TimeSpan timeout, AsyncCallback callback, object state); 17bool TryReceiveRequest(TimeSpan timeout, out RequestContext context); 18IAsyncResult BeginTryReceiveRequest(TimeSpan timeout, AsyncCallback callback, object state); 21bool WaitForRequest(TimeSpan timeout); 22IAsyncResult BeginWaitForRequest(TimeSpan timeout, AsyncCallback callback, object state);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IRequestChannel.cs (3)
15Message Request(Message message, TimeSpan timeout); 17IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state); 26Task<Message> RequestAsync(Message message, TimeSpan timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ITransportFactorySettings.cs (4)
10TimeSpan MaxOutputDelay { get; } 11TimeSpan IdleTimeout { get; } 16TimeSpan ChannelInitializationTimeout { get; } 48TimeSpan LeaseTimeout { get; }
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\LayeredChannel.cs (4)
52protected override void OnClose(TimeSpan timeout) 57protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 67protected override void OnOpen(TimeSpan timeout) 72protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\LayeredChannelFactory.cs (16)
40protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 50protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 60protected override void OnClose(TimeSpan timeout) 67protected override void OnOpen(TimeSpan timeout) 110public Message Receive(TimeSpan timeout) 122public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) 134public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 146public bool TryReceive(TimeSpan timeout, out Message message) 153public bool WaitForMessage(TimeSpan timeout) 158public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 211protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 221protected override void OnClose(TimeSpan timeout) 228protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 238protected override void OnOpen(TimeSpan timeout) 250public void Send(Message message, TimeSpan timeout) 260public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\LifetimeManager.cs (19)
69public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 80public void Close(TimeSpan timeout) 92private CommunicationWaitResult CloseCore(TimeSpan timeout, bool aborting) 189CloseCore(TimeSpan.FromSeconds(1), true); 192protected virtual IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 225protected virtual void OnClose(TimeSpan timeout) 267CommunicationWaitResult Wait(TimeSpan timeout, bool aborting); 276private TimeSpan _timeout; 278public CloseCommunicationAsyncResult(TimeSpan timeout, AsyncCallback callback, object state, object mutex) 285if (timeout < TimeSpan.Zero) 288_timer = new Timer(new TimerCallback(new Action<object>(TimeoutCallback)), this, timeout, TimeSpan.FromMilliseconds(-1)); 313_timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 334public CommunicationWaitResult Wait(TimeSpan timeout, bool aborting) 336if (timeout < TimeSpan.Zero) 352_timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 400public CommunicationWaitResult Wait(TimeSpan timeout, bool aborting) 406if (timeout < TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\LocalClientSecuritySettings.cs (18)
14private TimeSpan _replayWindow; 15private TimeSpan _maxClockSkew; 17private TimeSpan _maxCookieCachingTime; 18private TimeSpan _sessionKeyRenewalInterval; 19private TimeSpan _sessionKeyRolloverInterval; 21private TimeSpan _timestampValidityDuration; 72public TimeSpan ReplayWindow 80if (value < TimeSpan.Zero) 96public TimeSpan MaxClockSkew 104if (value < TimeSpan.Zero) 132public TimeSpan TimestampValidityDuration 140if (value < TimeSpan.Zero) 168public TimeSpan MaxCookieCachingTime 176if (value < TimeSpan.Zero) 209public TimeSpan SessionKeyRenewalInterval 217if (value < TimeSpan.Zero) 233public TimeSpan SessionKeyRolloverInterval 241if (value < TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\LocalServiceSecuritySettings.cs (36)
17private TimeSpan _replayWindow; 18private TimeSpan _maxClockSkew; 19private TimeSpan _issuedCookieLifetime; 21private TimeSpan _negotiationTimeout; 24private TimeSpan _inactivityTimeout; 25private TimeSpan _sessionKeyRenewalInterval; 26private TimeSpan _sessionKeyRolloverInterval; 28private TimeSpan _timestampValidityDuration; 78public TimeSpan ReplayWindow 86if (value < TimeSpan.Zero) 100public TimeSpan MaxClockSkew 108if (value < TimeSpan.Zero) 135public TimeSpan IssuedCookieLifetime 143if (value < TimeSpan.Zero) 173public TimeSpan NegotiationTimeout 181if (value < TimeSpan.Zero) 211public TimeSpan InactivityTimeout 219if (value < TimeSpan.Zero) 233public TimeSpan SessionKeyRenewalInterval 241if (value < TimeSpan.Zero) 255public TimeSpan SessionKeyRolloverInterval 263if (value < TimeSpan.Zero) 289public TimeSpan TimestampValidityDuration 297if (value < TimeSpan.Zero) 332internal static readonly TimeSpan defaultServerMaxNegotiationLifetime = TimeSpan.Parse(defaultServerMaxNegotiationLifetimeString, CultureInfo.InvariantCulture); 333internal static readonly TimeSpan defaultServerIssuedTokenLifetime = TimeSpan.Parse(defaultServerIssuedTokenLifetimeString, CultureInfo.InvariantCulture); 334internal static readonly TimeSpan defaultServerIssuedTransitionTokenLifetime = TimeSpan.Parse(defaultServerIssuedTransitionTokenLifetimeString, CultureInfo.InvariantCulture); 343internal static readonly TimeSpan defaultKeyRenewalInterval = TimeSpan.Parse(defaultKeyRenewalIntervalString, CultureInfo.InvariantCulture); 344internal static readonly TimeSpan defaultKeyRolloverInterval = TimeSpan.Parse(defaultKeyRolloverIntervalString, CultureInfo.InvariantCulture); 347internal static readonly TimeSpan defaultInactivityTimeout = TimeSpan.Parse(defaultInactivityTimeoutString, CultureInfo.InvariantCulture);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\NamedPipeConnectionPoolSettings.cs (3)
12TimeSpan _idleTimeout; 41public TimeSpan IdleTimeout 46if (value < TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\OpenCollectionAsyncResult.cs (1)
19public OpenCollectionAsyncResult(TimeSpan timeout, AsyncCallback otherCallback, object state, IList<ICommunicationObject> collection)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\OutputChannel.cs (6)
29public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 34if (timeout < TimeSpan.Zero) 65protected abstract void OnSend(Message message, TimeSpan timeout); 67protected abstract Task OnSendAsync(Message message, TimeSpan timeout); 74public void Send(Message message, TimeSpan timeout) 79if (timeout < TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ReliableSessionBindingElement.cs (9)
17private TimeSpan _acknowledgementInterval = ReliableSessionDefaults.AcknowledgementInterval; 19private TimeSpan _inactivityTimeout = ReliableSessionDefaults.InactivityTimeout; 50[DefaultValue(typeof(TimeSpan), ReliableSessionDefaults.AcknowledgementIntervalString)] 51public TimeSpan AcknowledgementInterval 59if (value <= TimeSpan.Zero) 86[DefaultValue(typeof(TimeSpan), ReliableSessionDefaults.InactivityTimeoutString)] 87public TimeSpan InactivityTimeout 95if (value <= TimeSpan.Zero) 451private static void WriteMillisecondsAttribute(XmlElement childElement, TimeSpan timeSpan)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ReliableSessionBindingElementImporter.cs (6)
243private static TimeSpan ReadMillisecondsAttribute(XmlNode wsrmNode, bool convertToTimeSpan) 270TimeSpan interval; 274interval = TimeSpan.FromMilliseconds(Convert.ToDouble(milliseconds)); 285return default(TimeSpan); 289private static void SetInactivityTimeout(ReliableSessionBindingElement settings, TimeSpan inactivityTimeout, string localName) 301private static void SetAcknowledgementInterval(ReliableSessionBindingElement settings, TimeSpan acknowledgementInterval, string localName)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\RequestChannel.cs (11)
76protected IAsyncResult BeginWaitForPendingRequests(TimeSpan timeout, AsyncCallback callback, object state) 107protected void WaitForPendingRequests(TimeSpan timeout) 112internal protected async Task WaitForPendingRequestsAsync(TimeSpan timeout) 223public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 240public Message Request(Message message, TimeSpan timeout) 250private async Task<Message> RequestAsyncInternal(Message message, TimeSpan timeout) 256public async Task<Message> RequestAsync(Message message, TimeSpan timeout) 263if (timeout < TimeSpan.Zero) 277TimeSpan savedTimeout = timeoutHelper.RemainingTime(); 326void SendRequest(Message message, TimeSpan timeout); 327Message WaitForReply(TimeSpan timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\RequestContext.cs (3)
16public abstract void Close(TimeSpan timeout); 19public abstract void Reply(Message message, TimeSpan timeout); 21public abstract IAsyncResult BeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\RequestContextBase.cs (13)
15private TimeSpan _defaultSendTimeout; 16private TimeSpan _defaultCloseTimeout; 25protected RequestContextBase(Message requestMessage, TimeSpan defaultCloseTimeout, TimeSpan defaultSendTimeout) 88public TimeSpan DefaultCloseTimeout 93public TimeSpan DefaultSendTimeout 125public override void Close(TimeSpan timeout) 127if (timeout < TimeSpan.Zero) 185protected abstract void OnClose(TimeSpan timeout); 186protected abstract void OnReply(Message message, TimeSpan timeout); 187protected abstract IAsyncResult OnBeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state); 229public override IAsyncResult BeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state) 252public override void Reply(Message message, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SecurityAttributeGenerationHelper.cs (3)
39if (value is TimeSpan) 41typeof(TimeSpan), 42new CodePrimitiveExpression(((TimeSpan)(object)value).Ticks));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannel.cs (55)
47private TimeSpan _operationTimeout; 175protected override TimeSpan DefaultCloseTimeout 180protected override TimeSpan DefaultOpenTimeout 211internal TimeSpan CloseTimeout 302internal TimeSpan OpenTimeout 317public TimeSpan OperationTimeout 322if (value < TimeSpan.Zero) 465manager.CallOnce(TimeSpan.MaxValue, null); 475return manager.BeginCallOnce(TimeSpan.MaxValue, null, callback, state); 497private void EnsureOpened(TimeSpan timeout) 509private IAsyncResult BeginEnsureOpened(TimeSpan timeout, AsyncCallback callback, object state) 683internal IAsyncResult BeginCall(string action, bool oneway, ProxyOperationRuntime operation, object[] ins, TimeSpan timeout, AsyncCallback callback, object asyncState) 725internal object Call(string action, bool oneway, ProxyOperationRuntime operation, object[] ins, object[] outs, TimeSpan timeout) 877private TimeoutException GetOpenTimeoutException(TimeSpan timeout) 1191public void Send(Message message, TimeSpan timeout) 1202public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 1218public Message Request(Message message, TimeSpan timeout) 1229public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 1261protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 1271protected override void OnClose(TimeSpan timeout) 1276protected internal override async Task OnCloseAsync(TimeSpan timeout) 1319protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 1329protected override void OnOpen(TimeSpan timeout) 1334protected internal override async Task OnOpenAsync(TimeSpan timeout) 1415IAsyncResult IDuplexContextChannel.BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state) 1425void IDuplexContextChannel.CloseOutputSession(TimeSpan timeout) 1659string action, object[] inputParameters, bool isOneWay, TimeSpan timeout, 1732TimeSpan timeout = Rpc.TimeoutHelper.RemainingTime(); 1798TimeSpan timeout = Rpc.TimeoutHelper.RemainingTime(); 1910void Call(ServiceChannel channel, TimeSpan timeout); 1911IAsyncResult BeginCall(ServiceChannel channel, TimeSpan timeout, AsyncCallback callback, object state); 1932private void ValidateTimeoutIsMaxValue(TimeSpan timeout) 1934if (timeout != TimeSpan.MaxValue) 1940void ICallOnce.Call(ServiceChannel channel, TimeSpan timeout) 1946IAsyncResult ICallOnce.BeginCall(ServiceChannel channel, TimeSpan timeout, AsyncCallback callback, object state) 1974void ICallOnce.Call(ServiceChannel channel, TimeSpan timeout) 1979IAsyncResult ICallOnce.BeginCall(ServiceChannel channel, TimeSpan timeout, AsyncCallback callback, object state) 2011internal void CallOnce(TimeSpan timeout, CallOnceManager cascade) 2060internal IAsyncResult BeginCallOnce(TimeSpan timeout, CallOnceManager cascade, 2226internal bool Wait(TimeSpan timeout) 2266private TimeSpan _timeout; 2269internal AsyncWaiter(CallOnceManager manager, TimeSpan timeout, 2276if (timeout != TimeSpan.MaxValue) 2278_timer = new Timer(new TimerCallback(s_timerCallback), this, timeout, TimeSpan.FromMilliseconds(-1)); 2289if ((_timer == null) || _timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1))) 2302if ((_timer == null) || _timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1))) 2342private SessionIdleManager(IChannelBinder binder, TimeSpan idle) 2345_timer = new Timer(new TimerCallback(GetTimerCallback()), this, idle, TimeSpan.FromMilliseconds(-1)); 2350internal static SessionIdleManager CreateIfNeeded(IChannelBinder binder, TimeSpan idle) 2352if (binder.HasSession && (idle != TimeSpan.MaxValue)) 2378_timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 2447_timer.Change(Ticks.ToTimeSpan(abortTime - ticksNow), TimeSpan.FromMilliseconds(-1));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelFactory.cs (20)
57protected override TimeSpan DefaultCloseTimeout 62protected override TimeSpan DefaultReceiveTimeout 67protected override TimeSpan DefaultOpenTimeout 72protected override TimeSpan DefaultSendTimeout 251protected override void OnClose(TimeSpan timeout) 269protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 419protected override void OnOpen(TimeSpan timeout) 424protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 434protected override void OnClose(TimeSpan timeout) 441protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 452protected internal override Task OnCloseAsync(TimeSpan timeout) 458protected internal override Task OnOpenAsync(TimeSpan timeout) 624private TimeSpan _closeTimeout; 625private TimeSpan _openTimeout; 626private TimeSpan _receiveTimeout; 627private TimeSpan _sendTimeout; 637public TimeSpan CloseTimeout 642public TimeSpan OpenTimeout 647public TimeSpan ReceiveTimeout 652public TimeSpan SendTimeout
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelProxy.cs (11)
573void ICommunicationObject.Close(TimeSpan timeout) 583IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 598void ICommunicationObject.Open(TimeSpan timeout) 608IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 688TimeSpan IContextChannel.OperationTimeout 735IAsyncResult IOutputChannel.BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 750void IOutputChannel.Send(Message message, TimeSpan timeout) 760Message IRequestChannel.Request(Message message, TimeSpan timeout) 770IAsyncResult IRequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 780public IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state) 790public void CloseOutputSession(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SessionConnectionReader.cs (7)
44private Message DecodeMessage(TimeSpan timeout) 58protected abstract Message DecodeMessage(byte[] buffer, ref int offset, ref int size, ref bool isAtEof, TimeSpan timeout); 102public async Task<Message> ReceiveAsync(TimeSpan timeout) 160public Message Receive(TimeSpan timeout) 242public async Task<bool> WaitForMessageAsync(TimeSpan timeout) 261public bool WaitForMessage(TimeSpan timeout) 342protected override Message DecodeMessage(byte[] buffer, ref int offset, ref int size, ref bool isAtEOF, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SocketConnection.cs (30)
17protected TimeSpan _sendTimeout; 18protected TimeSpan _receiveTimeout; 53_sendTimeout = _receiveTimeout = TimeSpan.MaxValue; 112public void Close(TimeSpan timeout, bool asyncAndLinger) 133private void Shutdown(TimeSpan timeout) 148protected abstract void ShutdownCore(TimeSpan timeout); 170protected Exception ConvertSendException(SocketException socketException, TimeSpan remainingTime) 176protected Exception ConvertReceiveException(SocketException socketException, TimeSpan remainingTime) 182internal static Exception ConvertTransferException(SocketException socketException, TimeSpan timeout, Exception originalException) 185TransferOperation.Undefined, false, null, TransferOperation.Undefined, null, TimeSpan.MaxValue); 204private static Exception ConvertTransferException(SocketException socketException, TimeSpan timeout, Exception originalException, 206SocketConnection socketConnection, TimeSpan remainingTime) 220remainingTime <= TimeSpan.Zero) 274public AsyncCompletionResult BeginWrite(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, 287protected abstract AsyncCompletionResult BeginWriteCore(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, 308public void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout) 313protected abstract void WriteCore(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout); 315public void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, BufferManager bufferManager) 327public int Read(byte[] buffer, int offset, int size, TimeSpan timeout) 340protected abstract int ReadCore(byte[] buffer, int offset, int size, TimeSpan timeout, bool closing); 342public virtual AsyncCompletionResult BeginRead(int offset, int size, TimeSpan timeout, 358protected abstract AsyncCompletionResult BeginReadCore(int offset, int size, TimeSpan timeout, 435public static Exception ConvertConnectException(SocketException socketException, Uri remoteUri, TimeSpan timeSpent, Exception innerException) 450if (timeSpent == TimeSpan.MaxValue) 471if (timeSpent == TimeSpan.MaxValue) 512private static TimeoutException CreateTimeoutException(Uri uri, TimeSpan timeout, IPAddress[] addresses, int invalidAddressCount, 535public IConnection Connect(Uri uri, TimeSpan timeout) 551if (timeoutHelper.RemainingTime() == TimeSpan.Zero) 587public async Task<IConnection> ConnectAsync(Uri uri, TimeSpan timeout) 603if (timeoutHelper.RemainingTime() == TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SslStreamSecurityUpgradeProvider.cs (8)
238protected override void OnClose(TimeSpan timeout) 247protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 278protected override void OnOpen(TimeSpan timeout) 296protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 518internal override void Open(TimeSpan timeout) 532internal override async Task OpenAsync(TimeSpan timeout) 546internal override void Close(TimeSpan timeout) 556internal override async Task CloseAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\StreamSecurityUpgradeInitiatorBase.cs (6)
71this.Open(TimeSpan.Zero); 88Open(TimeSpan.Zero); 98internal override void Open(TimeSpan timeout) 103internal override Task OpenAsync(TimeSpan timeout) 109internal override void Close(TimeSpan timeout) 114internal override Task CloseAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\StreamUpgradeInitiator.cs (4)
23internal abstract void Open(TimeSpan timeout); 25internal abstract Task OpenAsync(TimeSpan timeout); 27internal abstract void Close(TimeSpan timeout); 29internal abstract Task CloseAsync(TimeSpan timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\StreamUpgradeProvider.cs (4)
9private TimeSpan _closeTimeout; 10private TimeSpan _openTimeout; 31protected override TimeSpan DefaultCloseTimeout 36protected override TimeSpan DefaultOpenTimeout
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SynchronizedMessageSource.cs (4)
23public async Task<bool> WaitForMessageAsync(TimeSpan timeout) 47public bool WaitForMessage(TimeSpan timeout) 72public async Task<Message> ReceiveAsync(TimeSpan timeout) 97public Message Receive(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TcpChannelFactory.cs (3)
10private TimeSpan _leaseTimeout; 22public TimeSpan LeaseTimeout 54internal override void ReleaseConnectionPool(ConnectionPool pool, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TcpConnectionPoolSettings.cs (6)
12private TimeSpan _idleTimeout; 13private TimeSpan _leaseTimeout; 44public TimeSpan IdleTimeout 49if (value < TimeSpan.Zero) 65public TimeSpan LeaseTimeout 70if (value < TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TimeoutStream.cs (1)
20public TimeoutStream(Stream stream, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportChannelFactory.cs (2)
134protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 140protected override void OnClose(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportDefaults.cs (10)
193public static TimeSpan IdleTimeout { get { return TimeSpanHelper.FromMinutes(2, IdleTimeoutString); } } 195public static TimeSpan ChannelInitializationTimeout { get { return TimeSpanHelper.FromSeconds(30, ChannelInitializationTimeoutString); } } 200public static TimeSpan MaxOutputDelay { get { return TimeSpanHelper.FromMilliseconds(200, MaxOutputDelayString); } } 226public static TimeSpan ConnectionLeaseTimeout { get { return TimeSpanHelper.FromMinutes(5, TcpTransportDefaults.ConnectionLeaseTimeoutString); } } 271public static TimeSpan RequestInitializationTimeout { get { return TimeSpanHelper.FromMilliseconds(0, RequestInitializationTimeoutString); } } 308public static TimeSpan IdleTimeout { get { return TimeSpanHelper.FromMinutes(2, IdleTimeoutString); } } 311public static TimeSpan LeaseTimeout { get { return TimeSpanHelper.FromMinutes(10, LeaseTimeoutString); } } 320internal static TimeSpan AcknowledgementInterval { get { return TimeSpanHelper.FromMilliseconds(200, AcknowledgementIntervalString); } } 324internal static TimeSpan InactivityTimeout { get { return TimeSpanHelper.FromMinutes(10, InactivityTimeoutString); } } 354public static readonly TimeSpan DefaultKeepAliveInterval = TimeSpanHelper.FromSeconds(0, DefaultKeepAliveIntervalString);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportDuplexSessionChannel.cs (29)
89public Message Receive(TimeSpan timeout) 120public async Task<Message> ReceiveAsync(TimeSpan timeout) 156public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) 166public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 191public bool TryReceive(TimeSpan timeout, out Message message) 209public async Task<bool> WaitForMessageAsync(TimeSpan timeout) 232public bool WaitForMessage(TimeSpan timeout) 255public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 270protected abstract Task CloseOutputSessionCoreAsync(TimeSpan timeout); 272protected abstract void CloseOutputSessionCore(TimeSpan timeout); 274protected async Task CloseOutputSessionAsync(TimeSpan timeout) 329protected void CloseOutputSession(TimeSpan timeout) 385protected abstract void ReturnConnectionIfNecessary(bool abort, TimeSpan timeout); 389this.ReturnConnectionIfNecessary(true, TimeSpan.Zero); 395this.ReturnConnectionIfNecessary(true, TimeSpan.Zero); 398protected internal override async Task OnCloseAsync(TimeSpan timeout) 413protected override void OnClose(TimeSpan timeout) 428protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 488protected abstract AsyncCompletionResult StartWritingBufferedMessage(Message message, ArraySegment<byte> messageData, bool allowOutputBatching, TimeSpan timeout, Action<object> callback, object state); 490protected abstract AsyncCompletionResult BeginCloseOutput(TimeSpan timeout, Action<object> callback, object state); 498protected abstract void OnSendCore(Message message, TimeSpan timeout); 500protected abstract AsyncCompletionResult StartWritingStreamedMessage(Message message, TimeSpan timeout, Action<object> callback, object state); 502protected override async Task OnSendAsync(Message message, TimeSpan timeout) 607protected override void OnSend(Message message, TimeSpan timeout) 658protected abstract void CompleteClose(TimeSpan timeout); 669private async Task EnsureInputClosedAsync(TimeSpan timeout) 682private void EnsureInputClosed(TimeSpan timeout) 780public IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state) 795public void CloseOutputSession(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportSecurityHelpers.cs (1)
48SecurityTokenRequirement sspiTokenRequirement, TimeSpan timeout,
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\UdpConstants.cs (10)
28public static readonly TimeSpan ReceiveTimeout = TimeSpan.FromMinutes(1); 29public static readonly TimeSpan SendTimeout = TimeSpan.FromMinutes(1); 48public static readonly TimeSpan DelayLowerBoundTimeSpan = TimeSpan.Parse(DelayLowerBound, CultureInfo.InvariantCulture); 49public static readonly TimeSpan DelayUpperBoundTimeSpan = TimeSpan.Parse(DelayUpperBound, CultureInfo.InvariantCulture); 50public static readonly TimeSpan MaxDelayPerRetransmissionTimeSpan = TimeSpan.Parse(MaxDelayPerRetransmission, CultureInfo.InvariantCulture);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\UdpRetransmissionSettings.cs (24)
16private TimeSpan _delayLowerBound; 17private TimeSpan _delayUpperBound; 18private TimeSpan _maxDelayPerRetransmission; 35public UdpRetransmissionSettings(int maxUnicastRetransmitCount, int maxMulticastRetransmitCount, TimeSpan delayLowerBound, TimeSpan delayUpperBound, TimeSpan maxDelayPerRetransmission) 50if (delayLowerBound < TimeSpan.Zero) 52throw FxTrace.Exception.ArgumentOutOfRange("delayLowerBound", delayLowerBound, string.Format(SRServiceModel.ArgumentOutOfMinRange, TimeSpan.Zero)); 55if (delayUpperBound < TimeSpan.Zero) 57throw FxTrace.Exception.ArgumentOutOfRange("delayUpperBound", delayUpperBound, string.Format(SRServiceModel.ArgumentOutOfMinRange, TimeSpan.Zero)); 60if (maxDelayPerRetransmission < TimeSpan.Zero) 63string.Format(SRServiceModel.ArgumentOutOfMinRange, TimeSpan.Zero)); 120public TimeSpan DelayLowerBound 128if (value < TimeSpan.Zero) 130throw FxTrace.Exception.ArgumentOutOfRange("value", value, string.Format(SRServiceModel.ArgumentOutOfMinRange, TimeSpan.Zero)); 138public TimeSpan DelayUpperBound 146if (value < TimeSpan.Zero) 148throw FxTrace.Exception.ArgumentOutOfRange("value", value, string.Format(SRServiceModel.ArgumentOutOfMinRange, TimeSpan.Zero)); 156public TimeSpan MaxDelayPerRetransmission 164if (value < TimeSpan.Zero) 166throw FxTrace.Exception.ArgumentOutOfRange("value", value, string.Format(SRServiceModel.ArgumentOutOfMinRange, TimeSpan.Zero)); 265private bool TimeSpansEqual(TimeSpan ts1, TimeSpan ts2) 269return diff < TimeSpan.FromMilliseconds(1).Ticks || (max > 0 && diff / (double)max < 1e-3);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketHelper.cs (6)
120internal static void ThrowCorrectException(Exception ex, TimeSpan timeout, string operation) 129TimeSpan.MinValue, // this is a dummy since operation type is null, so the timespan value won't be used 135internal static Exception ConvertAndTraceException(Exception ex, TimeSpan timeout, string operation) 189internal static void ThrowExceptionOnTaskFailure(Task task, TimeSpan timeout, string operation) 202internal static Exception CreateExceptionOnTaskFailure(Task task, TimeSpan timeout, string operation) 215internal static TimeoutException GetTimeoutException(Exception innerException, TimeSpan timeout, string operation)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (22)
93protected override void CompleteClose(TimeSpan timeout) 112protected override void CloseOutputSessionCore(TimeSpan timeout) 126protected override async Task CloseOutputSessionCoreAsync(TimeSpan timeout) 158protected override void OnClose(TimeSpan timeout) 170protected internal override async Task OnCloseAsync(TimeSpan timeout) 182protected override void ReturnConnectionIfNecessary(bool abort, TimeSpan timeout) 186protected override AsyncCompletionResult StartWritingBufferedMessage(Message message, ArraySegment<byte> messageData, bool allowOutputBatching, TimeSpan timeout, Action<object> callback, object state) 226protected override AsyncCompletionResult StartWritingStreamedMessage(Message message, TimeSpan timeout, Action<object> callback, object state) 248protected override AsyncCompletionResult BeginCloseOutput(TimeSpan timeout, Action<object> callback, object state) 266protected override void OnSendCore(Message message, TimeSpan timeout) 396private async void HandleCloseOutputAsyncCompletion(Task task, TimeSpan timeout, Action<object> callback, object state) 412private async void HandleSendAsyncCompletion(Task task, TimeSpan timeout, Action<object> callback, object state) 474private TimeSpan _asyncReceiveTimeout; 516public async Task<Message> ReceiveAsync(TimeSpan timeout) 539public Message Receive(TimeSpan timeout) 614WebSocketHelper.ThrowCorrectException(ex, TimeSpan.MaxValue, WebSocketHelper.ReceiveOperation); 644_pendingException = WebSocketHelper.ConvertAndTraceException(ex, TimeSpan.MaxValue, WebSocketHelper.ReceiveOperation); 655public bool WaitForMessage(TimeSpan timeout) 674public async Task<bool> WaitForMessageAsync(TimeSpan timeout) 890private readonly TimeSpan _closeTimeout; 910TimeSpan closeTimeout) 926TimeSpan closeTimeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportSettings.cs (4)
23private TimeSpan _keepAliveInterval; 56[DefaultValue(typeof(TimeSpan), WebSocketDefaults.DefaultKeepAliveIntervalString)] 57public TimeSpan KeepAliveInterval 66if (value < TimeSpan.Zero && value != Timeout.InfiniteTimeSpan)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WindowsStreamSecurityUpgradeProvider.cs (7)
132protected override void OnClose(TimeSpan timeout) 136protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 146protected override void OnOpen(TimeSpan timeout) 157protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 290internal override async Task OpenAsync(TimeSpan timeout) 311internal override void Open(TimeSpan timeout) 316internal override void Close(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\ClientBase.cs (17)
193void ICommunicationObject.Open(TimeSpan timeout) 200void ICommunicationObject.Close(TimeSpan timeout) 284IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 299IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 311internal IAsyncResult BeginFactoryOpen(TimeSpan timeout, AsyncCallback callback, object state) 321internal IAsyncResult BeginChannelOpen(TimeSpan timeout, AsyncCallback callback, object state) 331internal IAsyncResult BeginFactoryClose(TimeSpan timeout, AsyncCallback callback, object state) 348internal IAsyncResult BeginChannelClose(TimeSpan timeout, AsyncCallback callback, object state) 635TimeSpan IContextChannel.OperationTimeout 706void ICommunicationObject.Close(TimeSpan timeout) 716IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 731void ICommunicationObject.Open(TimeSpan timeout) 741IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 776void IOutputChannel.Send(Message message, TimeSpan timeout) 786IAsyncResult IOutputChannel.BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 811Message IRequestChannel.Request(Message message, TimeSpan timeout) 821IAsyncResult IRequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExchangeClient.cs (4)
32private TimeSpan _resolveTimeout = TimeSpan.FromMinutes(1); 116public TimeSpan OperationTimeout 121if (value < TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Diagnostics\TraceUtility.cs (1)
75TimeSpan elapsedTime = new TimeSpan(DateTime.UtcNow.Ticks - startTicks);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\BufferedReceiveBinder.cs (10)
62public void CloseAfterFault(TimeSpan timeout) 73public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 95public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 130public void Send(Message message, TimeSpan timeout) 135public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 145public Message Request(Message message, TimeSpan timeout) 150public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 160public bool WaitForMessage(TimeSpan timeout) 165public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 193if (binder._channelBinder.TryReceive(TimeSpan.MaxValue, out requestContext))
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ChannelDispatcher.cs (11)
36private TimeSpan _transactionTimeout; 55_transactionTimeout = TimeSpan.Zero; 63protected override TimeSpan DefaultCloseTimeout 78protected override TimeSpan DefaultOpenTimeout 264internal override void CloseInput(TimeSpan timeout) 403protected override void OnClose(TimeSpan timeout) 421protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 456protected override void OnOpen(TimeSpan timeout) 473protected internal override Task OnCloseAsync(TimeSpan timeout) 479protected internal override Task OnOpenAsync(TimeSpan timeout) 532protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ChannelDispatcherBase.cs (1)
17internal virtual void CloseInput(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ChannelHandler.cs (6)
20public static readonly TimeSpan CloseAfterFaultTimeout = TimeSpan.FromSeconds(10); 108Fx.Assert((_idleManager != null) == (_binder.HasSession && _listener.ChannelDispatcher.DefaultCommunicationTimeouts.ReceiveTimeout != TimeSpan.MaxValue), "idle manager is present only when there is a session with a finite receive timeout"); 242return _receiver.BeginTryReceive(TimeSpan.MaxValue, ChannelHandler.s_onAsyncReceiveComplete, this); 809private bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 1119while (!TryReceive(TimeSpan.MaxValue, out request))
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (43)
20private TimeSpan _defaultCloseTimeout; 21private TimeSpan _defaultSendTimeout; 63public TimeSpan DefaultCloseTimeout 89public TimeSpan DefaultSendTimeout 198public void CloseAfterFault(TimeSpan timeout) 245private TimeoutException GetReceiveTimeoutException(TimeSpan timeout) 304public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 348public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 358public void Send(Message message, TimeSpan timeout) 363public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 414public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 444public Message Request(Message message, TimeSpan timeout) 482TimeSpan remaining = timeoutHelper.RemainingTime(); 613public bool WaitForMessage(TimeSpan timeout) 618public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 644protected override void OnClose(TimeSpan timeout) 648protected override void OnReply(Message message, TimeSpan timeout) 656protected override IAsyncResult OnBeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state) 671public ReplyAsyncResult(DuplexRequestContext context, Message message, TimeSpan timeout, AsyncCallback callback, object state) 762internal Message WaitForReply(TimeSpan timeout) 811private TimeSpan _timeout; 816internal AsyncDuplexRequest(Message message, DuplexChannelBinder parent, TimeSpan timeout, AsyncCallback callback, object state) 822if (timeout != TimeSpan.MaxValue) 824_timer = new Timer(new TimerCallback(AsyncDuplexRequest.s_timerCallback), this, timeout, TimeSpan.FromMilliseconds(-1)); 885_timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 1113private TimeSpan DefaultCloseTimeout 1130private TimeSpan DefaultReceiveTimeout 1159result = _innerChannel.BeginReceive(TimeSpan.MaxValue, s_receiveAsyncCallback, this); 1328public Message Receive(TimeSpan timeout) 1338public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) 1348public bool TryReceive(TimeSpan timeout, out Message message) 1353public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 1363public bool WaitForMessage(TimeSpan timeout) 1368public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 1394public void Close(TimeSpan timeout) 1417public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 1460public void Open(TimeSpan timeout) 1471public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 1487public void Send(Message message, TimeSpan timeout) 1497public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 1549public void WaitForBackgroundClose(TimeSpan timeout) 1556public IAsyncResult BeginWaitForBackgroundClose(TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ErrorHandlingReceiver.cs (2)
56internal bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 96internal IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\IChannelBinder.cs (9)
18void CloseAfterFault(TimeSpan timeout); 20bool TryReceive(TimeSpan timeout, out RequestContext requestContext); 21IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state); 24void Send(Message message, TimeSpan timeout); 25IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state); 28Message Request(Message message, TimeSpan timeout); 29IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state); 32bool WaitForMessage(TimeSpan timeout); 33IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\IListenerBinder.cs (2)
14IChannelBinder Accept(TimeSpan timeout); 15IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ImmutableCommunicationTimeouts.cs (8)
9private TimeSpan _close; 10private TimeSpan _open; 11private TimeSpan _receive; 12private TimeSpan _send; 37TimeSpan IDefaultCommunicationTimeouts.CloseTimeout 42TimeSpan IDefaultCommunicationTimeouts.OpenTimeout 47TimeSpan IDefaultCommunicationTimeouts.ReceiveTimeout 52TimeSpan IDefaultCommunicationTimeouts.SendTimeout
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\InputChannelBinder.cs (14)
62public void CloseAfterFault(TimeSpan timeout) 67public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 92public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 102public void Send(Message message, TimeSpan timeout) 107public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 122public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 132public Message Request(Message message, TimeSpan timeout) 137public bool WaitForMessage(TimeSpan timeout) 142public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 169: base(request, TimeSpan.Zero, TimeSpan.Zero) 178protected override void OnClose(TimeSpan timeout) 182protected override void OnReply(Message message, TimeSpan timeout) 186protected override IAsyncResult OnBeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ListenerBinder.cs (12)
67public IChannelBinder Accept(TimeSpan timeout) 76public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state) 114public IChannelBinder Accept(TimeSpan timeout) 123public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state) 159public IChannelBinder Accept(TimeSpan timeout) 168public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state) 204public IChannelBinder Accept(TimeSpan timeout) 213public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state) 249public IChannelBinder Accept(TimeSpan timeout) 258public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state) 294public IChannelBinder Accept(TimeSpan timeout) 303public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ListenerHandler.cs (11)
59protected override TimeSpan DefaultCloseTimeout 64protected override TimeSpan DefaultOpenTimeout 80protected internal override Task OnCloseAsync(TimeSpan timeout) 86protected internal override Task OnOpenAsync(TimeSpan timeout) 92protected override void OnOpen(TimeSpan timeout) 96protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 161private void CloseChannel(IChannel channel, TimeSpan timeout) 220public void CloseInput(TimeSpan timeout) 269private void CloseChannels(TimeSpan timeout) 381protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 398protected override void OnClose(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\OutputChannelBinder.cs (9)
60public void CloseAfterFault(TimeSpan timeout) 65public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 80public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 90public void Send(Message message, TimeSpan timeout) 95public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 105public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 110public Message Request(Message message, TimeSpan timeout) 115public bool WaitForMessage(TimeSpan timeout) 120public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ProxyRpc.cs (1)
29internal ProxyRpc(ServiceChannel channel, ProxyOperationRuntime operation, string action, object[] inputs, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ReplyChannelBinder.cs (9)
62public void CloseAfterFault(TimeSpan timeout) 67public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 82public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 92public void Send(Message message, TimeSpan timeout) 97public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 107public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 112public Message Request(Message message, TimeSpan timeout) 117public bool WaitForMessage(TimeSpan timeout) 122public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\RequestChannelBinder.cs (9)
54public void CloseAfterFault(TimeSpan timeout) 59public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 74public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 84public void Send(Message message, TimeSpan timeout) 89public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 99public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 104public Message Request(Message message, TimeSpan timeout) 118public bool WaitForMessage(TimeSpan timeout) 123public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\FederatedMessageSecurityOverHttp.cs (2)
23internal static readonly TimeSpan defaultServerIssuedTransitionTokenLifetime = TimeSpan.Parse(defaultServerIssuedTransitionTokenLifetimeString, System.Globalization.CultureInfo.InvariantCulture);
FrameworkFork\System.ServiceModel\System\ServiceModel\ICommunicationObject.cs (6)
22void Close(TimeSpan timeout); 24IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state); 28void Open(TimeSpan timeout); 30IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state); 36Task CloseAsync(TimeSpan timeout); 37Task OpenAsync(TimeSpan timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\IContextChannel.cs (1)
20TimeSpan OperationTimeout { get; set; }
FrameworkFork\System.ServiceModel\System\ServiceModel\IDefaultCommunicationTimeouts.cs (4)
9TimeSpan CloseTimeout { get; } 10TimeSpan OpenTimeout { get; } 11TimeSpan ReceiveTimeout { get; } 12TimeSpan SendTimeout { get; }
FrameworkFork\System.ServiceModel\System\ServiceModel\IDuplexContextChannel.cs (2)
12IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state); 14void CloseOutputSession(TimeSpan timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\InstanceContext.cs (9)
80protected override TimeSpan DefaultCloseTimeout 88protected override TimeSpan DefaultOpenTimeout 228protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 238protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 248protected override void OnClose(TimeSpan timeout) 253protected override void OnOpen(TimeSpan timeout) 268protected internal override Task OnCloseAsync(TimeSpan timeout) 274protected internal override Task OnOpenAsync(TimeSpan timeout) 301public CloseAsyncResult(TimeSpan timeout, AsyncCallback callback, object state, InstanceContext instanceContext)
FrameworkFork\System.ServiceModel\System\ServiceModel\MessageSecurityOverHttp.cs (1)
209oneShotSecurity.LocalServiceSettings.IssuedCookieLifetime = TimeSpan.Parse("00:15:00", System.Globalization.CultureInfo.InvariantCulture); ;
FrameworkFork\System.ServiceModel\System\ServiceModel\MessageSecurityOverTcp.cs (2)
18internal static readonly TimeSpan defaultServerIssuedTransitionTokenLifetime = TimeSpan.Parse(defaultServerIssuedTransitionTokenLifetimeString, CultureInfo.InvariantCulture);
FrameworkFork\System.ServiceModel\System\ServiceModel\ReliableSession.cs (2)
37public TimeSpan InactivityTimeout 42if (value <= TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\InMemoryNonceCache.cs (4)
22public InMemoryNonceCache(TimeSpan cachingTime, int maxCachedNonces) 57private TimeSpan _cachingTimeSpan; 59public NonceCacheImpl(TimeSpan cachingTimeSpan, int maxCachedNonces) 60: base(s_lowWaterMark, maxCachedNonces, s_comparer, PurgingMode.AccessBasedPurge, TimeSpan.FromTicks(cachingTimeSpan.Ticks >> 2), false)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\ISecurityCommunicationObject.cs (6)
9TimeSpan DefaultOpenTimeout { get; } 10TimeSpan DefaultCloseTimeout { get; } 12IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state); 13IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state); 14void OnClose(TimeSpan timeout); 20void OnOpen(TimeSpan timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\NonceCache.cs (3)
11private TimeSpan _cachingTime; 17public TimeSpan CachingTimeSpan 25if (value < TimeSpan.Zero)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityChannel.cs (4)
57_securityProtocol.Close(true, TimeSpan.Zero); 63protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 74private IAsyncResult BeginCloseSecurityProtocol(TimeSpan timeout, AsyncCallback callback, object state) 84protected override void OnClose(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityProtocol.cs (7)
34public TimeSpan DefaultCloseTimeout 39public TimeSpan DefaultOpenTimeout 45public IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) { throw ExceptionHelper.PlatformNotSupported(); } 46public IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) { throw ExceptionHelper.PlatformNotSupported(); } 47public void OnClose(TimeSpan timeout) { throw ExceptionHelper.PlatformNotSupported(); } 53public void OnOpen(TimeSpan timeout) { throw ExceptionHelper.PlatformNotSupported(); } 57public void Close(bool aborted, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityProtocolFactory.cs (32)
69internal static readonly TimeSpan defaultMaxClockSkew = TimeSpan.Parse(defaultMaxClockSkewString, CultureInfo.InvariantCulture); 70internal static readonly TimeSpan defaultReplayWindow = TimeSpan.Parse(defaultReplayWindowString, CultureInfo.InvariantCulture); 73internal static readonly TimeSpan defaultTimestampValidityDuration = TimeSpan.Parse(defaultTimestampValidityDurationString, CultureInfo.InvariantCulture); 93private TimeSpan _maxClockSkew = defaultMaxClockSkew; 96private TimeSpan _replayWindow = defaultReplayWindow; 102private TimeSpan _timestampValidityDuration = defaultTimestampValidityDuration; 408public TimeSpan MaxClockSkew 417if (value < TimeSpan.Zero) 455public TimeSpan ReplayWindow 464if (value <= TimeSpan.Zero) 566public TimeSpan TimestampValidityDuration 575if (value <= TimeSpan.Zero) 599public TimeSpan DefaultOpenTimeout 604public TimeSpan DefaultCloseTimeout 609public IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 614public IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 668public virtual void OnClose(TimeSpan timeout) 693public SecurityProtocol CreateSecurityProtocol(EndpointAddress target, Uri via, object listenerSecurityState, bool isReturnLegSecurityRequired, TimeSpan timeout) 733protected abstract SecurityProtocol OnCreateSecurityProtocol(EndpointAddress target, Uri via, object listenerSecurityState, TimeSpan timeout); 790private void MergeSupportingTokenAuthenticators(TimeSpan timeout) 953public virtual void OnOpen(TimeSpan timeout) 1021if (this.MaxClockSkew == TimeSpan.MaxValue || this.ReplayWindow == TimeSpan.MaxValue) 1037public void Open(bool actAsInitiator, TimeSpan timeout) 1043public IAsyncResult BeginOpen(bool actAsInitiator, TimeSpan timeout, AsyncCallback callback, object state) 1054public void Close(bool aborted, TimeSpan timeout) 1066public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 1076internal void Open(string propertyName, bool requiredForForwardDirection, SecurityTokenAuthenticator authenticator, TimeSpan timeout) 1088internal void Open(string propertyName, bool requiredForForwardDirection, SecurityTokenProvider provider, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityTimestamp.cs (5)
16internal static readonly TimeSpan defaultTimeToLive = SecurityProtocolFactory.defaultTimestampValidityDuration; 160internal void ValidateRangeAndFreshness(TimeSpan timeToLive, TimeSpan allowedClockSkew) 171internal void ValidateFreshness(TimeSpan timeToLive, TimeSpan allowedClockSkew)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityUtils.cs (14)
258return new DateTime(DateTime.MaxValue.Ticks - TimeSpan.TicksPerDay, DateTimeKind.Utc); 267return new DateTime(DateTime.MinValue.Ticks + TimeSpan.TicksPerDay, DateTimeKind.Utc); 665internal static void OpenTokenProviderIfRequired(SecurityTokenProvider tokenProvider, TimeSpan timeout) 670internal static void CloseTokenProviderIfRequired(SecurityTokenProvider tokenProvider, TimeSpan timeout) 677CloseCommunicationObject(tokenProvider, true, TimeSpan.Zero); 680internal static void OpenTokenAuthenticatorIfRequired(SecurityTokenAuthenticator tokenAuthenticator, TimeSpan timeout) 685internal static void CloseTokenAuthenticatorIfRequired(SecurityTokenAuthenticator tokenAuthenticator, TimeSpan timeout) 690internal static void CloseTokenAuthenticatorIfRequired(SecurityTokenAuthenticator tokenAuthenticator, bool aborted, TimeSpan timeout) 697CloseCommunicationObject(tokenAuthenticator, true, TimeSpan.Zero); 700private static void OpenCommunicationObject(ICommunicationObject obj, TimeSpan timeout) 706private static void CloseCommunicationObject(Object obj, bool aborted, TimeSpan timeout) 1060private Action<TimeSpan> _operationWithTimeout; 1062public OperationWithTimeoutAsyncResult(Action<TimeSpan> operationWithTimeout, TimeSpan timeout, AsyncCallback callback, object state)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\TimeBoundedCache.cs (6)
22private TimeSpan _purgeInterval; 27protected TimeBoundedCache(int lowWaterMark, int maxCacheItems, IEqualityComparer keyComparer, PurgingMode purgingMode, TimeSpan purgeInterval, bool doRemoveNotification) 92_purgingTimer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 106_purgingTimer = new Timer(new TimerCallback(PurgeCallback), this, _purgeInterval, TimeSpan.FromMilliseconds(-1)); 436self._purgingTimer.Change(self._purgeInterval, TimeSpan.FromMilliseconds(-1));
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\Tokens\SecurityTokenProviderContainer.cs (2)
29public void Close(TimeSpan timeout) 35public void Open(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WrapperSecurityCommunicationObject.cs (28)
32protected override TimeSpan DefaultCloseTimeout 37protected override TimeSpan DefaultOpenTimeout 47protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 52protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 57protected override void OnClose(TimeSpan timeout) 90protected override void OnOpen(TimeSpan timeout) 112protected internal override async Task OnCloseAsync(TimeSpan timeout) 125protected internal override async Task OnOpenAsync(TimeSpan timeout) 201public virtual TimeSpan DefaultOpenTimeout 206public virtual TimeSpan DefaultCloseTimeout 222public void Close(TimeSpan timeout) 232public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 247public void Open(TimeSpan timeout) 257public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 277public IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 282public IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 287public virtual void OnClose(TimeSpan timeout) 314public virtual void OnOpen(TimeSpan timeout) 376public virtual TimeSpan DefaultOpenTimeout 381public virtual TimeSpan DefaultCloseTimeout 397public void Close(TimeSpan timeout) 407public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 422public void Open(TimeSpan timeout) 432public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 452public IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 457public IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 462public virtual void OnClose(TimeSpan timeout) 489public virtual void OnOpen(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSTrustFeb2005.cs (4)
276protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 286protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 296protected override void OnClose(TimeSpan timeout) 301protected override void OnOpen(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceChannelManager.cs (5)
125public IAsyncResult BeginCloseInput(TimeSpan timeout, AsyncCallback callback, object state) 163public void CloseInput(TimeSpan timeout) 314protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 319private IAsyncResult OnBeginCloseContinue(TimeSpan timeout, AsyncCallback callback, object state) 325protected override void OnClose(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceDefaults.cs (8)
9public static TimeSpan CloseTimeout { get { return TimeSpan.FromMinutes(1); } } 10public static TimeSpan OpenTimeout { get { return TimeSpan.FromMinutes(1); } } 11public static TimeSpan ReceiveTimeout { get { return TimeSpan.FromMinutes(10); } } 12public static TimeSpan SendTimeout { get { return TimeSpan.FromMinutes(1); } }
FrameworkFork\System.ServiceModel\System\ServiceModel\SpnEndpointIdentity.cs (3)
14private static TimeSpan s_spnLookupTime = TimeSpan.FromMinutes(1); 23public static TimeSpan SpnLookupTime
FrameworkFork\System.ServiceModel\System\ServiceModel\TimeSpanHelper.cs (15)
12static public TimeSpan FromMinutes(int minutes, string text) 14TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMinute * minutes); 15Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 18static public TimeSpan FromSeconds(int seconds, string text) 20TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerSecond * seconds); 21Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 24static public TimeSpan FromMilliseconds(int ms, string text) 26TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMillisecond * ms); 27Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), "");
Metadata\MetadaExchangeResolver.cs (1)
78resolver.OperationTimeout = TimeSpan.MaxValue;
dotnet-user-jwts (2)
Commands\CreateCommand.cs (2)
185if (!TimeSpan.TryParseExact(validForOption.Value(), _timeSpanFormats, CultureInfo.InvariantCulture, out var validForValue))
EntityFrameworkCoreSample (1)
Program.cs (1)
29.SetDefaultKeyLifetime(TimeSpan.FromDays(7))
Extensibility.WebSockets.IntegrationTests (13)
WebSocketTests.4.1.0.cs (13)
66uploadStream.ReadThrottle = TimeSpan.FromMilliseconds(500); 67uploadStream.StreamDuration = TimeSpan.FromSeconds(1); 83uploadStream.ReadThrottle = TimeSpan.FromMilliseconds(500); 84uploadStream.StreamDuration = TimeSpan.FromSeconds(1); 210binding.WebSocketSettings.KeepAliveInterval = TimeSpan.FromSeconds(2); 307uploadStream.ReadThrottle = TimeSpan.FromMilliseconds(500); 308uploadStream.StreamDuration = TimeSpan.FromSeconds(1); 324uploadStream.ReadThrottle = TimeSpan.FromMilliseconds(500); 325uploadStream.StreamDuration = TimeSpan.FromSeconds(1); 470uploadStream.ReadThrottle = TimeSpan.FromMilliseconds(500); 471uploadStream.StreamDuration = TimeSpan.FromSeconds(1); 577binding.WebSocketSettings.KeepAliveInterval = TimeSpan.FromSeconds(2); 695binding.WebSocketSettings.KeepAliveInterval = TimeSpan.FromSeconds(2);
GenerateDocumentationAndConfigFiles (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
GetDocument.Insider (9)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-rc.1.25420.121\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (8)
24private static readonly TimeSpan s_defaultWaitTimeout = SetupDefaultTimeout(); 26private static TimeSpan SetupDefaultTimeout() 35return TimeSpan.FromSeconds((int)timeoutInSeconds); 38return TimeSpan.FromMinutes(5); 63TimeSpan? waitTimeout = null, 122public static Func<string[], IServiceProvider?>? ResolveServiceProviderFactory(Assembly assembly, TimeSpan? waitTimeout = null) 200private readonly TimeSpan _waitTimeout; 209public HostingListener(string[] args, MethodInfo entryPoint, TimeSpan waitTimeout, bool stopApplication, Action<object>? configure, Action<Exception?>? entrypointCompleted)
Commands\GetDocumentCommandWorker.cs (1)
359var finished = resultTask.Wait(TimeSpan.FromMinutes(1));
HealthChecksSandbox.AppHost (1)
Program.cs (1)
72await Task.Delay(TimeSpan.FromSeconds(10));
HelixTestRunner (11)
HelixTestRunnerOptions.cs (2)
71Timeout = TimeSpan.Parse(parseResult.ValueForOption<string>("--helixTimeout"), CultureInfo.InvariantCulture), 91public TimeSpan Timeout { get; private set; }
ProcessUtil.cs (1)
192await Task.WhenAny(processLifetimeTask.Task, Task.Delay(TimeSpan.FromSeconds(5), cancel.Token));
TestRunner.cs (8)
140cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); 148cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); 156cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); 178cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); 187cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); 206cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token); 229var testProcessTimeout = Options.Timeout.Subtract(TimeSpan.FromMinutes(5));
HttpAbstractions.SampleApp (1)
Program.cs (1)
43response.Cookies.Append("Cookie1", "value1", new CookieOptions() { Expires = DateTimeOffset.UtcNow + TimeSpan.FromDays(1) });
HttpsPolicySample (1)
Startup.cs (1)
22options.MaxAge = TimeSpan.FromDays(30);
HttpStress (1)
Program.cs (1)
514PooledConnectionLifetime = connectionLifetime.HasValue ? TimeSpan.FromMilliseconds(connectionLifetime.Value) : Timeout.InfiniteTimeSpan,
IdeCoreBenchmarks (11)
IncrementalSourceGeneratorBenchmarks.cs (3)
158var totalIncrementalTime = TimeSpan.Zero; 169var incrementalTime = DateTime.Now - start;
NavigateToBenchmarks.cs (2)
188var indexTime = TimeSpan.Zero;
SyntacticChangeRangeBenchmark.cs (6)
91SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, newRoot, TimeSpan.MaxValue, CancellationToken.None); 98SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, newRoot, TimeSpan.MaxValue, CancellationToken.None); 104SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, _rootWithSimpleEdit, TimeSpan.MaxValue, CancellationToken.None); 110SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, _rootWithComplexEdit, TimeSpan.MaxValue, CancellationToken.None); 117SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, newRoot, TimeSpan.MaxValue, CancellationToken.None); 124SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, newRoot, TimeSpan.MaxValue, CancellationToken.None);
IIS.Common.TestLib (4)
TestConnections.cs (2)
23private static readonly TimeSpan Timeout = TimeSpan.FromMinutes(2);
TimeoutExtensions.cs (2)
13public static TimeSpan DefaultTimeoutValue = TimeSpan.FromMinutes(10);
IIS.FunctionalTests (21)
Http2TrailersResetTests.cs (2)
508var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 517using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
Http3Tests.cs (1)
180return new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
133Timeout = TimeSpan.FromSeconds(200),
src\Servers\IIS\IIS\test\Common.FunctionalTests\Http2Tests.cs (3)
359using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 373using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 393using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (3)
13private static readonly TimeSpan AppVerifierCommandTimeout = TimeSpan.FromSeconds(5); 41private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
18private static readonly TimeSpan RetryRequestDelay = TimeSpan.FromMilliseconds(10); 48Timeout = TimeSpan.FromSeconds(200), 113var delay = RetryRequestDelay; 131public static Task Retry(Func<Task> func, TimeSpan maxTime)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
19protected static readonly TimeSpan RetryDelay = TimeSpan.FromMilliseconds(100);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Latin1Tests.cs (2)
46var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger)); 64var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger));
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (2)
42using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) }; 56using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) };
IIS.LongTests (11)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (3)
13private static readonly TimeSpan AppVerifierCommandTimeout = TimeSpan.FromSeconds(5); 41private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
18private static readonly TimeSpan RetryRequestDelay = TimeSpan.FromMilliseconds(10); 48Timeout = TimeSpan.FromSeconds(200), 113var delay = RetryRequestDelay; 131public static Task Retry(Func<Task> func, TimeSpan maxTime)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
19protected static readonly TimeSpan RetryDelay = TimeSpan.FromMilliseconds(100);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1379Timeout = TimeSpan.FromSeconds(200),
IIS.Microbenchmarks (1)
PlaintextBenchmark.cs (1)
31Timeout = TimeSpan.FromSeconds(200),
IIS.NewHandler.FunctionalTests (11)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (3)
13private static readonly TimeSpan AppVerifierCommandTimeout = TimeSpan.FromSeconds(5); 41private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
18private static readonly TimeSpan RetryRequestDelay = TimeSpan.FromMilliseconds(10); 48Timeout = TimeSpan.FromSeconds(200), 113var delay = RetryRequestDelay; 131public static Task Retry(Func<Task> func, TimeSpan maxTime)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
19protected static readonly TimeSpan RetryDelay = TimeSpan.FromMilliseconds(100);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1379Timeout = TimeSpan.FromSeconds(200),
IIS.NewShim.FunctionalTests (11)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (3)
13private static readonly TimeSpan AppVerifierCommandTimeout = TimeSpan.FromSeconds(5); 41private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
18private static readonly TimeSpan RetryRequestDelay = TimeSpan.FromMilliseconds(10); 48Timeout = TimeSpan.FromSeconds(200), 113var delay = RetryRequestDelay; 131public static Task Retry(Func<Task> func, TimeSpan maxTime)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
19protected static readonly TimeSpan RetryDelay = TimeSpan.FromMilliseconds(100);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1379Timeout = TimeSpan.FromSeconds(200),
IIS.ShadowCopy.Tests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (3)
13private static readonly TimeSpan AppVerifierCommandTimeout = TimeSpan.FromSeconds(5); 41private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
18private static readonly TimeSpan RetryRequestDelay = TimeSpan.FromMilliseconds(10); 48Timeout = TimeSpan.FromSeconds(200), 113var delay = RetryRequestDelay; 131public static Task Retry(Func<Task> func, TimeSpan maxTime)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
19protected static readonly TimeSpan RetryDelay = TimeSpan.FromMilliseconds(100);
IIS.Tests (1)
Utilities\TestServer.cs (1)
119Timeout = TimeSpan.FromSeconds(200),
IISExpress.FunctionalTests (19)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
133Timeout = TimeSpan.FromSeconds(200),
src\Servers\IIS\IIS\test\Common.FunctionalTests\Http2Tests.cs (3)
359using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 373using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 393using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (3)
13private static readonly TimeSpan AppVerifierCommandTimeout = TimeSpan.FromSeconds(5); 41private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
18private static readonly TimeSpan RetryRequestDelay = TimeSpan.FromMilliseconds(10); 48Timeout = TimeSpan.FromSeconds(200), 113var delay = RetryRequestDelay; 131public static Task Retry(Func<Task> func, TimeSpan maxTime)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
19protected static readonly TimeSpan RetryDelay = TimeSpan.FromMilliseconds(100);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Latin1Tests.cs (2)
46var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger)); 64var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger));
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (2)
42using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) }; 56using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1379Timeout = TimeSpan.FromSeconds(200),
Infrastructure.Common (6)
xunit\FailFastAfterAttribute.cs (2)
11FailTime = TimeSpan.Parse(durationString); 14public TimeSpan FailTime { get; }
xunit\WcfTestCase.cs (3)
23private TimeSpan _failFastDuration; 35TimeSpan failFastDuration, 121_failFastDuration = TimeSpan.Parse(failFastDurationStr);
xunit\WcfTestDiscoverer.cs (1)
101TimeSpan failFastDuration = Timeout.InfiniteTimeSpan;
InMemory.FunctionalTests (218)
ConnectionLimitTests.cs (2)
218await openedTcs.Task.TimeoutAfter(TimeSpan.FromSeconds(120)); 220await closedTcs.Task.TimeoutAfter(TimeSpan.FromSeconds(120));
Http2\Http2ConnectionTests.cs (3)
663AdvanceTime(TimeSpan.FromTicks(Constants.RequestBodyDrainTimeout.Ticks + 1)); 700AdvanceTime(TimeSpan.FromSeconds(1)); 705AdvanceTime(TimeSpan.FromSeconds(6));
Http2\Http2KeepAliveTests.cs (43)
27_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1); 36TriggerTick(TimeSpan.FromSeconds(1.1 * 2)); 44TriggerTick(TimeSpan.FromSeconds(1.1)); 45TriggerTick(TimeSpan.FromSeconds(1.1)); 46TriggerTick(TimeSpan.FromSeconds(1.1 * 20)); 57_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1); 65TriggerTick(TimeSpan.FromSeconds(1.1 * 2)); 79_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1); 93TriggerTick(TimeSpan.FromSeconds(1.1)); 102_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(5); 108TriggerTick(TimeSpan.FromSeconds(1.1)); 109TriggerTick(TimeSpan.FromSeconds(1.1)); 110TriggerTick(TimeSpan.FromSeconds(1.1)); 119_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1); 124TriggerTick(TimeSpan.FromSeconds(1.1 * 2)); 131TriggerTick(TimeSpan.FromSeconds(1.1)); 132TriggerTick(TimeSpan.FromSeconds(1.1)); 133TriggerTick(TimeSpan.FromSeconds(1.1)); 142_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1); 148TriggerTick(TimeSpan.FromSeconds(1.1 * 2)); 156TriggerTick(TimeSpan.FromSeconds(1.1)); 157TriggerTick(TimeSpan.FromSeconds(1.1)); 165TriggerTick(TimeSpan.FromSeconds(1.1)); 166TriggerTick(TimeSpan.FromSeconds(1.1)); 180_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1); 181_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingTimeout = TimeSpan.FromSeconds(3); 189TriggerTick(TimeSpan.FromSeconds(1.1 * 2)); 197TriggerTick(TimeSpan.FromSeconds(1.1)); 198TriggerTick(TimeSpan.FromSeconds(1.1)); 199TriggerTick(TimeSpan.FromSeconds(1.1)); 200TriggerTick(TimeSpan.FromSeconds(1.1)); 212_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1); 213_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingTimeout = TimeSpan.FromSeconds(3); 221TriggerTick(TimeSpan.FromSeconds(1.1 * 2)); 244_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1); 259TriggerTick(TimeSpan.FromSeconds(1.1)); 268_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1); 294TriggerTick(TimeSpan.FromSeconds(1.1)); 304TriggerTick(TimeSpan.FromSeconds(1.1)); 322_serviceContext.ServerOptions.Limits.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1); 348TriggerTick(TimeSpan.FromSeconds(1.1)); 351TriggerTick(TimeSpan.FromSeconds(1.1)); 362TriggerTick(TimeSpan.FromSeconds(1.1));
Http2\Http2TestBase.cs (4)
1379protected void TriggerTick(TimeSpan timeSpan) 1392protected void AdvanceTime(TimeSpan timeSpan) 1464public virtual void SetTimeout(TimeSpan timeout, TimeoutReason timeoutReason) 1469public virtual void ResetTimeout(TimeSpan timeout, TimeoutReason timeoutReason)
Http2\Http2TimeoutTests.cs (63)
29AdvanceTime(TimeSpan.FromTicks(1)); 49AdvanceTime(TimeSpan.FromTicks(1)); 68_mockTimeoutControl.Verify(c => c.SetTimeout(It.IsAny<TimeSpan>(), TimeoutReason.KeepAlive), Times.Once); 74_mockTimeoutControl.Setup(c => c.SetTimeout(It.IsAny<TimeSpan>(), TimeoutReason.KeepAlive)).Callback<TimeSpan, TimeoutReason>((t, r) => 84_mockTimeoutControl.Verify(c => c.SetTimeout(It.IsAny<TimeSpan>(), TimeoutReason.RequestHeaders), Times.Once); 97AdvanceTime(TimeSpan.FromTicks(1)); 117_mockTimeoutControl.Verify(c => c.SetTimeout(It.IsAny<TimeSpan>(), TimeoutReason.KeepAlive), Times.Once); 118_mockTimeoutControl.Verify(c => c.ResetTimeout(It.IsAny<TimeSpan>(), TimeoutReason.KeepAlive), Times.Never); 127_mockTimeoutControl.Verify(c => c.ResetTimeout(It.IsAny<TimeSpan>(), TimeoutReason.KeepAlive), Times.Once); 140_mockTimeoutControl.Verify(c => c.SetTimeout(It.IsAny<TimeSpan>(), TimeoutReason.KeepAlive), Times.Once); 141_mockTimeoutControl.Verify(c => c.ResetTimeout(It.IsAny<TimeSpan>(), TimeoutReason.KeepAlive), Times.Never); 157_mockTimeoutControl.Verify(c => c.ResetTimeout(It.IsAny<TimeSpan>(), TimeoutReason.KeepAlive), Times.Never); 188AdvanceTime(TimeSpan.FromTicks(1)); 218AdvanceTime(TimeSpan.FromSeconds(_bytesReceived / limits.MinResponseDataRate.BytesPerSecond) + 219limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5)); 224AdvanceTime(TimeSpan.FromSeconds(1)); 274timeProvider.Advance(Constants.RequestBodyDrainTimeout + TimeSpan.FromTicks(1)); 353limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 375AdvanceTime(TimeSpan.FromSeconds((_bytesReceived + _helloWorldBytes.Length) / limits.MinResponseDataRate.BytesPerSecond) + 376limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5)); 380AdvanceTime(TimeSpan.FromSeconds(1)); 406limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 427var timeToWriteMaxData = TimeSpan.FromSeconds((_bytesReceived + _maxData.Length) / limits.MinResponseDataRate.BytesPerSecond) + 428limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5); 435AdvanceTime(TimeSpan.FromSeconds(1)); 461limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 484AdvanceTime(TimeSpan.FromSeconds(_bytesReceived / limits.MinResponseDataRate.BytesPerSecond) + 485limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5)); 489AdvanceTime(TimeSpan.FromSeconds(1)); 513limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 535var timeToWriteMaxData = TimeSpan.FromSeconds(_bytesReceived / limits.MinResponseDataRate.BytesPerSecond) + 536limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5); 543AdvanceTime(TimeSpan.FromSeconds(1)); 567limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 601var timeToWriteMaxData = TimeSpan.FromSeconds(_bytesReceived / limits.MinResponseDataRate.BytesPerSecond) + 602limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5); 609AdvanceTime(TimeSpan.FromSeconds(1)); 633limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 656AdvanceTime(TimeSpan.FromTicks(1)); 680limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 700var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 707AdvanceTime(TimeSpan.FromSeconds(1)); 731limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 761var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond); 767timeToReadMaxData -= TimeSpan.FromSeconds(.5); 774AdvanceTime(TimeSpan.FromSeconds(1)); 798limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 835var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 842AdvanceTime(TimeSpan.FromSeconds(1)); 866limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 894AdvanceTime(TimeSpan.FromTicks(1)); 923limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 959AdvanceTime(TimeSpan.FromDays(1)); 983AdvanceTime(TimeSpan.FromTicks(1));
Http2\Http2WebSocketTests.cs (2)
328limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 353AdvanceTime(limits.MinRequestBodyDataRate.GracePeriod + TimeSpan.FromTicks(1));
Http3\Http3ConnectionTests.cs (2)
307Http3Api.TriggerTick(TimeSpan.FromSeconds(1)); 352Http3Api.TriggerTick(TimeSpan.FromSeconds(1));
Http3\Http3TimeoutTests.cs (41)
28Http3Api.AdvanceTime(limits.KeepAliveTimeout + TimeSpan.FromTicks(1)); 45Http3Api.AdvanceTime(limits.KeepAliveTimeout + TimeSpan.FromTicks(1)); 74Http3Api.AdvanceTime(limits.KeepAliveTimeout + Heartbeat.Interval + TimeSpan.FromTicks(1)); 120Http3Api.AdvanceTime(limits.KeepAliveTimeout + Heartbeat.Interval + TimeSpan.FromTicks(1)); 149Http3Api.TriggerTick(TimeSpan.FromTicks(1)); 203Http3Api.AdvanceTime(TimeSpan.FromTicks(1)); 236Http3Api.AdvanceTime(TimeSpan.FromTicks(1)); 272Http3Api.TriggerTick(TimeSpan.FromTicks(1)); 291Http3Api.TriggerTick(limits.RequestHeadersTimeout + TimeSpan.FromTicks(1)); 309limits.RequestHeadersTimeout = TimeSpan.MaxValue; 332Assert.Equal(TimeSpan.MaxValue.ToTicks(timeProvider), serverInboundControlStream.StreamTimeoutTimestamp); 341limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 363Http3Api.AdvanceTime(TimeSpan.FromTicks(1)); 383limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 403Http3Api.TriggerTick(TimeSpan.FromTicks(1)); 451limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 470Http3Api.AdvanceTime(TimeSpan.FromSeconds((requestStream.BytesReceived + _helloWorldBytes.Length) / limits.MinResponseDataRate.BytesPerSecond) + 471limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5)); 475Http3Api.AdvanceTime(TimeSpan.FromSeconds(1)); 493limits.MinResponseDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 511var timeToWriteMaxData = TimeSpan.FromSeconds((requestStream.BytesReceived + _maxData.Length) / limits.MinResponseDataRate.BytesPerSecond) + 512limits.MinResponseDataRate.GracePeriod + Heartbeat.Interval - TimeSpan.FromSeconds(.5); 519Http3Api.AdvanceTime(TimeSpan.FromSeconds(1)); 535limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 554var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 561Http3Api.AdvanceTime(TimeSpan.FromSeconds(1)); 581limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 603var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond); 609timeToReadMaxData -= TimeSpan.FromSeconds(.5); 616Http3Api.AdvanceTime(TimeSpan.FromSeconds(1)); 636limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 665var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 672Http3Api.AdvanceTime(TimeSpan.FromSeconds(1)); 692limits.MinRequestBodyDataRate = new MinDataRate(480, TimeSpan.FromSeconds(2.5)); 721Http3Api.AdvanceTime(TimeSpan.FromTicks(1));
HttpsTests.cs (2)
377o.HandshakeTimeout = TimeSpan.FromMilliseconds(100); 412}, state: null, handshakeTimeout: TimeSpan.FromMilliseconds(100));
KeepAliveTimeoutTests.cs (14)
18private static readonly TimeSpan _keepAliveTimeout = TimeSpan.FromSeconds(10); 19private static readonly TimeSpan _longDelay = TimeSpan.FromSeconds(30); 20private static readonly TimeSpan _shortDelay = TimeSpan.FromSeconds(_longDelay.TotalSeconds / 10); 46testContext.FakeTimeProvider.Advance(_keepAliveTimeout + Heartbeat.Interval + TimeSpan.FromTicks(1)); 112for (var totalDelay = TimeSpan.Zero; totalDelay < _longDelay; totalDelay += _shortDelay) 157for (var totalDelay = TimeSpan.Zero; totalDelay < _longDelay; totalDelay += _shortDelay) 194testContext.FakeTimeProvider.Advance(_keepAliveTimeout + Heartbeat.Interval + TimeSpan.FromTicks(1)); 232for (var totalDelay = TimeSpan.Zero; totalDelay < _longDelay; totalDelay += _shortDelay)
KestrelMetricsTests.cs (4)
211ShutdownTimeout = TimeSpan.FromSeconds(60) 277ShutdownTimeout = TimeSpan.Zero 545ShutdownTimeout = TimeSpan.FromSeconds(200) 614ShutdownTimeout = TimeSpan.Zero,
RequestBodyTimeoutTests.cs (6)
25var gracePeriod = TimeSpan.FromSeconds(5); 77serviceContext.FakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 155var gracePeriod = TimeSpan.FromSeconds(5); 203serviceContext.FakeTimeProvider.Advance(TimeSpan.FromSeconds(1));
RequestHeadersTimeoutTests.cs (9)
16private static readonly TimeSpan RequestHeadersTimeout = TimeSpan.FromSeconds(10); 17private static readonly TimeSpan LongDelay = TimeSpan.FromSeconds(30); 18private static readonly TimeSpan ShortDelay = TimeSpan.FromSeconds(LongDelay.TotalSeconds / 10); 42testContext.FakeTimeProvider.Advance(RequestHeadersTimeout + Heartbeat.Interval + TimeSpan.FromTicks(1)); 74testContext.FakeTimeProvider.Advance(RequestHeadersTimeout + Heartbeat.Interval + TimeSpan.FromTicks(1)); 107testContext.FakeTimeProvider.Advance(RequestHeadersTimeout + Heartbeat.Interval + TimeSpan.FromTicks(1));
RequestTests.cs (2)
1635new MinDataRate(bytesPerSecond: double.MaxValue, gracePeriod: Heartbeat.Interval + TimeSpan.FromTicks(1)); 1666serviceContext.FakeTimeProvider.Advance(TimeSpan.FromSeconds(5));
ResponseDrainingTests.cs (4)
26var minRate = new MinDataRate(16384, TimeSpan.FromSeconds(2)); 61testContext.FakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 65testContext.FakeTimeProvider.Advance(Heartbeat.Interval - TimeSpan.FromSeconds(.5)); 70testContext.FakeTimeProvider.Advance(TimeSpan.FromSeconds(1));
ResponseTests.cs (3)
160var timerTask = Task.Delay(TimeSpan.FromSeconds(1)); 167timerTask = Task.Delay(TimeSpan.FromSeconds(1)); 2281await Task.Delay(TimeSpan.FromSeconds(1));
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (4)
157TimeSpan.FromMinutes(1), 172TimeSpan.FromSeconds(2), 181TimeSpan.FromSeconds(1), 240TimeSpan nestingBuffer,
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
201public void AdvanceTime(TimeSpan timeSpan) 218public void TriggerTick(TimeSpan timeSpan = default)
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
32public TimeSpan ResponseDelay { get; set; }
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (2)
18private static readonly TimeSpan Timeout = TimeSpan.FromMinutes(1);
src\Servers\Kestrel\shared\test\TestConstants.cs (2)
11public static TimeSpan DefaultTimeout = TimeSpan.FromSeconds(30);
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
71public TimeSpan ShutdownTimeout { get; set; }
TlsListenerTests.cs (1)
84httpsOptions.HandshakeTimeout = TimeSpan.FromMilliseconds(1);
UpgradeTests.cs (1)
347var exception = await Assert.ThrowsAsync<InvalidOperationException>(async () => await upgradeTcs.Task.TimeoutAfter(TimeSpan.FromSeconds(60)));
InProcessWebSite (4)
DummyServer.cs (2)
20return Task.Delay(TimeSpan.MaxValue); 25return Task.Delay(TimeSpan.MaxValue);
Program.cs (1)
78.UseShutdownTimeout(TimeSpan.FromSeconds(120))
Startup.WebSockets.cs (1)
159var ws = WebSocket.CreateFromStream(opaqueTransport, isServer: true, subProtocol: null, keepAliveInterval: TimeSpan.FromMinutes(2));
InteractiveHost.UnitTests (1)
InteractiveHostDesktopTests.cs (1)
1079Thread.Sleep(TimeSpan.FromSeconds(10));
Interop.FunctionalTests (22)
H2SpecCommands.cs (1)
254if (await Task.WhenAny(exitedTcs.Task, Task.Delay(TimeSpan.FromSeconds(TimeoutSeconds * 2))) != exitedTcs.Task)
Http2WebSocketInteropTests.cs (2)
110KeepAliveInterval = TimeSpan.FromMilliseconds(1), 111KeepAliveTimeout = TimeSpan.FromMilliseconds(1),
Http3\Http3RequestTests.cs (6)
719using (var client = HttpHelpers.CreateClient(expect100ContinueTimeout: TimeSpan.FromMinutes(20))) 733cts.CancelAfter(TimeSpan.FromSeconds(30)); 1433await memoryPool.WhenAllBlocksReturnedAsync(TimeSpan.FromSeconds(15)); 1514await Task.Delay(TimeSpan.FromMilliseconds(10)); 2152var shutdownTimeout = Microsoft.AspNetCore.InternalTesting.TaskExtensions.DefaultTimeoutTimeSpan / 2; 2358private IHostBuilder CreateHostBuilder(RequestDelegate requestDelegate, HttpProtocols? protocol = null, Action<KestrelServerOptions> configureKestrel = null, TimeSpan? shutdownTimeout = null)
HttpClientHttp2InteropTests.cs (3)
214using (var timer = new CancellationTokenSource(TimeSpan.FromSeconds(30))) 234using (var timer = new CancellationTokenSource(TimeSpan.FromSeconds(30))) 250using var timer = new CancellationTokenSource(TimeSpan.FromSeconds(30));
HttpHelpers.cs (5)
38public static HttpMessageInvoker CreateClient(TimeSpan? idleTimeout = null, TimeSpan? expect100ContinueTimeout = null, bool includeClientCert = false, int? maxResponseHeadersLength = null) 66public static IHostBuilder CreateHostBuilder(Action<IServiceCollection> configureServices, RequestDelegate requestDelegate, HttpProtocols? protocol = null, Action<KestrelServerOptions> configureKestrel = null, bool? plaintext = null, TimeSpan? shutdownTimeout = null) 101o.ShutdownTimeout = TimeSpan.FromHours(1); 105o.ShutdownTimeout = shutdownTimeout ?? TimeSpan.FromSeconds(5);
src\Servers\Kestrel\shared\test\TestConstants.cs (2)
11public static TimeSpan DefaultTimeout = TimeSpan.FromSeconds(30);
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
InteropTests (16)
InteropTests.cs (3)
15private static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(100); 106await Task.Delay(TimeSpan.FromSeconds(1));
src\Shared\Process\ProcessEx.cs (7)
21private static readonly TimeSpan DefaultProcessTimeout = TimeSpan.FromMinutes(15); 32private readonly CancellationTokenSource _stdoutLinesCancellationSource = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 36public ProcessEx(ITestOutputHelper output, Process proc, TimeSpan timeout) 103public static ProcessEx Run(ITestOutputHelper output, string workingDirectory, string command, string args = null, IDictionary<string, string> envVars = null, TimeSpan? timeout = default) 205public void WaitForExit(bool assertSuccess, TimeSpan? timeSpan = null) 209timeSpan = TimeSpan.FromSeconds(600);
src\Shared\Process\ProcessExtensions.cs (6)
14private static readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30); 18public static void KillTree(this Process process, TimeSpan timeout) 41private static void GetAllChildIdsUnix(int parentId, ISet<int> children, TimeSpan timeout) 79private static void KillProcessUnix(int processId, TimeSpan timeout) 95private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout, out string stdout)
KeyManagementSimulator (6)
Program.cs (6)
189var totalProblemTime = TimeSpan.Zero; 193var cumulativeProblemTime = appInstance.CumulativeProblemTime; 316private TimeSpan _cumulativeProblemTime = TimeSpan.Zero; 381public TimeSpan CumulativeProblemTime => _cumulativeProblemTime;
Metrics (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Metrics.Legacy (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Microsoft.Analyzers.Extra.Tests (1)
CallAnalysis\StaticTimeTests.cs (1)
19Assembly.GetAssembly(typeof(TimeSpan))!,
Microsoft.Arcade.Common (2)
ExponentialRetry.cs (2)
56TimeSpan delay = TimeSpan.FromSeconds(
Microsoft.AspNetCore.Authentication (6)
RemoteAuthenticationOptions.cs (4)
65public TimeSpan BackchannelTimeout { get; set; } = TimeSpan.FromSeconds(60); 117public TimeSpan RemoteAuthenticationTimeout { get; set; } = TimeSpan.FromMinutes(15);
SystemClock.cs (2)
37var utcNowPrecisionSeconds = new DateTime((_timeProvider.GetUtcNow().Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond, DateTimeKind.Utc);
Microsoft.AspNetCore.Authentication.BearerToken (4)
BearerTokenOptions.cs (4)
32public TimeSpan BearerTokenExpiration { get; set; } = TimeSpan.FromHours(1); 41public TimeSpan RefreshTokenExpiration { get; set; } = TimeSpan.FromDays(14);
Microsoft.AspNetCore.Authentication.Certificate (3)
CertificateValidationCache.cs (1)
53var absoluteExpiration = _timeProvider.GetUtcNow().Add(TimeSpan.FromMinutes(30));
CertificateValidationCacheOptions.cs (2)
16public TimeSpan CacheEntryExpiration { get; set; } = TimeSpan.FromMinutes(2);
Microsoft.AspNetCore.Authentication.Cookies (9)
CookieAuthenticationHandler.cs (3)
100var timeElapsed = currentUtc.Subtract(issuedUtc.Value); 101var timeRemaining = expiresUtc.Value.Subtract(currentUtc); 126var timeSpan = expiresUtc.Value.Subtract(issuedUtc.Value);
CookieAuthenticationOptions.cs (2)
30ExpireTimeSpan = TimeSpan.FromDays(14); 135public TimeSpan ExpireTimeSpan { get; set; }
CookieSlidingExpirationContext.cs (4)
23AuthenticationTicket ticket, TimeSpan elapsedTime, TimeSpan remainingTime) 36public TimeSpan ElapsedTime { get; } 41public TimeSpan RemainingTime { get; }
Microsoft.AspNetCore.Authentication.Core (1)
AuthenticationMetrics.cs (1)
87var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp);
Microsoft.AspNetCore.Authentication.Core.Test (4)
AuthenticationPropertiesTests.cs (4)
311ExpiresUtc = new DateTimeOffset(2021, 03, 28, 13, 47, 00, TimeSpan.Zero), 312IssuedUtc = new DateTimeOffset(2021, 03, 28, 12, 47, 00, TimeSpan.Zero), 367ExpiresUtc = new DateTimeOffset(2021, 03, 28, 13, 47, 00, TimeSpan.Zero), 368IssuedUtc = new DateTimeOffset(2021, 03, 28, 12, 47, 00, TimeSpan.Zero),
Microsoft.AspNetCore.Authentication.JwtBearer (6)
JwtBearerConfigureOptions.cs (2)
16private static readonly Func<string, TimeSpan> _invariantTimeSpanParse = (string timespanString) => TimeSpan.Parse(timespanString, CultureInfo.InvariantCulture);
JwtBearerOptions.cs (4)
94public TimeSpan BackchannelTimeout { get; set; } = TimeSpan.FromMinutes(1); 168public TimeSpan AutomaticRefreshInterval { get; set; } = ConfigurationManager<OpenIdConnectConfiguration>.DefaultAutomaticRefreshInterval; 176public TimeSpan RefreshInterval { get; set; } = ConfigurationManager<OpenIdConnectConfiguration>.DefaultRefreshInterval;
Microsoft.AspNetCore.Authentication.Negotiate (5)
LdapSettings.cs (4)
63public TimeSpan ClaimsCacheSlidingExpiration { get; set; } = TimeSpan.FromMinutes(10); 69public TimeSpan ClaimsCacheAbsoluteExpiration { get; set; } = TimeSpan.FromMinutes(60);
PostConfigureNegotiateOptions.cs (1)
87ldapSettings.LdapConnection.Timeout = TimeSpan.FromMinutes(1);
Microsoft.AspNetCore.Authentication.OAuth (3)
Events\OAuthCreatingTicketContext.cs (2)
78public TimeSpan? ExpiresIn 85return TimeSpan.FromSeconds(value);
OAuthHandler.cs (1)
170var expiresAt = TimeProvider.GetUtcNow() + TimeSpan.FromSeconds(value);
Microsoft.AspNetCore.Authentication.OpenIdConnect (14)
OpenIdConnectChallengeProperties.cs (2)
49public TimeSpan? MaxAge 51get => GetParameter<TimeSpan?>(MaxAgeKey);
OpenIdConnectConfigureOptions.cs (5)
15private static readonly Func<string, TimeSpan> _invariantTimeSpanParse = (string timespanString) => TimeSpan.Parse(timespanString, CultureInfo.InvariantCulture); 16private static readonly Func<string, TimeSpan?> _invariantNullableTimeSpanParse = (string timespanString) => TimeSpan.Parse(timespanString, CultureInfo.InvariantCulture); 98cookieBuilder.MaxAge = StringHelpers.ParseValueOrDefault<TimeSpan?>(cookieConfigSection[nameof(cookieBuilder.MaxAge)], _invariantNullableTimeSpanParse, cookieBuilder.MaxAge);
OpenIdConnectHandler.cs (2)
429var maxAge = properties.GetParameter<TimeSpan?>(OpenIdConnectParameterNames.MaxAge) ?? Options.MaxAge; 1138var expiresAt = TimeProvider.GetUtcNow() + TimeSpan.FromSeconds(value);
OpenIdConnectOptions.cs (5)
95if (MaxAge.HasValue && MaxAge.Value < TimeSpan.Zero) 177public TimeSpan? MaxAge { get; set; } 187NonceLifetime = TimeSpan.FromMinutes(15) 371public TimeSpan AutomaticRefreshInterval { get; set; } = ConfigurationManager<OpenIdConnectConfiguration>.DefaultAutomaticRefreshInterval; 379public TimeSpan RefreshInterval { get; set; } = ConfigurationManager<OpenIdConnectConfiguration>.DefaultRefreshInterval;
Microsoft.AspNetCore.Authentication.Test (81)
CertificateTests.cs (1)
769timeProvider.Advance(TimeSpan.FromMinutes(31));
CookieTests.cs (53)
265_timeProvider.Advance(TimeSpan.FromDays(60)); 300_timeProvider.Advance(TimeSpan.FromDays(60)); 347o.Cookie.Expiration = TimeSpan.FromDays(10); 499o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 508_timeProvider.Advance(TimeSpan.FromMinutes(7)); 512_timeProvider.Advance(TimeSpan.FromMinutes(7)); 529o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 535new AuthenticationProperties() { ExpiresUtc = _timeProvider.GetUtcNow().Add(TimeSpan.FromMinutes(5)) })); 542_timeProvider.Advance(TimeSpan.FromMinutes(3)); 546_timeProvider.Advance(TimeSpan.FromMinutes(3)); 563o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 580_timeProvider.Advance(TimeSpan.FromMinutes(11)); 592o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 621o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 658o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 680_timeProvider.Advance(TimeSpan.FromMinutes(5)); 686_timeProvider.Advance(TimeSpan.FromMinutes(6)); 692_timeProvider.Advance(TimeSpan.FromMinutes(5)); 732o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 780o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 801_timeProvider.Advance(TimeSpan.FromMinutes(5)); 807_timeProvider.Advance(TimeSpan.FromMinutes(6)); 813_timeProvider.Advance(TimeSpan.FromMinutes(11)); 825o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 857_timeProvider.Advance(TimeSpan.FromMinutes(5)); 863_timeProvider.Advance(TimeSpan.FromMinutes(6)); 869_timeProvider.Advance(TimeSpan.FromMinutes(11)); 881o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 916_timeProvider.Advance(TimeSpan.FromMinutes(1)); 922_timeProvider.Advance(TimeSpan.FromMinutes(1)); 928_timeProvider.Advance(TimeSpan.FromMinutes(9)); 940o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 962_timeProvider.Advance(TimeSpan.FromMinutes(5)); 968_timeProvider.Advance(TimeSpan.FromMinutes(6)); 974_timeProvider.Advance(TimeSpan.FromMinutes(5)); 990o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 1020_timeProvider.Advance(TimeSpan.FromMinutes(1)); 1026_timeProvider.Advance(TimeSpan.FromMinutes(2)); 1041o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 1047context.Properties.ExpiresUtc = _timeProvider.GetUtcNow().Add(TimeSpan.FromMinutes(5)); 1061_timeProvider.Advance(TimeSpan.FromMinutes(3)); 1067_timeProvider.Advance(TimeSpan.FromMinutes(3)); 1079o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 1091_timeProvider.Advance(TimeSpan.FromMinutes(4)); 1097_timeProvider.Advance(TimeSpan.FromMinutes(4)); 1104_timeProvider.Advance(TimeSpan.FromMinutes(4)); 1116o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 1137_timeProvider.Advance(TimeSpan.FromMinutes(4)); 1143_timeProvider.Advance(TimeSpan.FromMinutes(4)); 1150_timeProvider.Advance(TimeSpan.FromMinutes(4)); 1162o.ExpireTimeSpan = TimeSpan.FromMinutes(10); 1185_timeProvider.Advance(TimeSpan.FromMinutes(4)); 1191_timeProvider.Advance(TimeSpan.FromMinutes(4));
GoogleTests.cs (1)
791Assert.Equal(TimeSpan.FromSeconds(3600), context.ExpiresIn);
JwtBearerTests_Handler.cs (1)
984Assert.Equal(TimeSpan.FromSeconds(60), jwtBearerOptions.BackchannelTimeout);
OAuthChallengePropertiesTest.cs (4)
48MaxAge = TimeSpan.FromSeconds(200) 50Assert.Equal(TimeSpan.FromSeconds(200), properties.MaxAge); 57properties.Parameters["max_age"] = TimeSpan.FromSeconds(500); 58Assert.Equal(TimeSpan.FromSeconds(500), properties.MaxAge);
OpenIdConnect\OpenIdConnectChallengeTests.cs (5)
503opt.MaxAge = TimeSpan.FromMinutes(20); 638opt.MaxAge = TimeSpan.FromSeconds(500); 642MaxAge = TimeSpan.FromSeconds(1234), 662opt.MaxAge = TimeSpan.FromSeconds(500); 665properties.SetParameter(OpenIdConnectChallengeProperties.MaxAgeKey, TimeSpan.FromSeconds(1234));
OpenIdConnect\OpenIdConnectConfigurationTests.cs (1)
548o.MaxAge = TimeSpan.FromSeconds(-1);
OpenIdConnect\OpenIdConnectTests.cs (14)
410Assert.Equal(DateTime.MaxValue, GetNonceExpirationTime(noncePrefix + DateTime.MaxValue.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter, TimeSpan.FromHours(1))); 412Assert.Equal(DateTime.MinValue + TimeSpan.FromHours(1), GetNonceExpirationTime(noncePrefix + DateTime.MinValue.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter, TimeSpan.FromHours(1))); 414Assert.Equal(utcNow + TimeSpan.FromHours(1), GetNonceExpirationTime(noncePrefix + utcNow.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter, TimeSpan.FromHours(1))); 416Assert.Equal(DateTime.MinValue, GetNonceExpirationTime(noncePrefix, TimeSpan.FromHours(1))); 418Assert.Equal(DateTime.MinValue, GetNonceExpirationTime("", TimeSpan.FromHours(1))); 420Assert.Equal(DateTime.MinValue, GetNonceExpirationTime(noncePrefix + noncePrefix, TimeSpan.FromHours(1))); 422Assert.Equal(utcNow + TimeSpan.FromHours(1), GetNonceExpirationTime(noncePrefix + utcNow.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter + utcNow.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter, TimeSpan.FromHours(1))); 424Assert.Equal(DateTime.MinValue, GetNonceExpirationTime(utcNow.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter + utcNow.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter, TimeSpan.FromHours(1))); 452Assert.Equal(options.BackchannelTimeout, TimeSpan.FromMinutes(5)); 495Assert.Equal(TimeSpan.FromMinutes(1), options.BackchannelTimeout); 573private static DateTime GetNonceExpirationTime(string keyname, TimeSpan nonceLifetime)
OpenIdConnect\TestSettings.cs (1)
277Assert.Equal(TimeSpan.FromMinutes(20), _options.MaxAge.Value);
Microsoft.AspNetCore.Authentication.Twitter (2)
TwitterHandler.cs (1)
340var secondsSinceUnixEpocStart = TimeProvider.GetUtcNow() - DateTimeOffset.UnixEpoch;
TwitterOptions.cs (1)
25BackchannelTimeout = TimeSpan.FromSeconds(60);
Microsoft.AspNetCore.Authorization.Test (2)
AuthorizationMiddlewareTests.cs (2)
823var firstExpiration = new DateTimeOffset(2021, 5, 12, 2, 3, 4, TimeSpan.Zero); 824var secondExpiration = new DateTimeOffset(2021, 5, 11, 2, 3, 4, TimeSpan.Zero);
Microsoft.AspNetCore.Components (8)
ComponentsMetrics.cs (6)
94var duration = Stopwatch.GetElapsedTime(startTimestamp); 106var duration = Stopwatch.GetElapsedTime(startTimestamp); 123var duration = Stopwatch.GetElapsedTime(startTimestamp); 129var duration = Stopwatch.GetElapsedTime(startTimestamp); 149var duration = Stopwatch.GetElapsedTime(startTimestamp); 156var duration = Stopwatch.GetElapsedTime(startTimestamp);
src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (2)
26private static readonly TimeSpan RegexMatchTimeout = TimeSpan.FromSeconds(10);
Microsoft.AspNetCore.Components.Authorization.Tests (2)
AuthorizeViewTest.cs (2)
20private static readonly TimeSpan Timeout = Debugger.IsAttached ? System.Threading.Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(10);
Microsoft.AspNetCore.Components.Endpoints (15)
Builder\OpaqueRedirection.cs (1)
46var lifetime = options.Value.TemporaryRedirectionUrlValidityDuration;
DependencyInjection\RazorComponentsServiceOptions.cs (3)
14private TimeSpan _temporaryRedirectionUrlValidityDuration = TimeSpan.FromMinutes(5); 76public TimeSpan TemporaryRedirectionUrlValidityDuration
FormMapping\WellKnownConverters.cs (6)
43{ typeof(TimeSpan), new ParsableConverter<TimeSpan>() }, 75converters.Add(typeof(TimeSpan?), new NullableConverter<TimeSpan>((FormDataConverter<TimeSpan>)converters[typeof(TimeSpan)]));
src\Shared\Components\ServerComponentSerializationSettings.cs (2)
24public static readonly TimeSpan DataExpiration = TimeSpan.FromMinutes(5);
src\Shared\Components\ServerComponentSerializer.cs (3)
24TimeSpan? dataExpiration = default) 26var expiration = dataExpiration ?? ServerComponentSerializationSettings.DataExpiration; 36TimeSpan dataExpiration)
Microsoft.AspNetCore.Components.Endpoints.Tests (11)
Binding\FormDataMapperTests.cs (6)
2126{ "4/20/2023 12:56:34 PM +02:00", typeof(DateTimeOffset?), new DateTimeOffset?(new DateTimeOffset(2023, 04, 20, 12, 56, 34, TimeSpan.FromHours(2)))}, 2127{ "02:01:03", typeof(TimeSpan?), new TimeSpan?(new TimeSpan(02, 01, 03))}, 2169{ typeof(TimeSpan?) }, 2211{ "4/20/2023 12:56:34 PM +02:00", typeof(DateTimeOffset), new DateTimeOffset(2023, 04, 20, 12, 56, 34, TimeSpan.FromHours(2)) }, 2212{ "02:01:03", typeof(TimeSpan), new TimeSpan(02, 01, 03) },
RazorComponentResultTest.cs (5)
481private static async Task WaitForContentWrittenAsync(Stream stream, TimeSpan? timeout = default) 483var timeoutRemaining = timeout.GetValueOrDefault(TimeSpan.FromSeconds(1)); 484var pollInterval = TimeSpan.FromMilliseconds(50);
Microsoft.AspNetCore.Components.Server (29)
CircuitOptions.cs (8)
47public TimeSpan DisconnectedCircuitRetentionPeriod { get; set; } = TimeSpan.FromMinutes(3); 73public TimeSpan PersistedCircuitInMemoryRetentionPeriod { get; set; } = TimeSpan.FromHours(2); 81public TimeSpan? PersistedCircuitDistributedRetentionPeriod { get; set; } = TimeSpan.FromHours(8); 105public TimeSpan JSInteropDefaultCallTimeout { get; set; } = TimeSpan.FromMinutes(1);
Circuits\CircuitMetrics.cs (1)
75var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp);
Circuits\CircuitPersistenceManager.cs (3)
198var distributedRetention = circuitOptions.Value.PersistedCircuitInMemoryRetentionPeriod; 199var localRetention = circuitOptions.Value.PersistedCircuitInMemoryRetentionPeriod; 200var maxRetention = distributedRetention > localRetention ? distributedRetention : localRetention;
Circuits\RemoteJSDataStream.cs (3)
15private readonly TimeSpan _jsInteropDefaultCallTimeout; 41TimeSpan jsInteropDefaultCallTimeout, 63TimeSpan jsInteropDefaultCallTimeout,
Circuits\RemoteJSRuntime.cs (1)
186CancellationTokenSource cancellationTokenSource = new(TimeSpan.FromSeconds(10));
Circuits\RemoteRenderer.cs (3)
331var elapsedTime = entry.ValueStopwatch.GetElapsedTime(); 408public static void CompletingBatchWithError(ILogger logger, long batchId, string errorMessage, TimeSpan elapsedTime) 414public static void CompletingBatchWithoutError(ILogger logger, long batchId, TimeSpan elapsedTime)
Circuits\RevalidatingServerAuthenticationStateProvider.cs (1)
49protected abstract TimeSpan RevalidationInterval { get; }
src\Shared\Components\ServerComponentSerializationSettings.cs (2)
24public static readonly TimeSpan DataExpiration = TimeSpan.FromMinutes(5);
src\Shared\Components\ServerComponentSerializer.cs (3)
24TimeSpan? dataExpiration = default) 26var expiration = dataExpiration ?? ServerComponentSerializationSettings.DataExpiration; 36TimeSpan dataExpiration)
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackWriter.cs (2)
643var secondsSinceBclEpoch = dateTime.Ticks / TimeSpan.TicksPerSecond; 645var nanoseconds = (dateTime.Ticks % TimeSpan.TicksPerSecond) * DateTimeConstants.NanosecondsPerTick;
Microsoft.AspNetCore.Components.Server.Tests (43)
Circuits\CircuitHostTest.cs (2)
219var initializeTimeout = TimeSpan.FromMilliseconds(5000);
Circuits\CircuitPersistenceManagerTest.cs (1)
543TimeSpan.FromDays(365));
Circuits\CircuitRegistryTest.cs (9)
319circuitPersistenceProvider.AfterPersist.Wait(TimeSpan.FromSeconds(10)); 371circuitPersistenceProvider.AfterPersist.Wait(TimeSpan.FromSeconds(10)); 417DisconnectedCircuitRetentionPeriod = TimeSpan.FromSeconds(3), 433await Task.Run(() => tcs.Task.TimeoutAfter(TimeSpan.FromSeconds(10))); 444DisconnectedCircuitRetentionPeriod = TimeSpan.FromSeconds(8), 459await Task.Run(() => tcs.Task.TimeoutAfter(TimeSpan.FromSeconds(10))); 589Assert.True(BeforeConnect?.Wait(TimeSpan.FromSeconds(10)), "BeforeConnect failed to be set"); 599Assert.True(BeforeDisconnect?.Wait(TimeSpan.FromSeconds(10)), "BeforeDisconnect failed to be set"); 612Assert.True(BeforePause.Wait(TimeSpan.FromSeconds(10)), "BeforePauseTcs failed to be set");
Circuits\DefaultInMemoryCircuitPersistenceProviderTest.cs (2)
73PersistedCircuitInMemoryRetentionPeriod = TimeSpan.FromSeconds(2) 179UtcNow = new DateTimeOffset(2020, 1, 1, 0, 0, 0, TimeSpan.Zero);
Circuits\RemoteJSDataStreamTest.cs (6)
24var remoteJSDataStream = await RemoteJSDataStream.CreateRemoteJSDataStreamAsync(_jsRuntime, jsStreamReference, totalLength: 100, signalRMaximumIncomingBytes: 10_000, jsInteropDefaultCallTimeout: TimeSpan.FromMinutes(1), cancellationToken: CancellationToken.None).DefaultTimeout(); 162var remoteJSDataStream = await RemoteJSDataStream.CreateRemoteJSDataStreamAsync(jsRuntime, jsStreamReference, totalLength: 100, signalRMaximumIncomingBytes: 10_000, jsInteropDefaultCallTimeout: TimeSpan.FromMinutes(1), cancellationToken: CancellationToken.None); 182var remoteJSDataStream = await RemoteJSDataStream.CreateRemoteJSDataStreamAsync(jsRuntime, jsStreamReference, totalLength: 100, signalRMaximumIncomingBytes: 10_000, jsInteropDefaultCallTimeout: TimeSpan.FromMinutes(1), cancellationToken: CancellationToken.None); 218jsInteropDefaultCallTimeout: TimeSpan.FromSeconds(2), 259jsInteropDefaultCallTimeout: TimeSpan.FromSeconds(3), 348var remoteJSDataStream = await RemoteJSDataStream.CreateRemoteJSDataStreamAsync(jsRuntime ?? _jsRuntime, jsStreamReference, totalLength: 100, signalRMaximumIncomingBytes: 10_000, jsInteropDefaultCallTimeout: TimeSpan.FromMinutes(1), cancellationToken: CancellationToken.None);
Circuits\RemoteRendererTest.cs (2)
26private static readonly TimeSpan Timeout = Debugger.IsAttached ? System.Threading.Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(10);
Circuits\RevalidatingServerAuthenticationStateProviderTest.cs (12)
18using var provider = new TestRevalidatingServerAuthenticationStateProvider(TimeSpan.MaxValue); 36TimeSpan.FromMilliseconds(50)); 59TimeSpan.FromMilliseconds(50)); 83TimeSpan.FromMilliseconds(50)); 107TimeSpan.FromMilliseconds(50)); 132TimeSpan.FromMilliseconds(50)); 151TimeSpan.FromMilliseconds(50)); 189TimeSpan.FromMilliseconds(50)); 209await incrementExecuted.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 227private readonly TimeSpan _revalidationInterval; 231public TestRevalidatingServerAuthenticationStateProvider(TimeSpan revalidationInterval) 245protected override TimeSpan RevalidationInterval => _revalidationInterval;
Circuits\ServerComponentDeserializerTest.cs (2)
264TimeSpan.FromSeconds(30)); 281TimeSpan.FromSeconds(30));
DependencyInjection\ComponentServiceCollectionExtensionsTest.cs (7)
38options.HandshakeTimeout = TimeSpan.FromMinutes(10); 47Assert.Equal(TimeSpan.FromMinutes(10), options.Value.HandshakeTimeout); 57Assert.Equal(TimeSpan.FromMinutes(10), options.HandshakeTimeout); 58options.HandshakeTimeout = TimeSpan.FromMinutes(5); 64options.HandshakeTimeout = TimeSpan.FromMinutes(10); 74Assert.Equal(TimeSpan.FromMinutes(5), options.Value.HandshakeTimeout); 77Assert.Equal(TimeSpan.FromMinutes(10), globalOptions.Value.HandshakeTimeout);
Microsoft.AspNetCore.Components.Tests (15)
ComponentBaseTest.cs (2)
14private static readonly TimeSpan Timeout = Debugger.IsAttached ? System.Threading.Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(10);
NavigationManagerTest.cs (2)
17private static readonly TimeSpan Timeout = Debugger.IsAttached ? System.Threading.Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(10);
PersistentStateValueProviderKeyResolverTests.cs (2)
33{ new DateTimeOffset(2023, 1, 1, 0, 0, 0, TimeSpan.FromSeconds(0)), new DateTimeOffset(2023, 12, 31, 0, 0, 0, TimeSpan.FromSeconds(0)) },
RendererTest.cs (6)
22private static readonly TimeSpan Timeout = Debugger.IsAttached ? System.Threading.Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(10); 342await Assert.ThrowsAsync<TimeoutException>(() => renderTask1.WaitAsync(TimeSpan.FromMilliseconds(250))); 3900await taskCompletionSource.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 3956await taskCompletionSource.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 4141await taskCompletionSource.Task.TimeoutAfter(TimeSpan.FromSeconds(10));
Rendering\RendererSynchronizationContextTest.cs (2)
14public TimeSpan Timeout = Debugger.IsAttached ? System.Threading.Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(10);
Routing\QueryParameterValueSupplierTest.cs (1)
35AssertKeyValuePair<DateTime>("DateTimeVal", new DateTimeOffset(2020, 1, 2, 3, 4, 5, 678, TimeSpan.FromHours(-9)).LocalDateTime);
Microsoft.AspNetCore.Components.Web (2)
Forms\InputFile\RemoteBrowserFileStreamOptions.cs (2)
38public TimeSpan SegmentFetchTimeout { get; set; } = TimeSpan.FromMinutes(1);
Microsoft.AspNetCore.Components.WebAssembly.Server (6)
DebugProxyLauncher.cs (5)
17private static readonly TimeSpan DebugProxyLaunchTimeout = TimeSpan.FromSeconds(10); 19private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$", RegexOptions.None, TimeSpan.FromSeconds(10)); 20private static readonly Regex ApplicationStartedRegex = new Regex(@"^\s*Application started\. Press Ctrl\+C to shut down\.$", RegexOptions.None, TimeSpan.FromSeconds(10)); 21private static readonly Regex NowListeningFirefoxRegex = new Regex(@"^\s*Debug proxy for firefox now listening on tcp://(?<url>.*)\. And expecting firefox at port 6000\.$", RegexOptions.None, TimeSpan.FromSeconds(10));
TargetPickerUi.cs (1)
446using var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
Microsoft.AspNetCore.Components.WebAssembly.Tests (3)
Hosting\WebAssemblyHostTest.cs (3)
32await task.TimeoutAfter(TimeSpan.FromSeconds(3)); 53await task.TimeoutAfter(TimeSpan.FromSeconds(3)); 79await task.TimeoutAfter(TimeSpan.FromSeconds(3));
Microsoft.AspNetCore.Components.WebViewE2E.Test (1)
WebViewManagerE2ETests.cs (1)
43await photinoProcess.WaitForExitAsync().TimeoutAfter(TimeSpan.FromSeconds(30));
Microsoft.AspNetCore.ConcurrencyLimiter (2)
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
ConcurrencyLimiterEventSourceTests.cs (2)
57using var timeoutTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); 98using var timeoutTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(5));
Microsoft.AspNetCore.CookiePolicy (1)
CookiePolicyOptions.cs (1)
48Expiration = TimeSpan.FromDays(365),
Microsoft.AspNetCore.CookiePolicy.Test (2)
CookieChunkingTests.cs (1)
36MaxAge = TimeSpan.FromMinutes(5)
CookieConsentTests.cs (1)
223Assert.True(consentCookie.Expires.Value > DateTimeOffset.Now + TimeSpan.FromDays(364));
Microsoft.AspNetCore.Cors (10)
Infrastructure\CorsPolicy.cs (4)
16private TimeSpan? _preflightMaxAge; 116/// Gets or sets the <see cref="TimeSpan"/> for which the results of a preflight request can be cached. 118public TimeSpan? PreflightMaxAge 126if (value < TimeSpan.Zero)
Infrastructure\CorsPolicyBuilder.cs (2)
192/// <param name="preflightMaxAge">A positive <see cref="TimeSpan"/> indicating the time a preflight 195public CorsPolicyBuilder SetPreflightMaxAge(TimeSpan preflightMaxAge)
Infrastructure\CorsResult.cs (4)
14private TimeSpan? _preflightMaxAge; 58/// Gets or sets the <see cref="TimeSpan"/> for which the results of a preflight request can be cached. 60public TimeSpan? PreflightMaxAge 68if (value < TimeSpan.Zero)
Microsoft.AspNetCore.Cors.Test (13)
CorsMiddlewareTests.cs (1)
649.ReturnsAsync(policy, TimeSpan.FromMilliseconds(10));
CorsPolicyBuilderTests.cs (4)
19originalPolicy.PreflightMaxAge = TimeSpan.FromSeconds(12); 40Assert.Equal(TimeSpan.FromSeconds(12), corsPolicy.PreflightMaxAge); 298builder.SetPreflightMaxAge(TimeSpan.FromSeconds(12)); 302Assert.Equal(TimeSpan.FromSeconds(12), corsPolicy.PreflightMaxAge);
CorsPolicyTests.cs (2)
50policy.PreflightMaxAge = TimeSpan.FromSeconds(-12); 65PreflightMaxAge = TimeSpan.FromSeconds(12),
CorsResultTests.cs (2)
32result.PreflightMaxAge = TimeSpan.FromSeconds(-1); 48PreflightMaxAge = TimeSpan.FromSeconds(30),
CorsServiceTests.cs (4)
421PreflightMaxAge = TimeSpan.FromSeconds(10) 430Assert.Equal(TimeSpan.FromSeconds(10), result.PreflightMaxAge); 869PreflightMaxAge = TimeSpan.FromSeconds(30), 890PreflightMaxAge = TimeSpan.FromSeconds(30),
Microsoft.AspNetCore.DataProtection (28)
DataProtectionBuilderExtensions.cs (2)
401public static IDataProtectionBuilder SetDefaultKeyLifetime(this IDataProtectionBuilder builder, TimeSpan lifetime) 405if (lifetime < TimeSpan.Zero)
Internal\KeyManagementOptionsSetup.cs (1)
52options.NewKeyLifetime = TimeSpan.FromDays(context.DefaultKeyLifetime.Value);
KeyManagement\DefaultKeyResolver.cs (3)
38private readonly TimeSpan _keyPropagationWindow; 41private readonly TimeSpan _decryptRetryDelay; 54private readonly TimeSpan _maxServerToServerClockSkew;
KeyManagement\Internal\CacheableKeyRing.cs (2)
48var extension = TimeSpan.FromMinutes(2);
KeyManagement\KeyManagementOptions.cs (16)
18private static readonly TimeSpan _keyPropagationWindow = TimeSpan.FromDays(2); 19private static readonly TimeSpan _keyRingRefreshPeriod = TimeSpan.FromHours(24); 20private static readonly TimeSpan _maxServerClockSkew = TimeSpan.FromMinutes(5); 21private TimeSpan _newKeyLifetime = TimeSpan.FromDays(90); 51internal static TimeSpan KeyPropagationWindow 69internal static TimeSpan KeyRingRefreshPeriod 83/// the allowed clock skew window. This value can be set to <see cref="TimeSpan.Zero"/> 89internal static TimeSpan MaxServerClockSkew 114internal TimeSpan DefaultKeyResolverRetryDelay { get; set; } = TimeSpan.FromMilliseconds(200); 124public TimeSpan NewKeyLifetime 132if (value < TimeSpan.FromDays(7))
KeyManagement\KeyRingProvider.cs (4)
27private readonly TimeSpan _newKeyLifetime; 483private TimeSpan GetRefreshPeriodWithJitter(TimeSpan refreshPeriod) 488return TimeSpan.FromTicks((long)(refreshPeriod.Ticks * (1.0d - (JitterRandom.NextDouble() / 5))));
Microsoft.AspNetCore.DataProtection.Extensions (3)
DataProtectionAdvancedExtensions.cs (2)
23public static byte[] Protect(this ITimeLimitedDataProtector protector, byte[] plaintext, TimeSpan lifetime) 56public static string Protect(this ITimeLimitedDataProtector protector, string plaintext, TimeSpan lifetime)
TimeLimitedDataProtector.cs (1)
82DateTimeOffset embeddedExpiration = new DateTimeOffset(checked((long)utcTicksExpiration), TimeSpan.Zero /* UTC */);
Microsoft.AspNetCore.DataProtection.Extensions.Tests (2)
DataProtectionAdvancedExtensionsTests.cs (2)
48string protectedPayload = mockDataProtector.Object.Protect("this is plaintext", TimeSpan.FromHours(48)); 71byte[] protectedPayload = mockDataProtector.Object.Protect(new byte[] { 0x11, 0x22, 0x33 }, TimeSpan.FromHours(48));
Microsoft.AspNetCore.DataProtection.Tests (55)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializerTests.cs (2)
50DateTimeOffset.Now + TimeSpan.FromHours(1), 51DateTimeOffset.Now + TimeSpan.FromDays(30),
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorTests.cs (2)
205DateTimeOffset.Now + TimeSpan.FromHours(1), 206DateTimeOffset.Now + TimeSpan.FromDays(30),
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorDeserializerTests.cs (2)
57DateTimeOffset.Now + TimeSpan.FromHours(1), 58DateTimeOffset.Now + TimeSpan.FromDays(30),
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorDescriptorDeserializerTests.cs (2)
54activationDate: DateTimeOffset.Now + TimeSpan.FromHours(1), 55expirationDate: DateTimeOffset.Now + TimeSpan.FromDays(30),
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptorDeserializerTests.cs (2)
155DateTimeOffset.Now + TimeSpan.FromHours(1), 156DateTimeOffset.Now + TimeSpan.FromDays(30),
HostingTests.cs (2)
46await tcs.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 73await tcs.Task.TimeoutAfter(TimeSpan.FromSeconds(10));
Internal\KeyManagementOptionsSetupTest.cs (1)
66Assert.Equal(TimeSpan.FromDays(1024), options.NewKeyLifetime);
KeyManagement\DefaultKeyResolverTests.cs (6)
258var creation1 = now - TimeSpan.FromHours(1); 259var creation2 = creation1 - TimeSpan.FromHours(1); 262var expiration1 = creation1 + TimeSpan.FromDays(90); 263var expiration2 = creation2 + TimeSpan.FromDays(90); 321DefaultKeyResolverRetryDelay = TimeSpan.Zero, 398DefaultKeyResolverRetryDelay = TimeSpan.Zero,
KeyManagement\KeyRingProviderTests.cs (26)
118Tuple.Create((DateTimeOffset)now, (DateTimeOffset)now + TimeSpan.FromDays(90), CreateKey()) 166Tuple.Create(now, now + TimeSpan.FromDays(90), newKey) 207Tuple.Create((DateTimeOffset)now, (DateTimeOffset)now + TimeSpan.FromDays(90), newlyCreatedKey) 251Tuple.Create((DateTimeOffset)now, (DateTimeOffset)now + TimeSpan.FromDays(90), CreateKey()) 291Tuple.Create(key1.ExpirationDate, (DateTimeOffset)now + TimeSpan.FromDays(90), CreateKey()) 432DateTimeOffset activation1 = now - TimeSpan.FromHours(1); 433DateTimeOffset activation2 = now + TimeSpan.FromHours(1); 435DateTimeOffset expiration1 = now + TimeSpan.FromHours(hoursToExpiration1); 436DateTimeOffset expiration2 = now + TimeSpan.FromHours(hoursToExpiration2); 449var generatedKey = CreateKey(expiration1, now + TimeSpan.FromDays(90)); 504Tuple.Create(expiration1, now + TimeSpan.FromDays(90), CreateKey()) 525DateTimeOffset activation = now - TimeSpan.FromDays(30); 526DateTimeOffset expiration = now + TimeSpan.FromDays(30); 529var generatedKey = CreateKey(expiration, now + TimeSpan.FromDays(90)); 539Tuple.Create(expiration, now + TimeSpan.FromDays(90), generatedKey) 590var retVal2 = keyRingProvider.GetCurrentKeyRingCore(now + TimeSpan.FromHours(1)); 613.Setup(o => o.GetCacheableKeyRing(now + TimeSpan.FromMinutes(1))) 619.Setup(o => o.GetCacheableKeyRing(now + TimeSpan.FromMinutes(2))) 629var retVal2 = keyRingProvider.GetCurrentKeyRingCore(now + TimeSpan.FromMinutes(1)); 630var retVal3 = keyRingProvider.GetCurrentKeyRingCore(now + TimeSpan.FromMinutes(2), forceRefresh: true); 654.Setup(o => o.GetCacheableKeyRing(now + TimeSpan.FromHours(1))) 664var retVal2 = keyRingProvider.GetCurrentKeyRingCore(now + TimeSpan.FromHours(1), forceRefresh: true); 686TimeSpan testTimeout = TimeSpan.FromSeconds(10); 912Assert.InRange(actual, now + TimeSpan.FromHours(24 * 0.8), now + TimeSpan.FromHours(24));
KeyManagement\KeyRingTests.cs (2)
102ActivationDate = CreationDate + TimeSpan.FromHours(1); 103ExpirationDate = CreationDate + TimeSpan.FromDays(30);
KeyManagement\XmlKeyManagerTests.cs (8)
78var creationDate = new DateTimeOffset(2014, 01, 01, 0, 0, 0, TimeSpan.Zero); 79var activationDate = new DateTimeOffset(2014, 02, 01, 0, 0, 0, TimeSpan.Zero); 80var expirationDate = new DateTimeOffset(2014, 03, 01, 0, 0, 0, TimeSpan.Zero); 165var creationDate = new DateTimeOffset(2014, 01, 01, 0, 0, 0, TimeSpan.Zero); 166var activationDate = new DateTimeOffset(2014, 02, 01, 0, 0, 0, TimeSpan.Zero); 167var expirationDate = new DateTimeOffset(2014, 03, 01, 0, 0, 0, TimeSpan.Zero); 295DateTimeOffset activationDate = minCreationDate + TimeSpan.FromDays(7); 685var revocationDate = new DateTimeOffset(2014, 01, 01, 0, 0, 0, TimeSpan.Zero);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (2)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
276TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
Microsoft.AspNetCore.Diagnostics.Middleware (3)
Latency\RequestLatencyTelemetryMiddleware.cs (1)
30private readonly TimeSpan _exportTimeout;
Latency\RequestLatencyTelemetryOptions.cs (2)
21public TimeSpan LatencyDataExportTimeout { get; set; } = TimeSpan.FromSeconds(5);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (24)
Latency\RequestLatencyTelemetryExtensionsTests.cs (1)
54LatencyDataExportTimeout = TimeSpan.FromSeconds(2)
Latency\RequestLatencyTelemetryMiddlewareTests.cs (5)
163var exportTimeout = TimeSpan.FromSeconds(1); 164var ex1 = new TimeConsumingExporter(TimeSpan.FromSeconds(5)); 253private readonly TimeSpan _timeSpanToDelay; 255public TimeConsumingExporter(TimeSpan timeSpanToDelay)
Latency\RequestLatencyTelemetryOptionsValidatorTests.cs (2)
15var options = new RequestLatencyTelemetryOptions { LatencyDataExportTimeout = TimeSpan.FromSeconds(0) }; 24var options = new RequestLatencyTelemetryOptions { LatencyDataExportTimeout = TimeSpan.FromSeconds(1) };
Logging\AcceptanceTests.cs (9)
45private static readonly TimeSpan _defaultLogTimeout = TimeSpan.FromSeconds(5); 122fakeTimeProvider.Advance(TimeSpan.FromMilliseconds(ErrorRouteProcessingTimeMs)); 129fakeTimeProvider.Advance(TimeSpan.FromMilliseconds(SlashRouteProcessingTimeMs)); 179private static async Task WaitForLogRecordsAsync(FakeLogCollector logCollector, TimeSpan timeout, int expectedRecords = 1) 181var totalTimeWaiting = TimeSpan.Zero; 182var spinTime = TimeSpan.FromMilliseconds(50);
Logging\AcceptanceTests.Mvc.cs (5)
68await WaitForLogRecordsAsync(logCollector, TimeSpan.FromSeconds(30)); 103await WaitForLogRecordsAsync(logCollector, TimeSpan.FromSeconds(30)); 149await WaitForLogRecordsAsync(logCollector, TimeSpan.FromSeconds(30)); 193await WaitForLogRecordsAsync(logCollector, TimeSpan.FromSeconds(30)); 234await WaitForLogRecordsAsync(logCollector, TimeSpan.FromSeconds(30));
Logging\AcceptanceTests.Routing.cs (1)
68await WaitForLogRecordsAsync(logCollector, TimeSpan.FromSeconds(30));
Logging\ApiRoutingController.cs (1)
32fakeTimeProvider.Advance(TimeSpan.FromMilliseconds(AcceptanceTests.ControllerProcessingTimeMs));
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (6)
ConverterTests\JsonConverterWriteTests.cs (4)
305TimestampValue = Timestamp.FromDateTimeOffset(new DateTimeOffset(2020, 12, 1, 12, 30, 0, TimeSpan.FromHours(12))) 314var ts = Timestamp.FromDateTimeOffset(new DateTimeOffset(2020, 12, 1, 12, 30, 0, TimeSpan.FromHours(12))); 324DurationValue = Duration.FromTimeSpan(TimeSpan.FromHours(12)) 333var duration = Duration.FromTimeSpan(TimeSpan.FromHours(12));
UnaryServerCallHandlerTests.cs (2)
1754var timestamp = Timestamp.FromDateTimeOffset(new DateTimeOffset(2023, 2, 14, 17, 32, 0, TimeSpan.FromHours(8))); 1755var duration = Duration.FromTimeSpan(TimeSpan.FromHours(1));
Microsoft.AspNetCore.HeaderParsing.Tests (1)
ParserTests.cs (1)
122Assert.Equal(TimeSpan.FromSeconds(604800), result.MaxAge);
Microsoft.AspNetCore.Hosting (10)
Internal\HostingApplicationDiagnostics.cs (2)
290var elapsed = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp); 540if (activity.Duration == TimeSpan.Zero)
Internal\HostingEventSource.cs (1)
97DisplayRateTimeScale = TimeSpan.FromSeconds(1)
Internal\HostingMetrics.cs (1)
91var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp);
Internal\HostingRequestFinishedLog.cs (2)
20public TimeSpan Elapsed { get; } 52public HostingRequestFinishedLog(HostingApplication.Context context, TimeSpan elapsed)
Internal\WebHostOptions.cs (3)
40ShutdownTimeout = TimeSpan.FromSeconds(seconds); 66public TimeSpan ShutdownTimeout { get; } = TimeSpan.FromSeconds(30);
WebHostExtensions.cs (1)
25public static async Task StopAsync(this IWebHost host, TimeSpan timeout)
Microsoft.AspNetCore.Hosting.Abstractions (1)
HostingAbstractionsWebHostBuilderExtensions.cs (1)
161public static IWebHostBuilder UseShutdownTimeout(this IWebHostBuilder hostBuilder, TimeSpan timeout)
Microsoft.AspNetCore.Hosting.FunctionalTests (4)
LinkedApplicationTests.cs (1)
35PublishTimeout = TimeSpan.FromMinutes(10), // Machines are slow (these tests restore)
ShutdownTests.cs (2)
93await startedTcs.Task.TimeoutAfter(TimeSpan.FromMinutes(1)); 106await completedTcs.Task.TimeoutAfter(TimeSpan.FromMinutes(1));
WebHostBuilderTests.cs (1)
55await tcs.Task.TimeoutAfter(TimeSpan.FromMinutes(1));
Microsoft.AspNetCore.Hosting.Tests (10)
HostingApplicationDiagnosticsTests.cs (4)
38var timeout = !Debugger.IsAttached ? TimeSpan.FromSeconds(30) : Timeout.InfiniteTimeSpan; 709Assert.True(Activity.Current.Duration > TimeSpan.Zero); 733Assert.True(Activity.Current.Duration > TimeSpan.Zero);
Internal\HostingEventSourceTests.cs (1)
192using var timeoutTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));
WebHostBuilderTests.cs (2)
1279.UseShutdownTimeout(TimeSpan.FromSeconds(102)) 1286Assert.Equal(TimeSpan.FromSeconds(102), options.ShutdownTimeout);
WebHostTests.cs (3)
230Assert.Equal(task, await Task.WhenAny(task, Task.Delay(TimeSpan.FromSeconds(10)))); 266Assert.Equal(task, await Task.WhenAny(task, Task.Delay(TimeSpan.FromSeconds(10)))); 305Assert.Equal(task, await Task.WhenAny(task, Task.Delay(TimeSpan.FromSeconds(8))));
Microsoft.AspNetCore.Hosting.WindowsServices.Tests (2)
WebHostServiceTests.cs (2)
17private static readonly TimeSpan OperationTimeout = TimeSpan.FromSeconds(5);
Microsoft.AspNetCore.Http (8)
Timeouts\CancellationTokenLinker.cs (1)
12public (CancellationTokenSource linkedCts, CancellationTokenSource timeoutCts) GetLinkedCancellationTokenSource(HttpContext httpContext, CancellationToken originalToken, TimeSpan timeSpan)
Timeouts\ICancellationTokenLinker.cs (1)
8(CancellationTokenSource linkedCts, CancellationTokenSource timeoutCts) GetLinkedCancellationTokenSource(HttpContext httpContext, CancellationToken originalToken, TimeSpan timeSpan);
Timeouts\RequestTimeoutAttribute.cs (2)
18public TimeSpan? Timeout { get; } 32Timeout = TimeSpan.FromMilliseconds(milliseconds);
Timeouts\RequestTimeoutOptions.cs (1)
27public RequestTimeoutOptions AddPolicy(string policyName, TimeSpan timeout)
Timeouts\RequestTimeoutPolicy.cs (1)
14public TimeSpan? Timeout { get; init; }
Timeouts\RequestTimeoutsIEndpointConventionBuilderExtensions.cs (1)
21public static IEndpointConventionBuilder WithRequestTimeout(this IEndpointConventionBuilder builder, TimeSpan timeout)
Timeouts\RequestTimeoutsMiddleware.cs (1)
54TimeSpan? timeSpan = null;
Microsoft.AspNetCore.Http.Abstractions (2)
CookieBuilder.cs (2)
70public virtual TimeSpan? Expiration { get; set; } 75public virtual TimeSpan? MaxAge { get; set; }
Microsoft.AspNetCore.Http.Abstractions.Tests (3)
CookieBuilderTests.cs (3)
34var options = new CookieBuilder { Expiration = TimeSpan.FromHours(1) }.Build(new DefaultHttpContext(), now); 43var now = TimeSpan.FromHours(1);
Microsoft.AspNetCore.Http.Connections (30)
ConnectionOptions.cs (1)
14public TimeSpan? DisconnectTimeout { get; set; }
ConnectionOptionsSetup.cs (2)
17public static TimeSpan DefaultDisconectTimeout = TimeSpan.FromSeconds(15);
HttpConnectionDispatcherOptions.cs (4)
22private TimeSpan _transportSendTimeout; 37TransportSendTimeout = TimeSpan.FromSeconds(10); 107public TimeSpan TransportSendTimeout 112ArgumentOutOfRangeException.ThrowIfEqual(value, TimeSpan.Zero);
Internal\HttpConnectionContext.cs (9)
53private TimeSpan _startedSendTime; 77LastSeenTicks = TimeSpan.FromMilliseconds(Environment.TickCount64); 143public TimeSpan LastSeenTicks { get; set; } 145public TimeSpan? LastSeenTicksIfInactive 442TimeSpan pollTimeout, 621LastSeenTicks = TimeSpan.FromMilliseconds(Environment.TickCount64); 653_startedSendTime = TimeSpan.FromMilliseconds(Environment.TickCount64); 658internal void TryCancelSend(TimeSpan currentTicks) 791public static partial void TransportSendTimeout(ILogger logger, TimeSpan timeout, string transportConnectionId);
Internal\HttpConnectionManager.cs (6)
20private static readonly TimeSpan _heartbeatTickRate = TimeSpan.FromSeconds(1); 27private readonly TimeSpan _disconnectTimeout; 144var ticks = TimeSpan.FromMilliseconds(Environment.TickCount64); 200Task.WaitAll(tasks.ToArray(), TimeSpan.FromSeconds(5));
Internal\HttpConnectionsEventSource.cs (1)
45var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp);
Internal\HttpConnectionsMetrics.cs (1)
49var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp);
LongPollingOptions.cs (2)
14public TimeSpan PollTimeout { get; set; } = TimeSpan.FromSeconds(90);
src\Shared\NonCapturingTimer\NonCapturingTimer.cs (2)
16public static Timer Create(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
WebSocketOptions.cs (2)
15public TimeSpan CloseTimeout { get; set; } = TimeSpan.FromSeconds(5);
Microsoft.AspNetCore.Http.Connections.Client (5)
HttpConnection.cs (2)
36private static readonly TimeSpan HttpClientTimeout = TimeSpan.FromSeconds(120);
HttpConnectionOptions.cs (2)
191public TimeSpan CloseTimeout { get; set; } = TimeSpan.FromSeconds(5);
Internal\WebSocketsTransport.cs (1)
36private readonly TimeSpan _closeTimeout;
Microsoft.AspNetCore.Http.Connections.Tests (38)
HttpConnectionDispatcherTests.cs (30)
511var disconnectTimeout = TimeSpan.FromSeconds(5); 558connection.LastSeenTicks = TimeSpan.FromMilliseconds(Environment.TickCount64) - disconnectTimeout - TimeSpan.FromTicks(1); 1198options.LongPolling.PollTimeout = TimeSpan.FromSeconds(2); 1280var initialTime = TimeSpan.FromMilliseconds(Environment.TickCount64); 1305connection.TryCancelSend(TimeSpan.FromMilliseconds(Environment.TickCount64) + options.TransportSendTimeout + TimeSpan.FromTicks(1)); 1321var initialTime = TimeSpan.FromMilliseconds(Environment.TickCount64); 1344connection.TryCancelSend(TimeSpan.FromMilliseconds(Environment.TickCount64) + options.TransportSendTimeout + TimeSpan.FromTicks(1)); 1365var initialTime = TimeSpan.FromMilliseconds(Environment.TickCount64); 1378options.WebSockets.CloseTimeout = TimeSpan.FromSeconds(0); 1388connection.TryCancelSend(TimeSpan.FromMilliseconds(Environment.TickCount64) + options.TransportSendTimeout + TimeSpan.FromTicks(1)); 1419options.WebSockets.CloseTimeout = TimeSpan.FromSeconds(1); 1812options.WebSockets.CloseTimeout = TimeSpan.FromSeconds(0); 1951options.WebSockets.CloseTimeout = TimeSpan.FromSeconds(0); 1995options.LongPolling.PollTimeout = TimeSpan.FromMilliseconds(1); // We don't care about the poll itself 2121options.LongPolling.PollTimeout = TimeSpan.FromMilliseconds(1); 2377options.WebSockets.CloseTimeout = TimeSpan.FromMilliseconds(1); 2452options.WebSockets.CloseTimeout = TimeSpan.FromMilliseconds(1); 2857options.WebSockets.CloseTimeout = TimeSpan.FromSeconds(1); 2887options.WebSockets.CloseTimeout = TimeSpan.FromSeconds(1); 3144var manager = CreateConnectionManager(LoggerFactory, TimeSpan.FromSeconds(5)); 3572var manager = CreateConnectionManager(LoggerFactory, TimeSpan.FromSeconds(5)); 3774private static HttpConnectionManager CreateConnectionManager(ILoggerFactory loggerFactory, TimeSpan? disconnectTimeout, HttpConnectionsMetrics metrics = null)
HttpConnectionManagerTests.cs (1)
27Assert.Equal(TimeSpan.FromSeconds(10), options.TransportSendTimeout);
LongPollingTests.cs (1)
117Assert.Equal(options.LongPolling.PollTimeout, TimeSpan.FromSeconds(90));
WebSocketsTests.cs (6)
212CloseTimeout = TimeSpan.FromSeconds(1) 224await transport.DefaultTimeout(TimeSpan.FromSeconds(10)); 246CloseTimeout = TimeSpan.FromSeconds(1) 281CloseTimeout = TimeSpan.FromSeconds(20) 320CloseTimeout = TimeSpan.FromSeconds(20) 362CloseTimeout = TimeSpan.FromSeconds(20),
Microsoft.AspNetCore.Http.Extensions (6)
src\Components\Endpoints\src\FormMapping\WellKnownConverters.cs (6)
43{ typeof(TimeSpan), new ParsableConverter<TimeSpan>() }, 75converters.Add(typeof(TimeSpan?), new NullableConverter<TimeSpan>((FormDataConverter<TimeSpan>)converters[typeof(TimeSpan)]));
Microsoft.AspNetCore.Http.Extensions.Tests (10)
HeaderDictionaryTypeExtensionsTest.cs (2)
51var expected = new CacheControlHeaderValue() { MaxAge = TimeSpan.FromSeconds(604800) }; 107var expected = new DateTimeOffset(2023, 12, 04, 7, 28, 00, TimeSpan.Zero);
ParameterBindingMethodCacheTests.cs (2)
66[InlineData(typeof(TimeSpan))] 77if (@type == typeof(TimeSpan))
RequestDelegateFactoryTests.cs (4)
328new object[] { (Action<HttpContext, TimeSpan[]>)Store, new[] { "00:00:42" },new[] { TimeSpan.FromSeconds(42) } }, 379new object[] { (Action<HttpContext, TimeSpan>)Store, "00:00:42", TimeSpan.FromSeconds(42) },
RequestDelegateGenerator\RequestDelegateCreationTests.Arrays.cs (1)
135new object[] { "TimeSpan[]", new[] { "00:00:42" },new[] { TimeSpan.FromSeconds(42) } },
RequestDelegateGenerator\RequestDelegateCreationTests.TryParse.cs (1)
44new object[] { "TimeSpan", "00:00:42", TimeSpan.FromSeconds(42) },
Microsoft.AspNetCore.Http.Features (8)
CookieOptions.cs (1)
92public TimeSpan? MaxAge { get; set; }
WebSocketAcceptContext.cs (7)
14private TimeSpan? _keepAliveTimeout; 27public virtual TimeSpan? KeepAliveInterval { get; set; } 34/// <see cref="Timeout.InfiniteTimeSpan"/> and <see cref="TimeSpan.Zero"/> are valid values and will disable the timeout. 37/// <see cref="TimeSpan"/> is less than <see cref="TimeSpan.Zero"/>. 39public TimeSpan? KeepAliveTimeout 46ArgumentOutOfRangeException.ThrowIfLessThan(value.Value, TimeSpan.Zero);
Microsoft.AspNetCore.Http.Microbenchmarks (4)
RequestTimeoutsMiddlewareBenchmark.cs (4)
34Timeout = TimeSpan.FromMilliseconds(200) 38["policy1"] = new RequestTimeoutPolicy { Timeout = TimeSpan.FromMilliseconds(200)} 45await Task.Delay(TimeSpan.FromMicroseconds(2)); 54Timeout = TimeSpan.FromMicroseconds(1)
Microsoft.AspNetCore.Http.Results (2)
src\Shared\ResultsHelpers\FileResultHelper.cs (2)
392var ticksToRemove = dateTimeOffset.Ticks % TimeSpan.TicksPerSecond; 393return dateTimeOffset.Subtract(TimeSpan.FromTicks(ticksToRemove));
Microsoft.AspNetCore.Http.Results.Tests (14)
PhysicalFileResultTest.cs (1)
31LastWriteTimeUtc = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0))
ResultsTests.cs (5)
285new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 287new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 333new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 335new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 337new object[] { 2, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any },
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
514lastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0));
TypedResultsTests.cs (7)
263new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 265new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 309new object[] { "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 311new object[] { "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 417new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 419new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 421new object[] { 2, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any },
Microsoft.AspNetCore.Http.Tests (24)
CookieOptionsTests.cs (1)
25MaxAge = TimeSpan.FromSeconds(10),
ResponseCookiesTest.cs (4)
182var time = new DateTimeOffset(2000, 1, 1, 1, 1, 1, 1, TimeSpan.Zero); 232var maxAgeTime = TimeSpan.FromHours(1); 233cookieOptions.MaxAge = TimeSpan.FromHours(1);
Timeouts\RequestTimeoutOptionsTests.cs (9)
14options.AddPolicy("policy1", TimeSpan.FromSeconds(47)); 17Assert.Equal(TimeSpan.FromSeconds(47), policy.Timeout); 26Timeout = TimeSpan.FromSeconds(47) 32Assert.Equal(TimeSpan.FromSeconds(47), policy.Timeout); 39options.AddPolicy("policy1", TimeSpan.FromSeconds(1)); 41options.AddPolicy("policy1", TimeSpan.FromSeconds(47)); 42Assert.Equal(TimeSpan.FromSeconds(47), options.Policies["policy1"].Timeout); 49Assert.Throws<ArgumentException>(() => options.AddPolicy("", TimeSpan.FromSeconds(47))); 50Assert.Throws<ArgumentNullException>(() => options.AddPolicy(null, TimeSpan.FromSeconds(47)));
Timeouts\RequestTimeoutsMiddlewareTests.cs (10)
49var endpoint = CreateEndpoint(new RequestTimeoutPolicy { Timeout = TimeSpan.FromSeconds(47) }); 144var endpoint = CreateEndpoint(new RequestTimeoutPolicy { Timeout = TimeSpan.FromSeconds(47) }, new RequestTimeoutAttribute("policy1")); 164new RequestTimeoutPolicy { Timeout = TimeSpan.FromSeconds(47) }, 284var ctsLinker = new MockCancellationTokenSourceProvider(expectedTimeSpan.HasValue ? TimeSpan.FromSeconds(expectedTimeSpan.Value) : null, cancelledCts); 289Timeout = TimeSpan.FromSeconds(defaultTimeout.Value), 300Timeout = TimeSpan.FromSeconds(1), 310Timeout = TimeSpan.FromSeconds(2), 348private readonly TimeSpan? _expectedTimeSpan; 356public MockCancellationTokenSourceProvider(TimeSpan? expectedTimeSpan, bool cancelledCts) 362public (CancellationTokenSource linkedCts, CancellationTokenSource timeoutCts) GetLinkedCancellationTokenSource(HttpContext httpContext, CancellationToken originalToken, TimeSpan timeSpan)
Microsoft.AspNetCore.HttpLogging (7)
FileLoggerProcessor.cs (1)
22private TimeSpan _flushInterval;
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
W3CLoggerOptions.cs (4)
17private TimeSpan _flushInterval = TimeSpan.FromSeconds(1); 92public TimeSpan FlushInterval 97if (value <= TimeSpan.Zero)
Microsoft.AspNetCore.HttpLogging.Tests (1)
W3CLoggerOptionsTests.cs (1)
43var ex = Assert.Throws<ArgumentOutOfRangeException>(() => options.FlushInterval = TimeSpan.FromSeconds(-1));
Microsoft.AspNetCore.HttpsPolicy (2)
HstsOptions.cs (2)
18public TimeSpan MaxAge { get; set; } = TimeSpan.FromDays(30);
Microsoft.AspNetCore.HttpsPolicy.Tests (3)
HstsMiddlewareTests.cs (2)
94options.MaxAge = TimeSpan.FromSeconds(maxAge); 140options.MaxAge = TimeSpan.FromSeconds(maxAge);
HttpsPolicyTests.cs (1)
43options.MaxAge = TimeSpan.FromSeconds(maxAge);
Microsoft.AspNetCore.Identity (19)
DataProtectionTokenProviderOptions.cs (2)
25public TimeSpan TokenLifespan { get; set; } = TimeSpan.FromDays(1);
DataProtectorTokenProvider.cs (1)
207=> new DateTimeOffset(reader.ReadInt64(), TimeSpan.Zero);
IdentityCookiesBuilderExtensions.cs (2)
70o.ExpireTimeSpan = TimeSpan.FromMinutes(5); 107o.ExpireTimeSpan = TimeSpan.FromMinutes(5);
IdentityPasskeyOptions.cs (2)
27public TimeSpan AuthenticatorTimeout { get; set; } = TimeSpan.FromMinutes(5);
IdentityServiceCollectionExtensions.cs (2)
70o.ExpireTimeSpan = TimeSpan.FromMinutes(5); 87o.ExpireTimeSpan = TimeSpan.FromMinutes(5);
SecurityStampValidator.cs (1)
145var timeElapsed = currentUtc.Subtract(issuedUtc.Value);
SecurityStampValidatorOptions.cs (4)
12/// Gets or sets the <see cref="TimeSpan"/> after which security stamps are re-validated. Defaults to 30 minutes. 15/// The <see cref="TimeSpan"/> after which security stamps are re-validated. 17public TimeSpan ValidationInterval { get; set; } = TimeSpan.FromMinutes(30);
SignInManagerMetrics.cs (1)
100var duration = ValueStopwatch.GetElapsedTime(startTimestamp, Stopwatch.GetTimestamp());
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
TimeProviderClock.cs (2)
29var utcNowPrecisionSeconds = new DateTime((_timeProvider.GetUtcNow().Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond, DateTimeKind.Utc);
Microsoft.AspNetCore.Identity.FunctionalTests (11)
MapIdentityApiTests.cs (8)
164var expireTimeSpan = TimeSpan.FromSeconds(42); 193clock.Advance(TimeSpan.FromSeconds(expireTimeSpan.TotalSeconds - 1)); 198clock.Advance(TimeSpan.FromSeconds(1)); 324var expireTimeSpan = TimeSpan.FromHours(42); 350clock.Advance(TimeSpan.FromSeconds(expireTimeSpan.TotalSeconds - 1)); 360clock.Advance(TimeSpan.FromSeconds(1));
src\Identity\Extensions.Core\src\Rfc6238AuthenticationService.cs (3)
17private static readonly TimeSpan _timestep = TimeSpan.FromMinutes(3); 84var delta = DateTimeOffset.UtcNow - DateTimeOffset.UnixEpoch;
Microsoft.AspNetCore.Identity.InMemory.Test (10)
FunctionalTest.cs (10)
77options.ExpireTimeSpan = TimeSpan.FromMinutes(10); 99timeProvider.Advance(TimeSpan.FromMinutes(7)); 105timeProvider.Advance(TimeSpan.FromMinutes(7)); 146timeProvider.Advance(TimeSpan.FromMinutes(10)); 152timeProvider.Advance(TimeSpan.FromMinutes(21)); 198timeProvider.Advance(TimeSpan.FromMinutes(10)); 204timeProvider.Advance(TimeSpan.FromMinutes(21)); 239timeProvider.Advance(TimeSpan.FromMinutes(30)); 275timeProvider.Advance(TimeSpan.FromMinutes(30) + TimeSpan.FromMilliseconds(1));
Microsoft.AspNetCore.Identity.Specification.Tests (4)
UserManagerSpecificationTests.cs (4)
1152mgr.Options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromHours(1); 1174mgr.Options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromHours(1); 1199mgr.Options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromHours(1); 1227mgr.Options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromHours(1);
Microsoft.AspNetCore.Identity.Test (14)
IdentityOptionsTest.cs (1)
18Assert.Equal(TimeSpan.FromMinutes(5), options.Lockout.DefaultLockoutTimeSpan);
IdentityPasskeyOptionsTest.cs (1)
13Assert.Equal(TimeSpan.FromMinutes(5), options.AuthenticatorTimeout);
IdentityUIScriptsTest.cs (1)
23_httpClient = new HttpClient(new RetryHandler(new HttpClientHandler() { }, output, TimeSpan.FromSeconds(1), 5));
RetryHandler.cs (2)
13private TimeSpan _waitIntervalBeforeRetry; 18TimeSpan initialWaitTime,
SecurityStampValidatorTest.cs (9)
102options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.Zero }); 165options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.Zero }); 206options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.Zero }); 245options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.FromDays(1) }); 282options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.FromMinutes(1), TimeProvider = timeProvider }); 301IssuedUtc = timeProvider.GetUtcNow() - TimeSpan.FromDays(1), 302ExpiresUtc = timeProvider.GetUtcNow() + TimeSpan.FromDays(1), 316Assert.Equal(now + TimeSpan.FromDays(1), context.Properties.ExpiresUtc); 330options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.Zero });
Microsoft.AspNetCore.InternalTesting (14)
AssemblyTestLog.cs (1)
291flushToDiskInterval: TimeSpan.FromSeconds(1),
src\Shared\TaskExtensions.cs (13)
32public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 36return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 39public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 46return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 49public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 56return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 59public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 66return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 69public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 75public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 109public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 143private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Microsoft.AspNetCore.InternalTesting.Tests (6)
TaskExtensionsTest.cs (6)
17await Assert.ThrowsAsync<TimeoutException>(async () => await Task.Delay(30000, cts.Token).TimeoutAfter(TimeSpan.FromMilliseconds(50))); 24await Task.FromResult(true).TimeoutAfter(TimeSpan.FromMilliseconds(30000)); 30await Task.Delay(10).TimeoutAfter(TimeSpan.FromMilliseconds(30000)); 37await Assert.ThrowsAsync<TimeoutException>(async () => await Task.Delay(30000, cts.Token).DefaultTimeout(TimeSpan.FromMilliseconds(50))); 72var exception = await Assert.ThrowsAsync<TimeoutException>(() => ExpectedTimeout().TimeoutAfter(TimeSpan.FromMilliseconds(30000))); 85var exception = await Assert.ThrowsAsync<TimeoutException>(() => ExpectedTimeout().TimeoutAfter(TimeSpan.FromMilliseconds(30000)));
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointModelMetadata.cs (1)
65|| underlyingType == typeof(TimeSpan)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (35)
EndpointMetadataApiDescriptionProviderTest.cs (35)
188[ProducesResponseType(typeof(TimeSpan), StatusCodes.Status201Created)] 205Assert.Equal(typeof(TimeSpan), annotatedResponseType.Type); 206Assert.Equal(typeof(TimeSpan), annotatedResponseType.ModelMetadata?.ModelType); 215[ProducesResponseType(typeof(TimeSpan), StatusCodes.Status201Created)] 233Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 234Assert.Equal(typeof(TimeSpan), createdResponseType.ModelMetadata?.ModelType); 310[ProducesResponseType(typeof(TimeSpan), StatusCodes.Status201Created, Description = expectedCreatedDescription)] 319Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 320Assert.Equal(typeof(TimeSpan), createdResponseType.ModelMetadata?.ModelType); 339var apiDescription = GetApiDescription([ProducesResponseType<GenericClass<TimeSpan>>(StatusCodes.Status200OK, Description = expectedOkDescription)] 340() => new GenericClass<TimeSpan> { Value = new TimeSpan() }); 345Assert.Equal(typeof(GenericClass<TimeSpan>), okResponseType.Type); 346Assert.Equal(typeof(GenericClass<TimeSpan>), okResponseType.ModelMetadata?.ModelType); 358var apiDescription = GetApiDescription([ProducesResponseType<GenericClass<TimeSpan>>(StatusCodes.Status200OK, Description = expectedOkDescription)] 359() => TypedResults.Ok(new GenericClass<TimeSpan> { Value = new TimeSpan() })); 364Assert.Equal(typeof(GenericClass<TimeSpan>), okResponseType.Type); 365Assert.Equal(typeof(GenericClass<TimeSpan>), okResponseType.ModelMetadata?.ModelType); 377var apiDescription = GetApiDescription([ProducesResponseType<IEnumerable<TimeSpan>>(StatusCodes.Status200OK, Description = expectedOkDescription)] 378() => new List<TimeSpan> { new() }); 383Assert.Equal(typeof(List<TimeSpan>), okResponseType.Type); // We use List as the inferred type has higher priority than those set by metadata (attributes) 384Assert.Equal(typeof(List<TimeSpan>), okResponseType.ModelMetadata?.ModelType); 396var apiDescription = GetApiDescription([ProducesResponseType<IEnumerable<TimeSpan>>(StatusCodes.Status200OK, Description = expectedOkDescription)] 397() => TypedResults.Ok(new List<TimeSpan> { new() })); 402Assert.Equal(typeof(List<TimeSpan>), okResponseType.Type); // We use List as the inferred type has higher priority than those set by metadata (attributes) 403Assert.Equal(typeof(List<TimeSpan>), okResponseType.ModelMetadata?.ModelType); 443[ProducesResponseType(typeof(TimeSpan), StatusCodes.Status201Created, Description = expectedCreatedDescription)] 462Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 463Assert.Equal(typeof(TimeSpan), createdResponseType.ModelMetadata?.ModelType); 493[ProducesResponseType(typeof(TimeSpan), StatusCodes.Status201Created, Description = expectedCreatedDescription)] // This is the last item, which should match 503Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 504Assert.Equal(typeof(TimeSpan), createdResponseType.ModelMetadata?.ModelType); 715AssertPathParameter(GetApiDescription((TimeSpan foo) => { }, "/{foo}"), typeof(TimeSpan)); 736AssertPathParameter(GetApiDescription((TimeSpan? foo) => { }, "/{foo}"), typeof(TimeSpan?));
Microsoft.AspNetCore.Mvc.Core (6)
Infrastructure\ControllerActionInvoker.cs (1)
647public static void ActionMethodExecuted(ILogger logger, ControllerContext context, IActionResult result, TimeSpan timeSpan)
Infrastructure\ResourceInvoker.Log.cs (1)
98public static void ExecutedAction(ILogger logger, ActionDescriptor action, TimeSpan timeSpan)
src\Shared\ResultsHelpers\FileResultHelper.cs (2)
392var ticksToRemove = dateTimeOffset.Ticks % TimeSpan.TicksPerSecond; 393return dateTimeOffset.Subtract(TimeSpan.FromTicks(ticksToRemove));
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
Microsoft.AspNetCore.Mvc.Core.Test (31)
FileResultHelperTest.cs (15)
251lastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0)); 329lastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0)); 365lastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0)); 388{ new DateTimeOffset(2018, 4, 9, 11, 23, 22, TimeSpan.Zero), 200 }, 389{ new DateTimeOffset(2018, 4, 9, 11, 24, 21, TimeSpan.Zero), 200 }, 390{ new DateTimeOffset(2018, 4, 9, 11, 24, 22, TimeSpan.Zero), 304 }, 391{ new DateTimeOffset(2018, 4, 9, 11, 24, 23, TimeSpan.Zero), 304 }, 392{ new DateTimeOffset(2018, 4, 9, 11, 25, 22, TimeSpan.Zero), 304 }, 412LastModified = new DateTimeOffset(ticks, TimeSpan.Zero) 428{ new DateTimeOffset(2018, 4, 9, 11, 23, 22, TimeSpan.Zero), 412 }, 429{ new DateTimeOffset(2018, 4, 9, 11, 24, 21, TimeSpan.Zero), 412 }, 430{ new DateTimeOffset(2018, 4, 9, 11, 24, 22, TimeSpan.Zero), 200 }, 431{ new DateTimeOffset(2018, 4, 9, 11, 24, 23, TimeSpan.Zero), 200 }, 432{ new DateTimeOffset(2018, 4, 9, 11, 25, 22, TimeSpan.Zero), 200 }, 450LastModified = new DateTimeOffset(ticks, TimeSpan.Zero)
Formatters\FormatFilterTest.cs (1)
309context.RouteData.Values["format"] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7));
Infrastructure\ActionSelectionTableTest.cs (2)
83new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7))); 123new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)));
Infrastructure\ActionSelectorTest.cs (1)
99new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)));
Infrastructure\ParameterDefaultValuesTest.cs (3)
38new object[] { default(Guid), default(TimeSpan), default(DateTime), default(DateTimeOffset) }, 76TimeSpan timeSpan = default(TimeSpan),
ModelBinding\Binders\DateTimeModelBinderProviderTest.cs (1)
14[InlineData(typeof(TimeSpan))]
ModelBinding\ModelBindingHelperTest.cs (2)
1226yield return new object[] { "00:00:20", TimeSpan.FromSeconds(20) }; 1237[InlineData(typeof(TimeSpan))]
ModelBinding\RouteValueProviderTests.cs (2)
53{ "test-key", new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)) }, 70{ "test-key", new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)) },
PhysicalFileResultTest.cs (1)
51LastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0))
Routing\KnownRouteValueConstraintTests.cs (1)
259{ "randomKey", new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)) },
Routing\UrlHelperExtensionsTest.cs (1)
258{ "page", new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)) },
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
514lastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0));
Microsoft.AspNetCore.Mvc.Cors.Test (1)
CorsAuthorizationFilterTest.cs (1)
255result.PreflightMaxAge = TimeSpan.FromSeconds(preFlightMaxAge.Value);
Microsoft.AspNetCore.Mvc.FunctionalTests (5)
AntiforgeryMiddlewareTest.cs (1)
250public DateTime DueDate { get; set; } = DateTime.Now.Add(TimeSpan.FromDays(1));
DefaultValuesTest.cs (2)
89var expected = $"{default(Guid)}, {default(TimeSpan)}"; 104TimeSpan timeSpan = new TimeSpan(10, 10, 10);
HtmlGenerationTest.cs (1)
485await Task.Delay(TimeSpan.FromSeconds(2));
RazorPagesTest.cs (1)
1253Assert.Equal(TimeSpan.FromSeconds(10), cacheControl.MaxAge.Value);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
BsonTempDataSerializer.cs (2)
39{ JTokenType.TimeSpan, typeof(TimeSpan) }, 246type.Equals(typeof(TimeSpan)) ||
Microsoft.AspNetCore.Mvc.Razor (2)
RazorViewEngine.cs (2)
37private static readonly TimeSpan _cacheExpirationDuration = TimeSpan.FromMinutes(20);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
RuntimeViewCompiler.cs (1)
423var elapsed = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (4)
RuntimeViewCompilerTest.cs (4)
573var waitDuration = TimeSpan.FromSeconds(20); 652var waitDuration = TimeSpan.FromSeconds(20);
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorViewEngineTest.cs (1)
1644actionContext.RouteData.Values[key] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7));
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\DefaultPageHandlerMethodSelectorTest.cs (1)
407{ "handler", new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)) },
Microsoft.AspNetCore.Mvc.TagHelpers (6)
Cache\CacheTagKey.cs (2)
39private readonly TimeSpan? _expiresAfter; 40private readonly TimeSpan? _expiresSliding;
CacheTagHelperBase.cs (4)
34public static readonly TimeSpan DefaultExpiration = TimeSpan.FromSeconds(30); 117public TimeSpan? ExpiresAfter { get; set; } 123public TimeSpan? ExpiresSliding { get; set; }
Microsoft.AspNetCore.Mvc.TagHelpers.Test (43)
CacheTagHelperTest.cs (22)
257var slidingExpiresIn = TimeSpan.FromSeconds(30); 272var expiresAfter = TimeSpan.FromSeconds(42); 290var expiresSliding = TimeSpan.FromSeconds(37); 326var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero); 340ExpiresAfter = TimeSpan.FromMinutes(10) 361ExpiresAfter = TimeSpan.FromMinutes(10) 379var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero); 432var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero); 446ExpiresSliding = TimeSpan.FromSeconds(30) 468ExpiresSliding = TimeSpan.FromSeconds(30) 571await event3.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 594await event1.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 601await event2.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 654await event3.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 677await event1.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 684await event2.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 746ExpiresAfter = TimeSpan.FromHours(1.0) 973public TimeSpan? AbsoluteExpirationRelativeToNow { get; set; } 974public TimeSpan? SlidingExpiration { get; set; }
CacheTagKeyTest.cs (1)
316new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7));
DistributedCacheTagHelperTest.cs (19)
274var slidingExpiresIn = TimeSpan.FromSeconds(30); 297var expiresAfter = TimeSpan.FromSeconds(42); 323var expiresSliding = TimeSpan.FromSeconds(37); 349var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero); 370ExpiresAfter = TimeSpan.FromMinutes(10) 393ExpiresAfter = TimeSpan.FromMinutes(10) 411var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero); 473var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero); 494ExpiresSliding = TimeSpan.FromSeconds(30) 518ExpiresSliding = TimeSpan.FromSeconds(30) 570await event3.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 597await event1.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 604await event2.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 662await event3.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 689await event1.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 696await event2.Task.TimeoutAfter(TimeSpan.FromSeconds(5));
InputTagHelperTest.cs (1)
712DateTimeOffset = new DateTimeOffset(2011, 8, 31, hour: 5, minute: 30, second: 45, offset: TimeSpan.FromHours(3))
Microsoft.AspNetCore.Mvc.Testing (8)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-rc.1.25420.121\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (8)
24private static readonly TimeSpan s_defaultWaitTimeout = SetupDefaultTimeout(); 26private static TimeSpan SetupDefaultTimeout() 35return TimeSpan.FromSeconds((int)timeoutInSeconds); 38return TimeSpan.FromMinutes(5); 63TimeSpan? waitTimeout = null, 122public static Func<string[], IServiceProvider?>? ResolveServiceProviderFactory(Assembly assembly, TimeSpan? waitTimeout = null) 200private readonly TimeSpan _waitTimeout; 209public HostingListener(string[] args, MethodInfo entryPoint, TimeSpan waitTimeout, bool stopApplication, Action<object>? configure, Action<Exception?>? entrypointCompleted)
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
PartialViewResultExecutor.cs (2)
198public static void PartialViewFound(ILogger logger, IView view, TimeSpan timespan) 209public static void PartialViewResultExecuted(ILogger logger, string? partialViewName, TimeSpan timespan)
ViewComponents\DefaultViewComponentInvoker.cs (1)
254TimeSpan timespan,
ViewResultExecutor.cs (2)
198public static void ViewFound(ILogger logger, IView view, TimeSpan timespan) 209public static void ViewResultExecuted(ILogger logger, string viewName, TimeSpan timespan)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (11)
DefaultEditorTemplatesTest.cs (8)
834var offset = TimeSpan.FromHours(0); 900var offset = TimeSpan.FromHours(-5); 971var offset = TimeSpan.FromHours(-5); 1176var offset = TimeSpan.FromHours(0);
PartialViewResultExecutorTest.cs (1)
83context.RouteData.Values["action"] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7));
TemplateRendererTest.cs (1)
24{ typeof(TimeSpan), new string[] { "TimeSpan", "String" } },
ViewResultExecutorTest.cs (1)
82context.RouteData.Values["action"] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7));
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiConstants.cs (1)
66typeof(TimeSpan),
Microsoft.AspNetCore.OpenApi.Build.Tests (2)
GenerateAdditionalXmlFilesForOpenApiTests.cs (2)
12private static readonly TimeSpan _defaultProcessTimeout = TimeSpan.FromMinutes(2);
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (8)
SnapshotTestHelper.cs (8)
233private static readonly TimeSpan s_defaultWaitTimeout = SetupDefaultTimeout(); 235private static TimeSpan SetupDefaultTimeout() 244return TimeSpan.FromSeconds((int)timeoutInSeconds); 247return TimeSpan.FromMinutes(5); 272TimeSpan waitTimeout = default, 312public static Func<string[], IServiceProvider> ResolveServiceProviderFactory(Assembly assembly, TimeSpan waitTimeout = default) 390private readonly TimeSpan _waitTimeout; 399public HostingListener(string[] args, MethodInfo entryPoint, TimeSpan waitTimeout, bool stopApplication, Action<object> configure, Action<Exception> entrypointCompleted)
Microsoft.AspNetCore.OpenApi.Tests (4)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (1)
18[ProducesResponseType(typeof(TimeSpan), StatusCodes.Status201Created)]
Services\OpenApiGeneratorTests.cs (3)
203[ProducesResponseType(typeof(TimeSpan), StatusCodes.Status201Created)] 250[ProducesResponseType(typeof(TimeSpan), StatusCodes.Status201Created)] 285[ProducesResponseType(typeof(TimeSpan), StatusCodes.Status201Created)]
Microsoft.AspNetCore.OutputCaching (20)
IOutputCacheBufferStore.cs (1)
32ValueTask SetAsync(string key, ReadOnlySequence<byte> value, ReadOnlyMemory<string> tags, TimeSpan validFor, CancellationToken cancellationToken);
IOutputCacheStore.cs (1)
35ValueTask SetAsync(string key, byte[] value, string[]? tags, TimeSpan validFor, CancellationToken cancellationToken);
Memory\MemoryOutputCacheStore.cs (2)
73public ValueTask SetAsync(string key, byte[] value, string[]? tags, TimeSpan validFor, CancellationToken cancellationToken) 116private void SetEntry(string key, byte[] value, string[]? tags, TimeSpan validFor, Guid entryId)
OutputCacheAttribute.cs (1)
114builder.Expire(TimeSpan.FromSeconds(_duration.Value));
OutputCacheContext.cs (3)
63public TimeSpan? ResponseExpirationTimeSpan { get; set; } 67internal TimeSpan CachedResponseValidFor { get; set; } 71internal TimeSpan CachedEntryAge { get; set; }
OutputCacheEntryFormatter.cs (2)
38public static async ValueTask StoreAsync(string key, OutputCacheEntry value, HashSet<string>? tags, TimeSpan duration, IOutputCacheStore store, ILogger logger, CancellationToken cancellationToken) 247var created = new DateTimeOffset(ticks, TimeSpan.FromMinutes(offsetMinutes));
OutputCacheMiddleware.cs (5)
262var cacheEntryAge = context.ResponseTime.Value - context.CachedResponse.Created; 263context.CachedEntryAge = cacheEntryAge > TimeSpan.Zero ? cacheEntryAge : TimeSpan.Zero; 273if (context.CachedEntryAge <= TimeSpan.Zero) 307response.Headers.Age = HeaderUtilities.FormatNonNegativeInt64(context.CachedEntryAge.Ticks / TimeSpan.TicksPerSecond);
OutputCacheOptions.cs (2)
27public TimeSpan DefaultExpirationTimeSpan { get; set; } = TimeSpan.FromSeconds(60);
OutputCachePolicyBuilder.cs (1)
265public OutputCachePolicyBuilder Expire(TimeSpan expiration)
Policies\ExpirationPolicy.cs (2)
11private readonly TimeSpan _expiration; 17public ExpirationPolicy(TimeSpan expiration)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
EndToEndBenchmarks.cs (1)
252ValueTask IOutputCacheStore.SetAsync(string key, byte[]? value, string[]? tags, TimeSpan validFor, CancellationToken cancellationToken)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (15)
RedisOutputCacheStore.cs (15)
43private readonly TimeSpan ReconnectMinInterval = TimeSpan.FromSeconds(60); 46private readonly TimeSpan ReconnectErrorThreshold = TimeSpan.FromSeconds(30); 100await Task.Delay(TimeSpan.FromSeconds(secondsWithJitter)).ConfigureAwait(false); 105await ExecuteGarbageCollectionAsync(GetExpirationTimestamp(TimeSpan.Zero), _disposalCancellation.Token).ConfigureAwait(false); 131var gcLifetime = TimeSpan.FromMinutes(5); 237ValueTask IOutputCacheStore.SetAsync(string key, byte[] value, string[]? tags, TimeSpan validFor, CancellationToken cancellationToken) 243async ValueTask IOutputCacheBufferStore.SetAsync(string key, ReadOnlySequence<byte> value, ReadOnlyMemory<string> tags, TimeSpan validFor, CancellationToken cancellationToken) 309private static long GetExpirationTimestamp(TimeSpan timeout) => 372TimeSpan elapsedSinceLastReconnect = utcNow - previousConnectTime; 389TimeSpan elapsedSinceFirstError = utcNow - firstErrorTime; 390TimeSpan elapsedSinceMostRecentError = utcNow - ReadTimeTicks(ref _previousErrorTimeTicks); 482return ticks == 0 ? DateTimeOffset.MinValue : new DateTimeOffset(ticks, TimeSpan.Zero);
Microsoft.AspNetCore.OutputCaching.Tests (74)
MemoryOutputCacheStoreTests.cs (25)
18await store.SetAsync(key, value, null, TimeSpan.FromMinutes(1), default); 33await store.SetAsync(key, value, null, TimeSpan.FromMilliseconds(5), default); 34testClock.Advance(TimeSpan.FromMilliseconds(10)); 48_ = await Assert.ThrowsAsync<ArgumentNullException>("key", () => store.SetAsync(key, value, null, TimeSpan.FromMilliseconds(5), default).AsTask()); 58_ = await Assert.ThrowsAsync<ArgumentNullException>("value", () => store.SetAsync(key, value, null, TimeSpan.FromMilliseconds(5), default).AsTask()); 70await store.SetAsync(key, value, tags, TimeSpan.FromDays(1), default); 78using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30)); 99await store.SetAsync(key1, value, tags, TimeSpan.FromDays(1), default); 100await store.SetAsync(key2, value, tags, TimeSpan.FromDays(1), default); 118await store.SetAsync(key, value, tags, TimeSpan.FromDays(1), default); 136await store.SetAsync(key1, value, tags1, TimeSpan.FromDays(1), default); 137await store.SetAsync(key2, value, tags2, TimeSpan.FromDays(1), default); 159var cache = new MemoryCache(new MemoryCacheOptions { SizeLimit = 1000, Clock = testClock, ExpirationScanFrequency = TimeSpan.FromMilliseconds(1) }); 163await store.SetAsync("a", value, new[] { "tag1" }, TimeSpan.FromMilliseconds(5), default); 164await store.SetAsync("b", value, new[] { "tag1", "tag2" }, TimeSpan.FromMilliseconds(5), default); 165await store.SetAsync("c", value, new[] { "tag2" }, TimeSpan.FromMilliseconds(20), default); 167testClock.Advance(TimeSpan.FromMilliseconds(10)); 184using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30)); 204var cache = new MemoryCache(new MemoryCacheOptions { SizeLimit = 1000, Clock = testClock, ExpirationScanFrequency = TimeSpan.FromMilliseconds(1) }); 208await store.SetAsync("a", value, new[] { "tag1", "tag2" }, TimeSpan.FromMilliseconds(5), default); 209await store.SetAsync("a", value, new[] { "tag1" }, TimeSpan.FromMilliseconds(20), default); 211testClock.Advance(TimeSpan.FromMilliseconds(10)); 224using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30)); 245await Assert.ThrowsAsync<ArgumentException>(async () => await store.SetAsync(key, value, new string[] { tag }, TimeSpan.FromMinutes(1), default)); 251public void Advance(TimeSpan duration)
OutputCacheAttributeTests.cs (1)
49options.AddPolicy("MyPolicy", b => b.Expire(TimeSpan.FromSeconds(42)));
OutputCacheEntryFormatterTests.cs (3)
35await OutputCacheEntryFormatter.StoreAsync(key, entry, null, TimeSpan.Zero, store, NullLogger.Instance, default); 54await OutputCacheEntryFormatter.StoreAsync(key, entry, new HashSet<string>() { "tag", "タグ" }, TimeSpan.Zero, store, NullLogger.Instance, default); 72await OutputCacheEntryFormatter.StoreAsync(key, entry, null, TimeSpan.Zero, store, NullLogger.Instance, default);
OutputCacheMiddlewareTests.cs (27)
83TimeSpan.Zero, 113TimeSpan.Zero, 141TimeSpan.Zero, 187SetDateHeader(context.CachedResponse, utcNow - TimeSpan.FromSeconds(10)); 197SetDateHeader(context.CachedResponse, utcNow + TimeSpan.FromSeconds(10)); 229SetDateHeaders(context.CachedResponse, utcNow + TimeSpan.FromSeconds(10), utcNow - TimeSpan.FromSeconds(10)); 234SetDateHeaders(context.CachedResponse, utcNow + TimeSpan.FromSeconds(10), utcNow); 239SetDateHeaders(context.CachedResponse, utcNow - TimeSpan.FromSeconds(10), utcNow + TimeSpan.FromSeconds(10)); 261entry.CopyHeadersFrom(new HeaderDictionary { [HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)) }); 282context.CachedResponse.CopyHeadersFrom(new HeaderDictionary { [HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow - TimeSpan.FromSeconds(10)) }); 398timeProvider.Advance(TimeSpan.FromSeconds(10)); 414Assert.Equal(TimeSpan.FromSeconds(60), context.CachedResponseValidFor); 433context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11)); 458MaxAge = TimeSpan.FromSeconds(12) 461context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11)); 484MaxAge = TimeSpan.FromSeconds(12), 485SharedMaxAge = TimeSpan.FromSeconds(13) 487context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11)); 557var responseTime = utcNow + TimeSpan.FromSeconds(10); 618context.CachedResponseValidFor = TimeSpan.FromSeconds(10); 647context.CachedResponseValidFor = TimeSpan.FromSeconds(10); 680context.CachedResponseValidFor = TimeSpan.FromSeconds(10); 705context.CachedResponseValidFor = TimeSpan.FromSeconds(10); 777context.CachedResponseValidFor = TimeSpan.FromSeconds(10); 981context.CachedResponseValidFor = TimeSpan.FromSeconds(10);
OutputCachePoliciesTests.cs (2)
80var duration = TimeSpan.FromDays(1);
OutputCachePolicyBuilderTests.cs (7)
36var policy = builder.Expire(TimeSpan.FromSeconds(duration)).Build(); 61options.AddPolicy(name, b => b.Expire(TimeSpan.FromSeconds(duration))); 79options.AddPolicy(name, b => b.Expire(TimeSpan.FromSeconds(duration)), true); 333options.AddBasePolicy(build => build.Expire(TimeSpan.FromSeconds(1))); 334options.AddBasePolicy(build => build.With(c => source == 1).Expire(TimeSpan.FromSeconds(2))); 335options.AddBasePolicy(build => build.With(c => source == 2).Expire(TimeSpan.FromSeconds(3))); 353options.AddBasePolicy(build => build.With(c => false).Expire(TimeSpan.FromSeconds(2)));
OutputCachePolicyProviderTests.cs (5)
359MaxAge = TimeSpan.FromSeconds(10) 363context.ResponseTime = utcNow + TimeSpan.FromSeconds(9); 382MaxAge = TimeSpan.FromSeconds(10), 383SharedMaxAge = TimeSpan.FromSeconds(15) 386context.ResponseTime = utcNow + TimeSpan.FromSeconds(11);
OutputCacheTests.cs (2)
232DefaultExpirationTimeSpan = TimeSpan.FromMicroseconds(100) 570MaxAge = TimeSpan.FromSeconds(0)
TestUtils.cs (2)
356public ValueTask SetAsync(string key, byte[] entry, string[]? tags, TimeSpan validFor, CancellationToken cancellationToken) 370ValueTask IOutputCacheBufferStore.SetAsync(string key, ReadOnlySequence<byte> value, ReadOnlyMemory<string> tags, TimeSpan validFor, CancellationToken cancellationToken)
Microsoft.AspNetCore.RateLimiting (4)
RateLimitingMetrics.cs (2)
108var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp); 158var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp);
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
Microsoft.AspNetCore.RateLimiting.Tests (2)
RateLimitingMiddlewareTests.cs (1)
228options.Window = TimeSpan.FromSeconds(10);
TestRateLimiter.cs (1)
17public override TimeSpan? IdleDuration => throw new NotImplementedException();
Microsoft.AspNetCore.ResponseCaching (32)
Interfaces\IResponseCache.cs (1)
22void Set(string key, IResponseCacheEntry entry, TimeSpan validFor);
LoggerExtensions.cs (12)
32internal static partial void ExpirationMinFreshAdded(this ILogger logger, TimeSpan duration); 36internal static partial void ExpirationSharedMaxAgeExceeded(this ILogger logger, TimeSpan age, TimeSpan sharedMaxAge); 41internal static partial void ExpirationMustRevalidate(this ILogger logger, TimeSpan age, TimeSpan maxAge); 46internal static partial void ExpirationMaxStaleSatisfied(this ILogger logger, TimeSpan age, TimeSpan maxAge, TimeSpan maxStale); 49internal static partial void ExpirationMaxAgeExceeded(this ILogger logger, TimeSpan age, TimeSpan maxAge); 122internal static partial void ExpirationInfiniteMaxStaleSatisfied(this ILogger logger, TimeSpan age, TimeSpan maxAge);
MemoryResponseCache.cs (1)
37public void Set(string key, IResponseCacheEntry entry, TimeSpan validFor)
ResponseCachingContext.cs (6)
18private TimeSpan? _responseSharedMaxAge; 20private TimeSpan? _responseMaxAge; 33public TimeSpan? CachedEntryAge { get; internal set; } 45internal TimeSpan CachedResponseValidFor { get; set; } 105internal TimeSpan? ResponseSharedMaxAge 118internal TimeSpan? ResponseMaxAge
ResponseCachingMiddleware.cs (6)
19private static readonly TimeSpan DefaultExpirationTimeSpan = TimeSpan.FromSeconds(10); 146var cachedEntryAge = context.ResponseTime.Value - context.CachedResponse.Created; 147context.CachedEntryAge = cachedEntryAge > TimeSpan.Zero ? cachedEntryAge : TimeSpan.Zero; 181response.Headers.Age = HeaderUtilities.FormatNonNegativeInt64(context.CachedEntryAge.Value.Ticks / TimeSpan.TicksPerSecond);
ResponseCachingPolicyProvider.cs (6)
135var age = context.ResponseTime!.Value - context.ResponseDate.Value; 168var age = context.CachedEntryAge!.Value; 180TimeSpan? cachedSharedMaxAge; 191TimeSpan? requestMaxAge; 194TimeSpan? cachedMaxAge; 209TimeSpan? requestMaxStale;
Microsoft.AspNetCore.ResponseCaching.Tests (87)
ResponseCachingMiddlewareTests.cs (32)
66TimeSpan.Zero); 94TimeSpan.Zero); 115TimeSpan.Zero); 135TimeSpan.Zero); 143TimeSpan.Zero); 167TimeSpan.Zero); 198context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow - TimeSpan.FromSeconds(10)); 208context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)); 229context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)); 230context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow - TimeSpan.FromSeconds(10)); 235context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)); 241context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow - TimeSpan.FromSeconds(10)); 242context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)); 262context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)); 281context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow - TimeSpan.FromSeconds(10)); 389timeProvider.Advance(TimeSpan.FromSeconds(10)); 440Assert.Equal(TimeSpan.FromSeconds(10), context.CachedResponseValidFor); 459context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(now + TimeSpan.FromSeconds(11)); 463Assert.Equal(TimeSpan.FromSeconds(11), context.CachedResponseValidFor); 481MaxAge = TimeSpan.FromSeconds(12) 484context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11)); 488Assert.Equal(TimeSpan.FromSeconds(12), context.CachedResponseValidFor); 506MaxAge = TimeSpan.FromSeconds(12), 507SharedMaxAge = TimeSpan.FromSeconds(13) 509context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11)); 513Assert.Equal(TimeSpan.FromSeconds(13), context.CachedResponseValidFor); 644context.ResponseTime = utcNow + TimeSpan.FromSeconds(10); 702context.CachedResponseValidFor = TimeSpan.FromSeconds(10); 731context.CachedResponseValidFor = TimeSpan.FromSeconds(10); 764context.CachedResponseValidFor = TimeSpan.FromSeconds(10); 792context.CachedResponseValidFor = TimeSpan.FromSeconds(10); 863context.CachedResponseValidFor = TimeSpan.FromSeconds(10);
ResponseCachingPolicyProviderTests.cs (49)
411MaxAge = TimeSpan.FromSeconds(10) 415context.ResponseTime = utcNow + TimeSpan.FromSeconds(9); 431MaxAge = TimeSpan.FromSeconds(10) 435context.ResponseTime = utcNow + TimeSpan.FromSeconds(10); 453MaxAge = TimeSpan.FromSeconds(10), 454SharedMaxAge = TimeSpan.FromSeconds(15) 457context.ResponseTime = utcNow + TimeSpan.FromSeconds(11); 473MaxAge = TimeSpan.FromSeconds(10), 474SharedMaxAge = TimeSpan.FromSeconds(5) 477context.ResponseTime = utcNow + TimeSpan.FromSeconds(5); 492context.CachedEntryAge = TimeSpan.MaxValue; 506context.CachedEntryAge = TimeSpan.MaxValue; 524context.CachedEntryAge = TimeSpan.Zero; 544context.CachedEntryAge = TimeSpan.FromSeconds(9); 550MaxAge = TimeSpan.FromSeconds(10) 564context.CachedEntryAge = TimeSpan.FromSeconds(10); 570MaxAge = TimeSpan.FromSeconds(10) 586context.CachedEntryAge = TimeSpan.FromSeconds(11); 592MaxAge = TimeSpan.FromSeconds(10), 593SharedMaxAge = TimeSpan.FromSeconds(15) 607context.CachedEntryAge = TimeSpan.FromSeconds(5); 613MaxAge = TimeSpan.FromSeconds(10), 614SharedMaxAge = TimeSpan.FromSeconds(5) 631MinFresh = TimeSpan.FromSeconds(2) 636MaxAge = TimeSpan.FromSeconds(10), 637SharedMaxAge = TimeSpan.FromSeconds(5) 639context.CachedEntryAge = TimeSpan.FromSeconds(3); 655MaxAge = TimeSpan.FromSeconds(5) 660MaxAge = TimeSpan.FromSeconds(10), 662context.CachedEntryAge = TimeSpan.FromSeconds(5); 677MaxAge = TimeSpan.FromSeconds(5), 679MaxStaleLimit = TimeSpan.FromSeconds(2) 684MaxAge = TimeSpan.FromSeconds(5), 686context.CachedEntryAge = TimeSpan.FromSeconds(6); 701MaxAge = TimeSpan.FromSeconds(5), 707MaxAge = TimeSpan.FromSeconds(5), 709context.CachedEntryAge = TimeSpan.FromSeconds(6); 724MaxAge = TimeSpan.FromSeconds(5), 726MaxStaleLimit = TimeSpan.FromSeconds(1) 731MaxAge = TimeSpan.FromSeconds(5), 733context.CachedEntryAge = TimeSpan.FromSeconds(6); 748MaxAge = TimeSpan.FromSeconds(5), 750MaxStaleLimit = TimeSpan.FromSeconds(2) 755MaxAge = TimeSpan.FromSeconds(5), 758context.CachedEntryAge = TimeSpan.FromSeconds(6); 773MaxAge = TimeSpan.FromSeconds(5), 775MaxStaleLimit = TimeSpan.FromSeconds(2) 780MaxAge = TimeSpan.FromSeconds(5), 783context.CachedEntryAge = TimeSpan.FromSeconds(6);
ResponseCachingTests.cs (1)
506MaxAge = TimeSpan.FromSeconds(0)
TestUtils.cs (5)
47MaxAge = string.IsNullOrEmpty(expires) ? TimeSpan.FromSeconds(10) : (TimeSpan?)null 53headers.CacheControl.MaxAge = string.IsNullOrEmpty(expires) ? TimeSpan.FromSeconds(10) : (TimeSpan?)null; 386public void Set(string key, IResponseCacheEntry entry, TimeSpan validFor)
Microsoft.AspNetCore.ResponseCompression.Tests (8)
ResponseCompressionMiddlewareTest.cs (8)
641await responseReceived.Task.TimeoutAfter(TimeSpan.FromSeconds(3)); 687await responseReceived.Task.TimeoutAfter(TimeSpan.FromSeconds(3)); 739await responseReceived.Task.TimeoutAfter(TimeSpan.FromSeconds(3)); 792await responseReceived.Task.TimeoutAfter(TimeSpan.FromSeconds(3)); 862await signal.Task.TimeoutAfter(TimeSpan.FromSeconds(3)); 926await signal.Task.TimeoutAfter(TimeSpan.FromSeconds(3)); 990await signal.Task.TimeoutAfter(TimeSpan.FromSeconds(3)); 1201await responseReceived.Task.TimeoutAfter(TimeSpan.FromSeconds(3));
Microsoft.AspNetCore.Rewrite (13)
ApacheModRewrite\CookieActionFactory.cs (1)
88action!.Lifetime = TimeSpan.FromMinutes(minutes);
ApacheModRewrite\RuleBuilder.cs (2)
19private readonly TimeSpan _regexTimeout = TimeSpan.FromSeconds(1);
IISUrlRewrite\UriMatchCondition.cs (2)
11private static readonly TimeSpan _regexTimeout = TimeSpan.FromSeconds(1);
IISUrlRewrite\UrlRewriteRuleBuilder.cs (2)
11private readonly TimeSpan _regexTimeout = TimeSpan.FromSeconds(1);
RedirectRule.cs (2)
13private readonly TimeSpan _regexTimeout = TimeSpan.FromSeconds(1);
RewriteRule.cs (2)
13private readonly TimeSpan _regexTimeout = TimeSpan.FromSeconds(1);
UrlActions\ChangeCookieAction.cs (2)
30public TimeSpan Lifetime { get; set; } 43if (Lifetime > TimeSpan.Zero)
Microsoft.AspNetCore.Rewrite.Tests (3)
ApacheModRewrite\CookieActionFactoryTest.cs (2)
18Assert.Equal(TimeSpan.FromMinutes(1440), cookie.Lifetime); 32Assert.Equal(TimeSpan.FromMinutes(1440), action.Lifetime);
UrlActions\ChangeCookieActionTests.cs (1)
21Lifetime = TimeSpan.FromMinutes(1440),
Microsoft.AspNetCore.Routing (2)
Constraints\RegexRouteConstraint.cs (2)
26private static readonly TimeSpan RegexMatchTimeout = TimeSpan.FromSeconds(10);
Microsoft.AspNetCore.Server.HttpSys (20)
IHttpSysRequestTimingFeature.cs (2)
37/// <param name="elapsed">A <see cref="TimeSpan"/> for the elapsed time between the starting and ending timestamps.</param> 39bool TryGetElapsedTime(HttpSysRequestTimingType startingTimestampType, HttpSysRequestTimingType endingTimestampType, out TimeSpan elapsed);
RequestProcessing\RequestContext.FeatureCollection.cs (3)
663private TimeSpan? GetCacheTtl() 705var expiresOffset = expirationDate - DateTimeOffset.UtcNow; 706if (expiresOffset > TimeSpan.Zero)
RequestProcessing\Response.cs (4)
30private TimeSpan? _cacheTtl; 175public TimeSpan? CacheTtl 312if (_cacheTtl.HasValue && _cacheTtl.Value > TimeSpan.Zero) 315cachePolicy.SecondsToLive = (uint)Math.Min(_cacheTtl.Value.Ticks / TimeSpan.TicksPerSecond, Int32.MaxValue);
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
207public bool TryGetElapsedTime(HttpSysRequestTimingType startingTimestampType, HttpSysRequestTimingType endingTimestampType, out TimeSpan elapsed)
TimeoutManager.cs (7)
47public TimeSpan EntityBody 70public TimeSpan DrainEntityBody 88public TimeSpan RequestQueue 107public TimeSpan IdleConnection 127public TimeSpan HeaderWait 171private TimeSpan GetTimeSpanTimeout(TimeoutType type) 177private void SetTimeSpanTimeout(TimeoutType type, TimeSpan value)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (70)
AuthenticationTests.cs (1)
189await completed.Task.TimeoutAfter(TimeSpan.FromSeconds(5));
HttpsTests.cs (1)
277Assert.True(requestTimingFeature.TryGetElapsedTime(HttpSysRequestTimingType.RequestHeaderParseStart, HttpSysRequestTimingType.RequestHeaderParseEnd, out var elapsed));
Listener\AuthenticationOnExistingQueueTests.cs (1)
223using HttpClient client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(5) };
Listener\RequestBodyTests.cs (3)
105cts.CancelAfter(TimeSpan.FromSeconds(5)); 157cts.CancelAfter(TimeSpan.FromMilliseconds(100)); 204client.Timeout = TimeSpan.FromSeconds(10);
Listener\ResponseBodyTests.cs (5)
132cts.CancelAfter(TimeSpan.FromSeconds(10)); 257await Task.Delay(TimeSpan.FromMilliseconds(50)); 293await Task.Delay(TimeSpan.FromMilliseconds(50)); 391await Task.Delay(TimeSpan.FromMilliseconds(50)); 430await Task.Delay(TimeSpan.FromMilliseconds(50));
Listener\ServerTests.cs (6)
25var interval = TimeSpan.FromSeconds(1); 54var interval = TimeSpan.FromSeconds(1); 84var interval = TimeSpan.FromSeconds(1);
Listener\Utilities.cs (3)
24internal static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(15); 108internal static async Task<RequestContext> AcceptAsync(this HttpSysListener server, TimeSpan timeout)
OpaqueUpgradeTests.cs (3)
122Assert.True(await upgraded.Task.TimeoutAfter(TimeSpan.FromSeconds(1))); 154Assert.True(await upgraded.Task.TimeoutAfter(TimeSpan.FromSeconds(10))); 182Assert.True(await upgraded.Task.TimeoutAfter(TimeSpan.FromSeconds(1)));
RequestBodyLimitTests.cs (1)
434Assert.True(await Block.WaitAsync(TimeSpan.FromSeconds(10)));
RequestBodyTests.cs (1)
368Assert.True(await Block.WaitAsync(TimeSpan.FromSeconds(10)));
ResponseBodyTests.cs (1)
311Assert.True(await requestThrew.Task.WaitAsync(TimeSpan.FromSeconds(10)));
ResponseCachingTests.cs (5)
240httpContext.Response.Headers["Expires"] = (DateTime.UtcNow + TimeSpan.FromSeconds(10)).ToString("r"); 307httpContext.Response.Headers["Expires"] = (DateTime.UtcNow + TimeSpan.FromSeconds(10)).ToString("r"); 328httpContext.Response.Headers["Expires"] = (DateTime.UtcNow - TimeSpan.FromSeconds(10)).ToString("r"); // In the past 471using (var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(10) }) 486using (var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(10) })
ResponseSendFileTests.cs (2)
57Assert.True(await appThrew.Task.TimeoutAfter(TimeSpan.FromSeconds(10))); 356cts.CancelAfter(TimeSpan.FromSeconds(10));
ResponseTests.cs (6)
152await onStartingCalled.Task.TimeoutAfter(TimeSpan.FromSeconds(1)); 154await onCompletedCalled.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 181await onStartingCalled.Task.TimeoutAfter(TimeSpan.FromSeconds(1)); 183await onCompletedCalled.Task.TimeoutAfter(TimeSpan.FromSeconds(5)); 211await onStartingCalled.Task.TimeoutAfter(TimeSpan.FromSeconds(1)); 213await onCompletedCalled.Task.TimeoutAfter(TimeSpan.FromSeconds(5));
ServerTests.cs (29)
157await received.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 158await server.StopAsync(new CancellationTokenSource(TimeSpan.FromSeconds(5)).Token); 173await stopped.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 179await received.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 194await shutdown.Task.TimeoutAfter(TimeSpan.FromSeconds(15)); 200await received.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 201await server.StopAsync(new CancellationTokenSource(TimeSpan.FromSeconds(5)).Token); 270Assert.True(Task.WaitAll(requestTasks.ToArray(), TimeSpan.FromSeconds(60)), "Timed out"); 277var interval = TimeSpan.FromSeconds(10); 311var interval = TimeSpan.FromSeconds(10); 423await run.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 429await received.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 431var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); 442await Task.WhenAll(stopTask1, stopTask2, stopTask3).TimeoutAfter(TimeSpan.FromSeconds(10)); 457await run.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 463await received.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 476await Task.WhenAll(stopTask1, stopTask2, stopTask3).TimeoutAfter(TimeSpan.FromSeconds(10)); 494await run.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 500await received.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 513await Task.WhenAll(stopTask1, stopTask2, stopTask3).TimeoutAfter(TimeSpan.FromSeconds(10)); 531await run.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 537await received.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 550await Task.WhenAll(stopTask1, stopTask2, stopTask3).TimeoutAfter(TimeSpan.FromSeconds(10)); 570await run.Task.TimeoutAfter(TimeSpan.FromSeconds(15)); 576await received.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 585await Task.WhenAll(stopTask1, stopTask2).TimeoutAfter(TimeSpan.FromSeconds(10)); 594await server.StopAsync(default(CancellationToken)).TimeoutAfter(TimeSpan.FromSeconds(10));
Utilities.cs (2)
32internal static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(15);
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (2)
Utilities.cs (2)
16internal static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(15);
Microsoft.AspNetCore.Server.IIS (4)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
207public bool TryGetElapsedTime(HttpSysRequestTimingType startingTimestampType, HttpSysRequestTimingType endingTimestampType, out TimeSpan elapsed)
Microsoft.AspNetCore.Server.IISIntegration.Tests (4)
IISMiddlewareTests.cs (4)
138await applicationStoppingFired.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 198await requestExecuted.Task.TimeoutAfter(TimeSpan.FromSeconds(2)); 243await requestExecuted.Task.TimeoutAfter(TimeSpan.FromSeconds(2)); 288await requestExecuted.Task.TimeoutAfter(TimeSpan.FromSeconds(2));
Microsoft.AspNetCore.Server.IntegrationTesting (21)
ApplicationPublisher.cs (2)
78var timeout = deploymentParameters.PublishTimeout ?? TimeSpan.FromMinutes(5);
Common\DeploymentParameters.cs (1)
180public TimeSpan? PublishTimeout { get; set; }
Common\DeploymentResult.cs (1)
68Timeout = TimeSpan.FromSeconds(200),
Deployers\NginxDeployer.cs (2)
20private readonly int _waitTime = (int)TimeSpan.FromSeconds(30).TotalMilliseconds; 80httpClient.Timeout = TimeSpan.FromSeconds(200);
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (1)
259await Task.Delay(TimeSpan.FromMinutes(1));
Deployers\SelfHostDeployer.cs (1)
198await started.Task.TimeoutAfter(TimeSpan.FromMinutes(15));
src\Shared\Process\ProcessEx.cs (7)
21private static readonly TimeSpan DefaultProcessTimeout = TimeSpan.FromMinutes(15); 32private readonly CancellationTokenSource _stdoutLinesCancellationSource = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 36public ProcessEx(ITestOutputHelper output, Process proc, TimeSpan timeout) 103public static ProcessEx Run(ITestOutputHelper output, string workingDirectory, string command, string args = null, IDictionary<string, string> envVars = null, TimeSpan? timeout = default) 205public void WaitForExit(bool assertSuccess, TimeSpan? timeSpan = null) 209timeSpan = TimeSpan.FromSeconds(600);
src\Shared\Process\ProcessExtensions.cs (6)
14private static readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30); 18public static void KillTree(this Process process, TimeSpan timeout) 41private static void GetAllChildIdsUnix(int parentId, ISet<int> children, TimeSpan timeout) 79private static void KillProcessUnix(int processId, TimeSpan timeout) 95private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout, out string stdout)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (12)
IISDeployer.cs (5)
23private static readonly TimeSpan _timeout = TimeSpan.FromSeconds(60); 24private static readonly TimeSpan _retryDelay = TimeSpan.FromMilliseconds(100); 474var delay = _retryDelay;
IISDeploymentResult.cs (1)
42Timeout = TimeSpan.FromSeconds(200),
IISExpressDeployer.cs (4)
26private readonly TimeSpan ShutdownTimeSpan = Debugger.IsAttached ? TimeSpan.FromMinutes(60) : TimeSpan.FromMinutes(2); 243if (!await started.Task.TimeoutAfter(TimeSpan.FromMinutes(15)))
RetryHandler.cs (2)
13private static readonly TimeSpan RetryDelay = TimeSpan.FromSeconds(1);
Microsoft.AspNetCore.Server.Kestrel.Core (88)
Features\IConnectionTimeoutFeature.cs (6)
12/// Close the connection after the specified positive finite <see cref="TimeSpan"/> 15void SetTimeout(TimeSpan timeSpan); 18/// Close the connection after the specified positive finite <see cref="TimeSpan"/> 21void ResetTimeout(TimeSpan timeSpan); 24/// Prevent the connection from closing after a timeout specified by <see cref="SetTimeout(TimeSpan)"/> 25/// or <see cref="ResetTimeout(TimeSpan)"/>.
Http2Limits.cs (11)
21private TimeSpan _keepAlivePingDelay = TimeSpan.MaxValue; 22private TimeSpan _keepAlivePingTimeout = TimeSpan.FromSeconds(20); 154/// Delay value must be greater than or equal to 1 second. Set to <see cref="TimeSpan.MaxValue"/> to 156/// Defaults to <see cref="TimeSpan.MaxValue"/>. 159public TimeSpan KeepAlivePingDelay 170_keepAlivePingDelay = value != Timeout.InfiniteTimeSpan ? value : TimeSpan.MaxValue; 179/// Timeout must be greater than or equal to 1 second. Set to <see cref="TimeSpan.MaxValue"/> to 184public TimeSpan KeepAlivePingTimeout 195_keepAlivePingTimeout = value != Timeout.InfiniteTimeSpan ? value : TimeSpan.MaxValue;
HttpsConnectionAdapterOptions.cs (6)
18internal static TimeSpan DefaultHandshakeTimeout = TimeSpan.FromSeconds(10); 20private TimeSpan _handshakeTimeout; 112public TimeSpan HandshakeTimeout 117if (value <= TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) 121_handshakeTimeout = value != Timeout.InfiniteTimeSpan ? value : TimeSpan.MaxValue;
Internal\Http2\Http2Connection.cs (3)
63private readonly TimeSpan StreamPoolExpiry = TimeSpan.FromSeconds(5); 174if (http2Limits.KeepAlivePingDelay != TimeSpan.MaxValue)
Internal\Http2\Http2KeepAlive.cs (3)
35public Http2KeepAlive(TimeSpan keepAliveInterval, TimeSpan keepAliveTimeout, TimeProvider timeProvider) 38_keepAliveTimeout = keepAliveTimeout == TimeSpan.MaxValue ? long.MaxValue
Internal\Infrastructure\Constants.cs (2)
32public static readonly TimeSpan RequestBodyDrainTimeout = TimeSpan.FromSeconds(5);
Internal\Infrastructure\Heartbeat.cs (5)
11public static readonly TimeSpan Interval = TimeSpan.FromSeconds(1); 17private readonly TimeSpan _interval; 21public Heartbeat(IHeartbeatHandler[] callbacks, TimeProvider timeProvider, IDebugger debugger, KestrelTrace trace, TimeSpan interval) 56var duration = _timeProvider.GetElapsedTime(now);
Internal\Infrastructure\ITimeoutControl.cs (2)
12void SetTimeout(TimeSpan timeout, TimeoutReason timeoutReason); 13void ResetTimeout(TimeSpan timeout, TimeoutReason timeoutReason);
Internal\Infrastructure\KestrelEventSource.cs (2)
311DisplayRateTimeScale = TimeSpan.FromSeconds(1) 322DisplayRateTimeScale = TimeSpan.FromSeconds(1)
Internal\Infrastructure\KestrelMetrics.cs (2)
142var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp); 318var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp);
Internal\Infrastructure\KestrelTrace.General.cs (4)
21public void HeartbeatSlow(TimeSpan heartbeatDuration, TimeSpan interval, DateTimeOffset now) 86public static partial void HeartbeatSlow(ILogger logger, DateTimeOffset now, TimeSpan heartbeatDuration, TimeSpan interval);
Internal\Infrastructure\TimeExtensions.cs (8)
8public static long ToTicks(this TimeSpan timeSpan, TimeProvider timeProvider) 11public static long ToTicks(this TimeSpan timeSpan, long tickFrequency) 13if (timeSpan < TimeSpan.Zero) 17if (timeSpan == TimeSpan.MaxValue) 21if (tickFrequency == TimeSpan.TicksPerSecond) 27return (long)(timeSpan.Ticks * ((double)tickFrequency / TimeSpan.TicksPerSecond)); 31public static long GetTimestamp(this TimeProvider timeProvider, TimeSpan timeSpan) 36public static long GetTimestamp(this TimeProvider timeProvider, long timeStamp, TimeSpan timeSpan)
Internal\Infrastructure\TimeoutControl.cs (8)
167public void SetTimeout(TimeSpan timeout, TimeoutReason timeoutReason) 174public void ResetTimeout(TimeSpan timeout, TimeoutReason timeoutReason) 186private void AssignTimeout(TimeSpan timeout, TimeoutReason timeoutReason) 290var ticksToCompleteWriteAtMinRate = TimeSpan.FromSeconds(count / minRate.BytesPerSecond).ToTicks(_timeProvider); 312void IConnectionTimeoutFeature.SetTimeout(TimeSpan timeSpan) 314if (timeSpan < TimeSpan.Zero) 326void IConnectionTimeoutFeature.ResetTimeout(TimeSpan timeSpan) 328if (timeSpan < TimeSpan.Zero)
Internal\KestrelServerImpl.cs (1)
362cts.CancelAfter(TimeSpan.FromSeconds(5));
KestrelServerLimits.cs (12)
37private TimeSpan _keepAliveTimeout = TimeSpan.FromSeconds(130); 39private TimeSpan _requestHeadersTimeout = TimeSpan.FromSeconds(30); 176public TimeSpan KeepAliveTimeout 181if (value <= TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) 185_keepAliveTimeout = value != Timeout.InfiniteTimeSpan ? value : TimeSpan.MaxValue; 195public TimeSpan RequestHeadersTimeout 200if (value <= TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) 204_requestHeadersTimeout = value != Timeout.InfiniteTimeSpan ? value : TimeSpan.MaxValue; 360new MinDataRate(bytesPerSecond: 240, gracePeriod: TimeSpan.FromSeconds(5)); 384new MinDataRate(bytesPerSecond: 240, gracePeriod: TimeSpan.FromSeconds(5));
ListenOptionsHttpsExtensions.cs (1)
231public static ListenOptions UseHttps(this ListenOptions listenOptions, ServerOptionsSelectionCallback serverOptionsSelectionCallback, object state, TimeSpan handshakeTimeout)
Middleware\HttpsConnectionMiddleware.cs (1)
33private readonly TimeSpan _handshakeTimeout;
MinDataRate.cs (2)
19public MinDataRate(double bytesPerSecond, TimeSpan gracePeriod) 44public TimeSpan GracePeriod { get; }
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
276TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
TlsHandshakeCallbackOptions.cs (4)
14private TimeSpan _handshakeTimeout = HttpsConnectionAdapterOptions.DefaultHandshakeTimeout; 30public TimeSpan HandshakeTimeout 35if (value <= TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) 39_handshakeTimeout = value != Timeout.InfiniteTimeSpan ? value : TimeSpan.MaxValue;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (131)
DateHeaderValueManagerTests.cs (2)
48timeProvider.Advance(TimeSpan.FromSeconds(10)); 99timeProvider.Advance(TimeSpan.FromSeconds(10));
DiagnosticMemoryPoolTests.cs (2)
184await memoryPool.WhenAllBlocksReturnedAsync(TimeSpan.FromSeconds(5)); 198var aggregateException = await Assert.ThrowsAsync<AggregateException>(async () => await memoryPool.WhenAllBlocksReturnedAsync(TimeSpan.FromSeconds(5)));
HeartbeatTests.cs (8)
19Assert.Equal(TimeSpan.FromSeconds(1), Heartbeat.Interval); 33var splits = new List<TimeSpan>(); 44var split = sw.Elapsed; 67using (var heartbeat = new Heartbeat(new[] { heartbeatHandler.Object }, timeProvider, debugger.Object, kestrelTrace, TimeSpan.FromMilliseconds(intervalMs))) 110var heartbeatDuration = TimeSpan.FromSeconds(2); 129timeProvider.Advance(TimeSpan.FromSeconds(2)); 172timeProvider.Advance(TimeSpan.FromSeconds(2));
Http1\Http1ConnectionTests.cs (6)
166_http1Connection.MinRequestBodyDataRate = new MinDataRate(bytesPerSecond: 1, gracePeriod: TimeSpan.MaxValue); 176_http1Connection.MinResponseDataRate = new MinDataRate(bytesPerSecond: 1, gracePeriod: TimeSpan.MaxValue); 575var expectedKeepAliveTimeout = _serviceContext.ServerOptions.Limits.KeepAliveTimeout; 928await requestProcessingTask.TimeoutAfter(TimeSpan.FromSeconds(10)); 1091private static async Task WaitForCondition(TimeSpan timeout, Func<bool> condition) 1186new MinDataRate(bytesPerSecond: 1, gracePeriod: TimeSpan.MaxValue)
Http2\Http2HttpProtocolFeatureCollectionTests.cs (1)
55Assert.Throws<NotSupportedException>(() => minRateFeature.MinDataRate = new MinDataRate(1, TimeSpan.FromSeconds(2)));
Http3\Http3HttpProtocolFeatureCollectionTests.cs (1)
55Assert.Throws<NotSupportedException>(() => minRateFeature.MinDataRate = new MinDataRate(1, TimeSpan.FromSeconds(2)));
KestrelServerLimitsTests.cs (19)
153Assert.Equal(TimeSpan.FromSeconds(130), new KestrelServerLimits().KeepAliveTimeout); 158public void KeepAliveTimeoutValid(TimeSpan value) 166Assert.Equal(TimeSpan.MaxValue, new KestrelServerLimits { KeepAliveTimeout = Timeout.InfiniteTimeSpan }.KeepAliveTimeout); 171public void KeepAliveTimeoutInvalid(TimeSpan value) 182Assert.Equal(TimeSpan.FromSeconds(30), new KestrelServerLimits().RequestHeadersTimeout); 187public void RequestHeadersTimeoutValid(TimeSpan value) 195Assert.Equal(TimeSpan.MaxValue, new KestrelServerLimits { RequestHeadersTimeout = Timeout.InfiniteTimeSpan }.RequestHeadersTimeout); 200public void RequestHeadersTimeoutInvalid(TimeSpan value) 299Assert.Equal(TimeSpan.FromSeconds(5), new KestrelServerLimits().MinRequestBodyDataRate.GracePeriod); 307Assert.Equal(TimeSpan.FromSeconds(5), new KestrelServerLimits().MinResponseDataRate.GracePeriod); 357public static TheoryData<TimeSpan> TimeoutValidData => new TheoryData<TimeSpan> 359TimeSpan.FromTicks(1), 360TimeSpan.MaxValue, 363public static TheoryData<TimeSpan> TimeoutInvalidData => new TheoryData<TimeSpan> 365TimeSpan.MinValue, 366TimeSpan.FromTicks(-1), 367TimeSpan.Zero
KestrelServerTests.cs (2)
647var timeout = TestConstants.DefaultTimeout; 745testContext.FakeTimeProvider.Advance(TimeSpan.FromDays(1));
MinDataRateTests.cs (13)
17Assert.Equal(value, new MinDataRate(bytesPerSecond: value, gracePeriod: TimeSpan.MaxValue).BytesPerSecond); 26var exception = Assert.Throws<ArgumentOutOfRangeException>(() => new MinDataRate(bytesPerSecond: value, gracePeriod: TimeSpan.MaxValue)); 34public void GracePeriodValid(TimeSpan value) 41public void GracePeriodInvalid(TimeSpan value) 49public static TheoryData<TimeSpan> GracePeriodValidData => new TheoryData<TimeSpan> 51Heartbeat.Interval + TimeSpan.FromTicks(1), 52TimeSpan.MaxValue 55public static TheoryData<TimeSpan> GracePeriodInvalidData => new TheoryData<TimeSpan> 57TimeSpan.MinValue, 58TimeSpan.FromTicks(-1), 59TimeSpan.Zero,
PinnedBlockMemoryPoolFactoryTests.cs (6)
91timeProvider.Advance(TimeSpan.FromSeconds(10)); 97timeProvider.Advance(TimeSpan.FromSeconds(10)); 112var maxWait = TimeSpan.FromSeconds(5); 113while (pool.BlockCount() > previousCount - (previousCount / 30) && maxWait > TimeSpan.Zero) 116maxWait -= TimeSpan.FromMilliseconds(50);
PinnedBlockMemoryPoolTests.cs (7)
206var maxWait = TimeSpan.FromSeconds(5); 207while (memoryPool.BlockCount() > previousCount - (previousCount / 30) && maxWait > TimeSpan.Zero) 210maxWait -= TimeSpan.FromMilliseconds(50); 221maxWait = TimeSpan.FromSeconds(5); 222while (memoryPool.BlockCount() > previousCount - (previousCount / 30) && maxWait > TimeSpan.Zero) 225maxWait -= TimeSpan.FromMilliseconds(50);
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (4)
157TimeSpan.FromMinutes(1), 172TimeSpan.FromSeconds(2), 181TimeSpan.FromSeconds(1), 240TimeSpan nestingBuffer,
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
32public TimeSpan ResponseDelay { get; set; }
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (2)
18private static readonly TimeSpan Timeout = TimeSpan.FromMinutes(1);
src\Servers\Kestrel\shared\test\TestConstants.cs (2)
11public static TimeSpan DefaultTimeout = TimeSpan.FromSeconds(30);
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
71public TimeSpan ShutdownTimeout { get; set; }
TimeoutControlTests.cs (53)
33_timeoutControl.SetTimeout(TimeSpan.FromTicks(1), TimeoutReason.RequestHeaders); 63var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(2)); 94var gracePeriod = TimeSpan.FromSeconds(2); 155var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(2)); 164_timeProvider.Advance(TimeSpan.FromSeconds(1)); 166_timeProvider.Advance(TimeSpan.FromSeconds(1)); 168_timeProvider.Advance(TimeSpan.FromSeconds(1)); 173_timeProvider.Advance(TimeSpan.FromSeconds(0.5)); 177_timeProvider.Advance(TimeSpan.FromSeconds(0.5)); 181_timeProvider.Advance(TimeSpan.FromSeconds(2)); 188_timeProvider.Advance(TimeSpan.FromSeconds(0.5)); 192_timeProvider.Advance(TimeSpan.FromSeconds(1.0)); 194_timeProvider.Advance(TimeSpan.FromSeconds(.5)); 201_timeProvider.Advance(TimeSpan.FromSeconds(1)); 211var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(2)); 220_timeProvider.Advance(TimeSpan.FromSeconds(1)); 222_timeProvider.Advance(TimeSpan.FromSeconds(1)); 230_timeProvider.Advance(TimeSpan.FromSeconds(0.25)); 234_timeProvider.Advance(TimeSpan.FromSeconds(0.25)); 238_timeProvider.Advance(TimeSpan.FromSeconds(0.5)); 246_timeProvider.Advance(TimeSpan.FromSeconds(1)); 256var timeout = TimeSpan.FromSeconds(5); 257var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(2)); 268_timeProvider.Advance(TimeSpan.FromSeconds(3)); 276_timeProvider.Advance(TimeSpan.FromSeconds(2) + Heartbeat.Interval + TimeSpan.FromTicks(1)); 286var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(2)); 334var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(2)); 373var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(2)); 383AdvanceClock(TimeSpan.FromSeconds(4) + Heartbeat.Interval + TimeSpan.FromTicks(1)); 391var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(5)); 401AdvanceClock(TimeSpan.FromSeconds(1) + Heartbeat.Interval + TimeSpan.FromTicks(1)); 407AdvanceClock(minRate.GracePeriod - TimeSpan.FromSeconds(1)); 415var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(2)); 429AdvanceClock(TimeSpan.FromSeconds(5) + Heartbeat.Interval + TimeSpan.FromTicks(1)); 438AdvanceClock(TimeSpan.FromSeconds(3)); 446var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(5)); 465AdvanceClock(Heartbeat.Interval + minRate.GracePeriod + TimeSpan.FromSeconds((numWrites - 1) * writeSize / minRate.BytesPerSecond)); 470_timeProvider.Advance(TimeSpan.FromTicks(1)); 479var minRate = new MinDataRate(bytesPerSecond: 100, gracePeriod: TimeSpan.FromSeconds(2)); 489_timeProvider.Advance(TimeSpan.FromSeconds(4) + Heartbeat.Interval + TimeSpan.FromTicks(1)); 495AdvanceClock(TimeSpan.FromSeconds(4) + TimeSpan.FromTicks(1)); 502var gracePeriod = TimeSpan.FromSeconds(5); 515_timeProvider.Advance(TimeSpan.FromSeconds(1)); 520private void AdvanceClock(TimeSpan timeSpan)
TlsListenerTests.cs (1)
70var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(3));
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (4)
Mocks\MockTimeoutControl.cs (2)
36public void ResetTimeout(TimeSpan timeout, TimeoutReason timeoutReason) 40public void SetTimeout(TimeSpan timeout, TimeoutReason timeoutReason)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
201public void AdvanceTime(TimeSpan timeSpan) 218public void TriggerTick(TimeSpan timeSpan = default)
Microsoft.AspNetCore.Server.Kestrel.Tests (15)
HttpsConnectionAdapterOptionsTest.cs (13)
17Assert.Equal(TimeSpan.FromSeconds(10), new HttpsConnectionAdapterOptions().HandshakeTimeout); 22public void HandshakeTimeoutValid(TimeSpan value) 30Assert.Equal(TimeSpan.MaxValue, new HttpsConnectionAdapterOptions { HandshakeTimeout = Timeout.InfiniteTimeSpan }.HandshakeTimeout); 35public void HandshakeTimeoutInvalid(TimeSpan value) 43public static TheoryData<TimeSpan> TimeoutValidData => new TheoryData<TimeSpan> 45TimeSpan.FromTicks(1), 46TimeSpan.MaxValue, 49public static TheoryData<TimeSpan> TimeoutInvalidData => new TheoryData<TimeSpan> 51TimeSpan.MinValue, 52TimeSpan.FromTicks(-1), 53TimeSpan.Zero
KestrelConfigurationLoaderTests.cs (2)
1174await fileTcs.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); // Needs to be meaningfully longer than the polling period - 4 seconds 1179await Task.Delay(TimeSpan.FromSeconds(1));
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (3)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (3)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
QuicConnectionContextTests.cs (3)
530timeProvider.Advance(TimeSpan.FromSeconds(0.1)); 544timeProvider.Advance(TimeSpan.FromSeconds(QuicConnectionContext.StreamPoolExpirySeconds)); 549timeProvider.Advance(TimeSpan.FromTicks(1));
Microsoft.AspNetCore.Session (13)
DistributedSession.cs (4)
28private readonly TimeSpan _idleTimeout; 29private readonly TimeSpan _ioTimeout; 60TimeSpan idleTimeout, 61TimeSpan ioTimeout,
DistributedSessionStore.cs (2)
33public ISession Create(string sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> tryEstablishSession, bool isNewSessionKey)
ISessionStore.cs (2)
30ISession Create(string sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> tryEstablishSession, bool isNewSessionKey);
SessionOptions.cs (5)
38public TimeSpan IdleTimeout { get; set; } = TimeSpan.FromMinutes(20); 44public TimeSpan IOTimeout { get; set; } = TimeSpan.FromMinutes(1); 59public override TimeSpan? Expiration
Microsoft.AspNetCore.Session.Tests (10)
SessionTests.cs (10)
411services.AddSession(o => o.IdleTimeout = TimeSpan.FromMilliseconds(30)); 480services.AddSession(o => o.IdleTimeout = TimeSpan.FromMinutes(20)); 500clock.Add(TimeSpan.FromMinutes(10)); 752IOTimeout = TimeSpan.FromSeconds(0.5) 914IOTimeout = TimeSpan.FromSeconds(0.5) 1134UtcNow = new DateTimeOffset(2013, 1, 1, 1, 0, 0, TimeSpan.Zero); 1139public void Add(TimeSpan timespan) 1178token.WaitHandle.WaitOne(TimeSpan.FromSeconds(10)); 1194token.WaitHandle.WaitOne(TimeSpan.FromSeconds(10)); 1214token.WaitHandle.WaitOne(TimeSpan.FromSeconds(10));
Microsoft.AspNetCore.Shared.Tests (6)
NonCapturingTimerTest.cs (1)
27}, state: null, dueTime: TimeSpan.FromMilliseconds(1), Timeout.InfiniteTimeSpan);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
207public bool TryGetElapsedTime(HttpSysRequestTimingType startingTimestampType, HttpSysRequestTimingType endingTimestampType, out TimeSpan elapsed)
src\Shared\NonCapturingTimer\NonCapturingTimer.cs (2)
16public static Timer Create(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
Microsoft.AspNetCore.SignalR (1)
SignalRDependencyInjectionExtensions.cs (1)
44services.Configure<WebSocketOptions>(o => o.KeepAliveInterval = TimeSpan.Zero);
Microsoft.AspNetCore.SignalR.Client.Core (46)
HubConnection.cs (15)
47public static readonly TimeSpan DefaultServerTimeout = TimeSpan.FromSeconds(30); // Server ping rate is 15 sec, this is 2 times that. 52public static readonly TimeSpan DefaultHandshakeTimeout = TimeSpan.FromSeconds(15); 57public static readonly TimeSpan DefaultKeepAliveInterval = TimeSpan.FromSeconds(15); 164internal TimeSpan TickRate { get; set; } = TimeSpan.FromSeconds(1); 172public TimeSpan ServerTimeout { get; set; } 180public TimeSpan KeepAliveInterval { get; set; } 185public TimeSpan HandshakeTimeout { get; set; } = DefaultHandshakeTimeout; 1815var nextRetryDelay = GetNextRetryDelay(previousReconnectAttempts, TimeSpan.Zero, retryReason); 1917var elapsedTime = DateTime.UtcNow - reconnectStartTime; 1931private TimeSpan? GetNextRetryDelay(long previousRetryCount, TimeSpan elapsedTime, Exception? retryReason)
HubConnection.Log.cs (5)
198public static void StartingServerTimeoutTimer(ILogger logger, TimeSpan serverTimeout) 267public static partial void Reconnected(ILogger logger, long reconnectAttempts, TimeSpan elapsedTime); 270public static partial void ReconnectAttemptsExhausted(ILogger logger, long reconnectAttempts, TimeSpan elapsedTime); 273public static partial void AwaitingReconnectRetryDelay(ILogger logger, long reconnectAttempts, TimeSpan retryDelay); 302public static void ErrorHandshakeTimedOut(ILogger logger, TimeSpan handshakeTimeout, Exception exception)
HubConnectionBuilderExtensions.cs (3)
49public static IHubConnectionBuilder WithAutomaticReconnect(this IHubConnectionBuilder hubConnectionBuilder, TimeSpan[] reconnectDelays) 73public static IHubConnectionBuilder WithServerTimeout(this IHubConnectionBuilder hubConnectionBuilder, TimeSpan timeout) 85public static IHubConnectionBuilder WithKeepAliveInterval(this IHubConnectionBuilder hubConnectionBuilder, TimeSpan interval)
HubConnectionOptions.cs (2)
20public TimeSpan ServerTimeout { get; set; } = HubConnection.DefaultServerTimeout; 25public TimeSpan KeepAliveInterval { get; set; } = HubConnection.DefaultKeepAliveInterval;
Internal\DefaultRetryPolicy.cs (10)
10internal static TimeSpan?[] DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = new TimeSpan?[] 12TimeSpan.Zero, 13TimeSpan.FromSeconds(2), 14TimeSpan.FromSeconds(10), 15TimeSpan.FromSeconds(30), 19private readonly TimeSpan?[] _retryDelays; 26public DefaultRetryPolicy(TimeSpan[] retryDelays) 28_retryDelays = new TimeSpan?[retryDelays.Length + 1]; 36public TimeSpan? NextRetryDelay(RetryContext retryContext)
IRetryPolicy.cs (2)
22/// A <see cref="TimeSpan"/> representing the amount of time to wait from now before starting the next reconnect attempt. 25TimeSpan? NextRetryDelay(RetryContext retryContext);
RetryContext.cs (1)
22public TimeSpan ElapsedTime { get; set; }
src\Shared\NonCapturingTimer\NonCapturingTimer.cs (2)
16public static Timer Create(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
src\SignalR\common\Shared\MessageBuffer.cs (2)
23public static TimeSpan AckRate => TimeSpan.FromSeconds(1);
src\SignalR\common\Shared\TimerAwaitable.cs (4)
19private readonly TimeSpan _period; 21private readonly TimeSpan _dueTime; 26public TimerAwaitable(TimeSpan dueTime, TimeSpan period)
Microsoft.AspNetCore.SignalR.Client.Tests (48)
HttpConnectionFactoryTests.cs (1)
94{ $"{nameof(HttpConnectionOptions.CloseTimeout)}", TimeSpan.FromDays(1) },
HttpConnectionTests.cs (1)
36Assert.Equal(TimeSpan.FromSeconds(5), httpOptions.CloseTimeout);
HubConnectionBuilderTests.cs (8)
84var serverTimeout = TimeSpan.FromMinutes(1); 97var keepAliveInterval = TimeSpan.FromMinutes(1); 110var serverTimeout = TimeSpan.FromMinutes(2); 111var keepAliveInterval = TimeSpan.FromMinutes(3);
HubConnectionTests.ConnectionLifecycle.cs (1)
514hubConnection.HandshakeTimeout = TimeSpan.FromMilliseconds(1);
HubConnectionTests.cs (3)
356hubConnection.ServerTimeout = TimeSpan.FromMilliseconds(100); 382hubConnection.ServerTimeout = TimeSpan.FromMilliseconds(1); 414hubConnection.ServerTimeout = TimeSpan.FromMilliseconds(2000);
HubConnectionTests.Protocol.cs (4)
661hubConnection.TickRate = TimeSpan.FromMilliseconds(30); 662hubConnection.KeepAliveInterval = TimeSpan.FromMilliseconds(80); 687hubConnection.TickRate = TimeSpan.FromMilliseconds(30); 688hubConnection.KeepAliveInterval = TimeSpan.FromMilliseconds(80);
HubConnectionTests.Reconnect.cs (27)
120return TimeSpan.Zero; 162Assert.Equal(TimeSpan.Zero, retryContexts[0].ElapsedTime); 172Assert.True(TimeSpan.Zero <= retryContexts[1].ElapsedTime); 221return context.PreviousRetryCount == 0 ? TimeSpan.Zero : (TimeSpan?)null; 259Assert.Equal(TimeSpan.Zero, retryContexts[0].ElapsedTime); 270Assert.True(TimeSpan.Zero <= retryContexts[1].ElapsedTime); 316return context.PreviousRetryCount == 0 ? TimeSpan.Zero : (TimeSpan?)null; 396return TimeSpan.Zero; 436Assert.Equal(TimeSpan.Zero, retryContexts[0].ElapsedTime); 454Assert.Equal(TimeSpan.Zero, retryContexts[1].ElapsedTime); 494return TimeSpan.Zero; 542Assert.Equal(TimeSpan.Zero, retryContexts[0].ElapsedTime); 581return TimeSpan.Zero; 633mockReconnectPolicy.Setup(p => p.NextRetryDelay(It.IsAny<RetryContext>())).Returns<TimeSpan?>(null); 688mockReconnectPolicy.Setup(p => p.NextRetryDelay(It.IsAny<RetryContext>())).Returns<TimeSpan?>(null); 757return TimeSpan.Zero; 803Assert.Equal(TimeSpan.Zero, retryContexts[0].ElapsedTime); 813Assert.True(TimeSpan.Zero <= retryContexts[0].ElapsedTime); 864return TimeSpan.Zero; 910Assert.Equal(TimeSpan.Zero, retryContexts[0].ElapsedTime); 932Assert.True(TimeSpan.Zero <= retryContexts[0].ElapsedTime); 990return TimeSpan.Zero; 1030Assert.Equal(TimeSpan.Zero, retryContexts[0].ElapsedTime); 1068return TimeSpan.FromMinutes(1); 1107Assert.Equal(TimeSpan.Zero, retryContexts[0].ElapsedTime);
TimerAwaitableTests.cs (2)
45_timer = new TimerAwaitable(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(1));
WebSocketsTransportTests.cs (1)
25CloseTimeout = TimeSpan.FromMilliseconds(1),
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Internal\Protocol\MessagePackHubProtocolTests.cs (1)
60var dateTimeOffset = new DateTimeOffset(new DateTime(2018, 4, 9), TimeSpan.FromHours(10));
Microsoft.AspNetCore.SignalR.Core (21)
HubConnectionContext.cs (6)
32private readonly TimeSpan _keepAliveInterval; 33private readonly TimeSpan _clientTimeoutInterval; 51private TimeSpan _receivedMessageElapsed; 493internal async Task<bool> HandshakeAsync(TimeSpan timeout, IReadOnlyList<string>? supportedProtocols, IHubProtocolResolver protocolResolver, 672var elapsed = _timeProvider.GetElapsedTime(Volatile.Read(ref _lastSendTick), currentTime); 776_receivedMessageElapsed = TimeSpan.Zero;
HubConnectionContext.Log.cs (1)
37public static partial void ClientTimeout(ILogger logger, TimeSpan clientTimeout);
HubConnectionContextOptions.cs (2)
14public TimeSpan KeepAliveInterval { get; set; } 19public TimeSpan ClientTimeoutInterval { get; set; }
HubConnectionHandler.cs (1)
119var handshakeTimeout = _hubOptions.HandshakeTimeout ?? _globalHubOptions.HandshakeTimeout ?? HubOptionsSetup.DefaultHandshakeTimeout;
HubOptions.cs (3)
24public TimeSpan? HandshakeTimeout { get; set; } 29public TimeSpan? KeepAliveInterval { get; set; } 34public TimeSpan? ClientTimeoutInterval { get; set; }
HubOptionsSetup.cs (6)
15internal static TimeSpan DefaultHandshakeTimeout => TimeSpan.FromSeconds(15); 17internal static TimeSpan DefaultKeepAliveInterval => TimeSpan.FromSeconds(15); 19internal static TimeSpan DefaultClientTimeoutInterval => TimeSpan.FromSeconds(30);
src\SignalR\common\Shared\MessageBuffer.cs (2)
23public static TimeSpan AckRate => TimeSpan.FromSeconds(1);
Microsoft.AspNetCore.SignalR.Microbenchmarks (6)
DefaultHubDispatcherBenchmark.cs (1)
47KeepAliveInterval = TimeSpan.Zero,
DefaultHubLifetimeManagerBenchmark.cs (1)
53KeepAliveInterval = TimeSpan.Zero,
HubConnectionContextBenchmark.cs (2)
59await _hubConnectionContext.HandshakeAsync(TimeSpan.FromSeconds(5), _supportedProtocols, _successHubProtocolResolver, 68await _hubConnectionContext.HandshakeAsync(TimeSpan.FromSeconds(5), _supportedProtocols, _failureHubProtocolResolver,
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
Microsoft.AspNetCore.SignalR.Specification.Tests (19)
Internal\TaskExtensions.cs (3)
13public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 36public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 60private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
src\Shared\TaskExtensions.cs (13)
32public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 36return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 39public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 46return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 49public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 56return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 59public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 66return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 69public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 75public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 109public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 143private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
src\SignalR\common\testassets\Tests.Utils\HubConnectionContextUtils.cs (3)
21KeepAliveInterval = TimeSpan.FromSeconds(15), 35KeepAliveInterval = TimeSpan.FromSeconds(15), 36ClientTimeoutInterval = TimeSpan.FromSeconds(15),
Microsoft.AspNetCore.SignalR.StackExchangeRedis (5)
Internal\AckHandler.cs (3)
13private readonly long _ackThreshold = (long)TimeSpan.FromSeconds(30).TotalMilliseconds; 14private readonly TimeSpan _ackInterval = TimeSpan.FromSeconds(5);
src\Shared\NonCapturingTimer\NonCapturingTimer.cs (2)
16public static Timer Create(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (16)
Docker.cs (14)
87RunProcessAndWait(_path, $"stop {_dockerContainerName}", "docker stop", logger, TimeSpan.FromSeconds(15), out var _); 92var wait = TimeSpan.FromSeconds(30); 97RunProcessAndWait(_path, $"logs {_dockerContainerName}", "docker logs", logger, TimeSpan.FromSeconds(5), out var logOutput); 116RunProcessAndThrowIfFailed(_path, $"run --rm -p 6379:6379 --name {_dockerContainerName} -d {_redisImageName}", "redis", logger, TimeSpan.FromMinutes(1)); 125RunProcessAndWait(_path, $"stop {_dockerMonitorContainerName}", "docker stop", logger, TimeSpan.FromSeconds(15), out var _); 126RunProcessAndWait(_path, $"stop {_dockerContainerName}", "docker stop", logger, TimeSpan.FromSeconds(15), out var output); 132RunProcessAndWait(_path, "inspect --format=\"{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}\" " + _dockerContainerName, "docker ipaddress", logger, TimeSpan.FromSeconds(5), out output); 146RunProcessAndThrowIfFailed(_path, $"logs {_dockerContainerName}", "docker logs", logger, TimeSpan.FromSeconds(5)); 149RunProcessAndWait(_path, $"stop {_dockerMonitorContainerName}", "docker stop", logger, TimeSpan.FromSeconds(15), out var _); 150RunProcessAndWait(_path, $"stop {_dockerContainerName}", "docker stop", logger, TimeSpan.FromSeconds(15), out var _); 158return RunProcessAndWait(_path, commandAndArguments, prefix, logger, TimeSpan.FromSeconds(30), out output); 161private static void RunProcessAndThrowIfFailed(string fileName, string arguments, string prefix, ILogger logger, TimeSpan timeout) 171private static int RunProcessAndWait(string fileName, string arguments, string prefix, ILogger logger, TimeSpan timeout, out string output)
TestConnectionMultiplexer.cs (2)
332public TimeSpan Ping(CommandFlags flags = CommandFlags.None) 337public Task<TimeSpan> PingAsync(CommandFlags flags = CommandFlags.None)
Microsoft.AspNetCore.SignalR.Tests (22)
AddSignalRTests.cs (2)
148options.ClientTimeoutInterval = TimeSpan.FromSeconds(1); 164Assert.Equal(TimeSpan.FromSeconds(1), globalOptions.ClientTimeoutInterval);
HubConnectionHandlerTests.cs (19)
198options.HandshakeTimeout = TimeSpan.FromMilliseconds(5); 2697options.KeepAliveInterval = TimeSpan.FromMilliseconds(100)), LoggerFactory); 2739var interval = TimeSpan.FromMilliseconds(100); 2756timeProvider.Advance(interval + TimeSpan.FromMilliseconds(1)); 2801var timeout = TimeSpan.FromMilliseconds(100); 2818timeProvider.Advance(timeout + TimeSpan.FromMilliseconds(1)); 2837var timeout = TimeSpan.FromMilliseconds(100); 2851timeProvider.Advance(timeout + TimeSpan.FromMilliseconds(1)); 2864var timeout = TimeSpan.FromMilliseconds(100); 2884timeProvider.Advance(timeout + TimeSpan.FromMilliseconds(1)); 2900var timeout = TimeSpan.FromMilliseconds(300); 2916timeProvider.Advance(timeout - TimeSpan.FromMilliseconds(1)); 3014options.ClientTimeoutInterval = TimeSpan.FromMilliseconds(0); 3073options.ClientTimeoutInterval = TimeSpan.FromMilliseconds(0);
WebSocketsTransportTests.cs (1)
166await webSocketsTransport.Running.DefaultTimeout(TimeSpan.FromSeconds(10));
Microsoft.AspNetCore.SignalR.Tests.Utils (6)
HubConnectionContextUtils.cs (3)
21KeepAliveInterval = TimeSpan.FromSeconds(15), 35KeepAliveInterval = TimeSpan.FromSeconds(15), 36ClientTimeoutInterval = TimeSpan.FromSeconds(15),
src\Shared\SignalR\InProcessTestServer.cs (1)
115var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
Microsoft.AspNetCore.SpaProxy (4)
SpaDevelopmentServerOptions.cs (2)
26public TimeSpan MaxTimeout => TimeSpan.FromSeconds(MaxTimeoutInSeconds);
SpaProxyLaunchManager.cs (2)
78cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(10)); 109cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(10));
Microsoft.AspNetCore.SpaServices.Extensions (15)
AngularCli\AngularCliBuilder.cs (2)
23private static readonly TimeSpan RegexMatchTimeout = TimeSpan.FromSeconds(5); // This is a development-time only feature, so a very long timeout is fine
AngularCli\AngularCliMiddleware.cs (3)
21private static readonly TimeSpan RegexMatchTimeout = TimeSpan.FromSeconds(5); // This is a development-time only feature, so a very long timeout is fine 47var timeout = spaBuilder.Options.StartupTimeout;
Npm\NodeScriptRunner.cs (1)
23private static readonly Regex AnsiColorRegex = new Regex("\x001b\\[[0-9;]*m", RegexOptions.None, TimeSpan.FromSeconds(1));
Proxying\ConditionalProxyMiddleware.cs (1)
26TimeSpan requestTimeout,
Proxying\SpaProxy.cs (1)
40public static HttpClient CreateHttpClientForProxy(TimeSpan requestTimeout)
ReactDevelopmentServer\ReactDevelopmentServerMiddleware.cs (3)
21private static readonly TimeSpan RegexMatchTimeout = TimeSpan.FromSeconds(5); // This is a development-time only feature, so a very long timeout is fine 47var timeout = spaBuilder.Options.StartupTimeout;
SpaOptions.cs (2)
96public TimeSpan StartupTimeout { get; set; } = TimeSpan.FromSeconds(120);
Util\TaskTimeoutExtensions.cs (2)
8public static async Task WithTimeout(this Task task, TimeSpan timeoutDelay, string message) 20public static async Task<T> WithTimeout<T>(this Task<T> task, TimeSpan timeoutDelay, string message)
Microsoft.AspNetCore.StaticAssets.Tests (3)
StaticAssetsIntegrationTests.cs (3)
585new("Last-Modified", new DateTimeOffset(2023,03,03,0,0,0,TimeSpan.Zero).ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture)) 765Assert.Equal(response.Content.Headers.LastModified.Value.Offset, TimeSpan.Zero); 1086public DateTimeOffset LastModified => new(2023, 03, 03, 0, 0, 0, TimeSpan.Zero);
Microsoft.AspNetCore.StaticFiles.FunctionalTests (3)
StaticFileMiddlewareTests.cs (3)
111var trimmed = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, TimeSpan.Zero).ToUniversalTime(); 237var interval = TimeSpan.FromSeconds(15);
Microsoft.AspNetCore.StaticFiles.Tests (7)
CacheHeaderTests.cs (1)
172Assert.Equal(response.Content.Headers.LastModified.Value.Offset, TimeSpan.Zero);
RangeHeaderTests.cs (2)
172req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.Subtract(TimeSpan.FromDays(1)).ToString("r")); 191req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.Subtract(TimeSpan.FromDays(1)).ToString("r"));
StaticFileContextTest.cs (4)
43LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero) 69LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero) 98LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero) 125LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero)
Microsoft.AspNetCore.TestHost (9)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-rc.1.25420.121\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (8)
24private static readonly TimeSpan s_defaultWaitTimeout = SetupDefaultTimeout(); 26private static TimeSpan SetupDefaultTimeout() 35return TimeSpan.FromSeconds((int)timeoutInSeconds); 38return TimeSpan.FromMinutes(5); 63TimeSpan? waitTimeout = null, 122public static Func<string[], IServiceProvider?>? ResolveServiceProviderFactory(Assembly assembly, TimeSpan? waitTimeout = null) 200private readonly TimeSpan _waitTimeout; 209public HostingListener(string[] args, MethodInfo entryPoint, TimeSpan waitTimeout, bool stopApplication, Action<object>? configure, Action<Exception?>? entrypointCompleted)
TestServer.cs (1)
185Timeout = TimeSpan.FromSeconds(200),
Microsoft.AspNetCore.TestHost.Tests (5)
HttpContextBuilderTests.cs (1)
313Assert.True(c.RequestAborted.WaitHandle.WaitOne(TimeSpan.FromSeconds(10)));
TestClientTests.cs (2)
1062await Task.Delay(TimeSpan.FromSeconds(30), ctx.RequestAborted); 1078using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(1));
Utilities.cs (2)
11internal static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(15);
Microsoft.AspNetCore.Testing.Tests (2)
FakeCertificateFactoryTests.cs (2)
21Assert.True(DateTime.Now > certificate.NotBefore + TimeSpan.FromHours(1)); 22Assert.True(DateTime.Now < certificate.NotAfter - TimeSpan.FromHours(1));
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (1)
1378await changed.Task.TimeoutAfter(TimeSpan.FromSeconds(10));
WebHostTests.cs (1)
54await changed.Task.TimeoutAfter(TimeSpan.FromSeconds(10));
Microsoft.AspNetCore.WebSockets (11)
ExtendedWebSocketAcceptContext.cs (1)
26public new TimeSpan? KeepAliveInterval { get; set; }
WebSocketMiddleware.cs (2)
143TimeSpan keepAliveInterval = _options.KeepAliveInterval; 144TimeSpan keepAliveTimeout = _options.KeepAliveTimeout;
WebSocketOptions.cs (8)
11private TimeSpan _keepAliveTimeout = Timeout.InfiniteTimeSpan; 18KeepAliveInterval = TimeSpan.FromMinutes(2); 29public TimeSpan KeepAliveInterval { get; set; } 36/// <see cref="Timeout.InfiniteTimeSpan"/> and <see cref="TimeSpan.Zero"/> will disable the timeout. 39/// <see cref="TimeSpan"/> is less than <see cref="TimeSpan.Zero"/>. 41public TimeSpan KeepAliveTimeout 51ArgumentOutOfRangeException.ThrowIfLessThan(value, TimeSpan.Zero);
Microsoft.AspNetCore.WebSockets.ConformanceTests (4)
Autobahn\AutobahnTester.cs (2)
38var pinger = new Timer(state => Pinger((CancellationToken)state), pingCts.Token, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10));
AutobahnTests.cs (2)
15private static readonly TimeSpan TestTimeout = TimeSpan.FromMinutes(3);
Microsoft.AspNetCore.WebSockets.Tests (10)
AddWebSocketsTests.cs (5)
19o.KeepAliveInterval = TimeSpan.FromSeconds(1000); 20o.KeepAliveTimeout = TimeSpan.FromSeconds(1234); 27Assert.Equal(TimeSpan.FromSeconds(1000), socketOptions.KeepAliveInterval); 28Assert.Equal(TimeSpan.FromSeconds(1234), socketOptions.KeepAliveTimeout); 36Assert.Throws<ArgumentOutOfRangeException>(() => new WebSocketOptions() { KeepAliveTimeout = TimeSpan.FromMicroseconds(-1) });
KestrelWebSocketHelpers.cs (1)
71o.ShutdownTimeout = TimeSpan.FromSeconds(30);
WebSocketMiddlewareTests.cs (2)
821o.KeepAliveInterval = TimeSpan.FromMilliseconds(1); 822o.KeepAliveTimeout = TimeSpan.FromMilliseconds(1);
WebSocketPair.cs (2)
32clientSocket: WebSocket.CreateFromStream(clientStream, isServer: false, subProtocol: null, keepAliveInterval: TimeSpan.FromMinutes(2)), 33serverSocket: WebSocket.CreateFromStream(serverStream, isServer: true, subProtocol: null, keepAliveInterval: TimeSpan.FromMinutes(2)));
Microsoft.Bcl.TimeProvider (7)
System\Threading\Tasks\TimeProviderTaskExtensions.cs (7)
44/// <param name="delay">The <see cref="TimeSpan"/> to wait before completing the returned task, or <see cref="Timeout.InfiniteTimeSpan"/> to wait indefinitely.</param> 49public static Task Delay(this TimeProvider timeProvider, TimeSpan delay, CancellationToken cancellationToken = default) 130public static Task WaitAsync(this Task task, TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken = default) 221public static Task<TResult> WaitAsync<TResult>(this Task<TResult> task, TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken = default) 231/// <summary>Initializes a new instance of the <see cref="CancellationTokenSource"/> class that will be canceled after the specified <see cref="TimeSpan"/>. </summary> 243/// If running on .NET versions earlier than .NET 8.0, there is a constraint when invoking <see cref="CancellationTokenSource.CancelAfter(TimeSpan)"/> on the resultant object. 247public static CancellationTokenSource CreateCancellationTokenSource(this TimeProvider timeProvider, TimeSpan delay)
Microsoft.Build.Framework (32)
BinaryReaderExtensions.cs (4)
129public static Dictionary<string, TimeSpan> ReadDurationDictionary(this BinaryReader reader) 132var durations = new Dictionary<string, TimeSpan>(count); 136TimeSpan value = TimeSpan.FromTicks(reader.ReadInt64());
BinaryTranslator.cs (2)
443public void Translate(ref TimeSpan value) 1286public void Translate(ref TimeSpan value)
BinaryWriterExtensions.cs (2)
133public static void WriteDurationsDictionary(this BinaryWriter writer, Dictionary<string, TimeSpan> durations) 136foreach (KeyValuePair<string, TimeSpan> kvp in durations)
BuildCheck\BuildCheckEventArgs.cs (3)
29internal BuildCheckTracingEventArgs(Dictionary<string, TimeSpan> executionData) 108TimeSpan totalRuntime = TimeSpan.FromTicks(reader.ReadInt64());
BuildCheck\BuildCheckRuleTelemetryData.cs (2)
34TimeSpan totalRuntime) : this(ruleId, checkFriendlyName, isBuiltIn, 83public TimeSpan TotalRuntime { get; set; }
BuildCheck\BuildCheckTracingData.cs (5)
17Dictionary<string, TimeSpan> infrastructureTracingData) 19public BuildCheckTracingData(IReadOnlyList<BuildCheckRuleTelemetryData> telemetryData, Dictionary<string, TimeSpan> infrastructureTracingData) 27internal BuildCheckTracingData(Dictionary<string, TimeSpan> executionData) 32public Dictionary<string, TimeSpan> InfrastructureTracingData { get; private set; } = infrastructureTracingData; 37public Dictionary<string, TimeSpan> ExtractCheckStats() =>
ITranslator.cs (1)
258void Translate(ref TimeSpan value);
Polyfills\StringSyntaxAttribute.cs (1)
61/// <summary>The syntax identifier for strings containing <see cref="TimeSpan"/> format specifiers.</summary>
Profiler\ProfilerResult.cs (6)
55public TimeSpan InclusiveTime { get; } 58public TimeSpan ExclusiveTime { get; } 64public ProfiledLocation(TimeSpan inclusiveTime, TimeSpan exclusiveTime, int numberOfHits) 84hashCode = (hashCode * -1521134295) + EqualityComparer<TimeSpan>.Default.GetHashCode(InclusiveTime); 85hashCode = (hashCode * -1521134295) + EqualityComparer<TimeSpan>.Default.GetHashCode(ExclusiveTime);
Telemetry\BuildCheckTelemetry.cs (1)
51TimeSpan totalRuntime = new TimeSpan(runtimeTicks);
Telemetry\TaskExecutionStats.cs (3)
11internal class TaskExecutionStats(TimeSpan cumulativeExecutionTime, int executionsCount, long totalMemoryConsumption) 14: this(TimeSpan.Zero, 0, 0) 27public TimeSpan CumulativeExecutionTime { get; set; } = cumulativeExecutionTime;
Telemetry\WorkerNodeTelemetryData.cs (1)
30public void AddTask(TaskOrTargetTelemetryKey task, TimeSpan cumulativeExectionTime, int executionsCount, long totalMemoryConsumption)
Telemetry\WorkerNodeTelemetryEventArgs.cs (1)
48TimeSpan.FromTicks(reader.ReadInt64()),
Microsoft.CodeAnalysis (93)
DiagnosticAnalyzer\AnalysisResultBuilder.cs (6)
29private readonly Dictionary<DiagnosticAnalyzer, TimeSpan>? _analyzerExecutionTimeOpt; 53private static Dictionary<DiagnosticAnalyzer, TimeSpan> CreateAnalyzerExecutionTimeMap(ImmutableArray<DiagnosticAnalyzer> analyzers) 55var map = new Dictionary<DiagnosticAnalyzer, TimeSpan>(analyzers.Length); 95public TimeSpan GetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) 290var timeSpan = driver.ResetAnalyzerExecutionTime(analyzer); 601var executionTime = _analyzerExecutionTimeOpt != null ? _analyzerExecutionTimeOpt[analyzer] : default;
DiagnosticAnalyzer\AnalyzerDriver.cs (3)
910if (AnalyzerExecutionTimes.TryGetValue(analyzer, out var analyzerExecutionTimeSpan)) 1448internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes => AnalyzerExecutor.AnalyzerExecutionTimes; 1449internal TimeSpan ResetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) => AnalyzerExecutor.ResetAnalyzerExecutionTime(analyzer);
DiagnosticAnalyzer\AnalyzerExecutor.cs (7)
49/// The values in this map convert to <see cref="TimeSpan"/> using <see cref="TimeSpan.FromTicks(long)"/>. 180internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes 185return _analyzerExecutionTimeMap.ToImmutableDictionary(pair => pair.Key, pair => TimeSpan.FromTicks(pair.Value.Value)); 1535internal TimeSpan ResetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) 1540return TimeSpan.Zero; 1543return TimeSpan.FromTicks(executionTime.Value);
DiagnosticAnalyzer\AnalyzerTelemetry.cs (3)
130public TimeSpan ExecutionTime { get; set; } = TimeSpan.Zero; 138internal AnalyzerTelemetryInfo(AnalyzerActionCounts actionCounts, int suppressionActionCounts, TimeSpan executionTime)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (2)
1284var executionTime = GetAnalyzerExecutionTime(analyzer); 1307private TimeSpan GetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer)
InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
SourceGeneration\GeneratorDriver.cs (4)
40_state = new GeneratorDriverState(parseOptions, optionsProvider, generators, incrementalGenerators, additionalTexts, ImmutableArray.Create(new GeneratorState[generators.Length]), DriverStateTable.Empty, SyntaxStore.Empty, driverOptions, runtime: TimeSpan.Zero); 218return _state.With(stateTable: DriverStateTable.Empty, runTime: TimeSpan.Zero); 381private static GeneratorState SetGeneratorException(Compilation compilation, CommonMessageProvider provider, GeneratorState generatorState, ISourceGenerator generator, Exception e, DiagnosticBag? diagnosticBag, CancellationToken cancellationToken, TimeSpan? runTime = null, bool isInit = false) 394return generatorState.WithError(e, filtered, runTime ?? TimeSpan.Zero);
SourceGeneration\GeneratorDriverState.cs (3)
23TimeSpan runtime) 100internal readonly TimeSpan RunTime; 114TimeSpan? runTime = null)
SourceGeneration\GeneratorState.cs (6)
30elapsedTime: TimeSpan.Zero); 45elapsedTime: TimeSpan.Zero) 59TimeSpan elapsedTime) 79TimeSpan elapsedTime) 93public GeneratorState WithError(Exception exception, Diagnostic error, TimeSpan elapsedTime) 119internal TimeSpan ElapsedTime { get; }
SourceGeneration\GeneratorTimerExtensions.cs (11)
30public static RunTimer CreateSingleGeneratorRunTimer(this CodeAnalysisEventSource eventSource, ISourceGenerator generator, Func<TimeSpan, TimeSpan> adjustRunTime) 48private readonly Action<TimeSpan>? _callback; 49private readonly Func<TimeSpan, TimeSpan>? _adjustRunTime; 51public TimeSpan Elapsed => _adjustRunTime is not null ? _adjustRunTime(_timer.Elapsed) : _timer.Elapsed; 60public RunTimer(Func<TimeSpan, TimeSpan>? adjustRunTime) 66public RunTimer(Action<TimeSpan> callback, Func<TimeSpan, TimeSpan>? adjustRunTime = null)
SourceGeneration\IncrementalGeneratorRunStep.cs (2)
16internal IncrementalGeneratorRunStep(string? stepName, ImmutableArray<(IncrementalGeneratorRunStep Source, int OutputIndex)> inputs, ImmutableArray<(object Value, IncrementalStepRunReason OutputState)> outputs, TimeSpan elapsedTime) 29public TimeSpan ElapsedTime { get; }
SourceGeneration\Nodes\CombineNode.cs (1)
97bool usedCachedEntry = builder.TryUseCachedEntries(TimeSpan.Zero, stepInputs);
SourceGeneration\Nodes\HostOutputNode.cs (2)
52nodeTable.TryRemoveEntries(TimeSpan.Zero, inputs); 54else if (entry.State != EntryState.Cached || !nodeTable.TryUseCachedEntries(TimeSpan.Zero, inputs))
SourceGeneration\Nodes\InputNode.cs (2)
48TimeSpan elapsedTime = stopwatch.Elapsed; 133tableBuilder.AddEntry(input, EntryState.Added, TimeSpan.Zero, stepInputs: default, EntryState.Added);
SourceGeneration\Nodes\NodeStateTable.cs (11)
194bool usedCachedEntry = builder.TryUseCachedEntries(TimeSpan.Zero, inputs); 269public bool TryRemoveEntries(TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs) 285public bool TryRemoveEntries(TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, out OneOrMany<T> entries) 297public bool TryUseCachedEntries(TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs) 312internal bool TryUseCachedEntries(TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, out TableEntry entry) 324public bool TryModifyEntry(T value, TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, EntryState overallInputState) 345public bool TryModifyEntries(ImmutableArray<T> outputs, TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, EntryState overallInputState) 437public bool TryModifyEntries(ImmutableArray<T> outputs, TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, EntryState overallInputState, out TableEntry entry) 449public void AddEntry(T value, EntryState state, TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, EntryState overallInputState) 456public TableEntry AddEntries(ImmutableArray<T> values, EntryState state, TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, EntryState overallInputState) 476private void RecordStepInfoForLastEntry(TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, EntryState overallInputState)
SourceGeneration\Nodes\PredicateSyntaxStrategy.cs (4)
72if (_filterTable.TryRemoveEntries(TimeSpan.Zero, noInputStepsStepInfo, out var removedNodes)) 75_transformTable.TryRemoveEntries(TimeSpan.Zero, noInputStepsStepInfo); 83if (state != EntryState.Cached || !_filterTable.TryUseCachedEntries(TimeSpan.Zero, noInputStepsStepInfo, out NodeStateTable<SyntaxNode>.TableEntry entry)) 99_transformTable.TryRemoveEntries(TimeSpan.Zero, noInputStepsStepInfo);
SourceGeneration\Nodes\SourceOutputNode.cs (2)
60tableBuilder.TryRemoveEntries(TimeSpan.Zero, inputs); 62else if (entry.State != EntryState.Cached || !tableBuilder.TryUseCachedEntries(TimeSpan.Zero, inputs))
SourceGeneration\Nodes\SyntaxReceiverStrategy.cs (1)
38private TimeSpan lastElapsedTime;
SourceGeneration\Nodes\TransformNode.cs (2)
74tableBuilder.TryRemoveEntries(TimeSpan.Zero, inputs); 76else if (entry.State != EntryState.Cached || !tableBuilder.TryUseCachedEntries(TimeSpan.Zero, inputs))
SourceGeneration\RunResults.cs (8)
23internal GeneratorDriverRunResult(ImmutableArray<GeneratorRunResult> results, TimeSpan elapsedTime) 37internal TimeSpan ElapsedTime { get; } 89TimeSpan elapsedTime) 142internal TimeSpan ElapsedTime { get; } 198internal GeneratorDriverTimingInfo(TimeSpan elapsedTime, ImmutableArray<GeneratorTimingInfo> generatorTimes) 210public TimeSpan ElapsedTime { get; } 223internal GeneratorTimingInfo(ISourceGenerator generator, TimeSpan elapsedTime) 237public TimeSpan ElapsedTime { get; }
SourceGeneration\SyntaxStore.cs (9)
32private readonly ImmutableDictionary<SyntaxInputNode, TimeSpan>.Builder _syntaxTimes = ImmutableDictionary.CreateBuilder<SyntaxInputNode, TimeSpan>(); 74_syntaxTimes[node] = TimeSpan.Zero; 81_syntaxTimes[syntaxInputNode] = TimeSpan.Zero; 104var elapsed = sw.Elapsed; 158public TimeSpan GetRuntimeAdjustment(ImmutableArray<SyntaxInputNode> inputNodes) 160TimeSpan result = TimeSpan.Zero; 164if (_syntaxTimes.TryGetValue(node, out var adjustment))
VersionHelper.cs (1)
192TimeSpan days = time.Date - new DateTime(2000, 1, 1);
Microsoft.CodeAnalysis.Analyzers (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Microsoft.CodeAnalysis.AnalyzerUtilities (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Microsoft.CodeAnalysis.BannedApiAnalyzers (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Microsoft.CodeAnalysis.CodeStyle (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Microsoft.CodeAnalysis.CSharp (2)
CommandLine\CSharpCommandLineParser.cs (2)
295var timeout = TimeSpan.FromMinutes(2);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (18)
Classification\SyntacticTaggerTests.cs (2)
49diffTimeout: TimeSpan.MaxValue); 103diffTimeout: TimeSpan.MaxValue);
Workspaces\WorkspaceTests_EditorFeatures.cs (16)
808var longEventTimeout = TimeSpan.FromMinutes(5); 809var shortEventTimeout = TimeSpan.FromSeconds(5); 877var longEventTimeout = TimeSpan.FromMinutes(5); 878var shortEventTimeout = TimeSpan.FromSeconds(5); 940var longEventTimeout = TimeSpan.FromMinutes(5); 941var shortEventTimeout = TimeSpan.FromSeconds(5); 1001var longEventTimeout = TimeSpan.FromMinutes(5); 1002var shortEventTimeout = TimeSpan.FromSeconds(5);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
Emit\CompilationEmitTests.cs (1)
1916Thread.Sleep(TimeSpan.FromSeconds(3));
Emit\DeterministicTests.cs (1)
61Thread.Sleep(TimeSpan.FromSeconds(1));
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (4)
EndToEndTests.cs (4)
37private static void RunInThread(Action action, TimeSpan? timeout = null) 364}, timeout: TimeSpan.FromSeconds(10)); 409}, timeout: TimeSpan.FromSeconds(10)); 780}, timeout: TimeSpan.FromSeconds(5));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (70)
Semantics\OverloadResolutionTests.cs (1)
6833var elapsed = DateTime.UtcNow - start;
SourceGeneration\GeneratorDriverTests.cs (12)
571Assert.Equal(TimeSpan.Zero, result.ElapsedTime); 3531Assert.Equal(TimeSpan.Zero, timing.ElapsedTime); 3535Assert.Equal(TimeSpan.Zero, generatorTiming.ElapsedTime); 3561Assert.NotEqual(TimeSpan.Zero, timing.ElapsedTime); 3565Assert.NotEqual(TimeSpan.Zero, generatorTiming.ElapsedTime); 3601Assert.NotEqual(TimeSpan.Zero, timing.ElapsedTime); 3606Assert.NotEqual(TimeSpan.Zero, timing1.ElapsedTime); 3611Assert.NotEqual(TimeSpan.Zero, timing2.ElapsedTime); 3641Assert.NotEqual(TimeSpan.Zero, timing.ElapsedTime); 3645Assert.NotEqual(TimeSpan.Zero, generatorTiming.ElapsedTime); 3652Assert.NotEqual(TimeSpan.Zero, timing2.ElapsedTime); 3657Assert.NotEqual(TimeSpan.Zero, generatorTiming2.ElapsedTime);
SourceGeneration\StateTableTests.cs (54)
25builder.AddEntries(ImmutableArray.Create(1), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 26builder.AddEntries(ImmutableArray.Create(2), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 27builder.AddEntries(ImmutableArray.Create(3), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 38builder.AddEntries(ImmutableArray.Create(1, 2, 3), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 39builder.AddEntries(ImmutableArray.Create(4, 5, 6), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 40builder.AddEntries(ImmutableArray.Create(7, 8, 9), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 53builder.AddEntries(ImmutableArray.Create(o, o, o), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 66builder.AddEntry(o, EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 67builder.AddEntry(null, EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 68builder.AddEntry(o, EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 79builder.AddEntries(ImmutableArray.Create(1), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 80builder.AddEntries(ImmutableArray.Create(2, 3), EntryState.Cached, TimeSpan.Zero, default, EntryState.Cached); 81builder.AddEntries(ImmutableArray.Create(4, 5), EntryState.Modified, TimeSpan.Zero, default, EntryState.Modified); 82builder.AddEntries(ImmutableArray.Create(6), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 86builder.TryModifyEntries(ImmutableArray.Create(10, 11), TimeSpan.Zero, default, EntryState.Modified); 87builder.TryUseCachedEntries(TimeSpan.Zero, default, out var cachedEntries); // ((2, EntryState.Cached), (3, EntryState.Cached)) 88builder.TryModifyEntries(ImmutableArray.Create(20, 21, 22), TimeSpan.Zero, default, EntryState.Modified); 89bool didRemoveEntries = builder.TryRemoveEntries(TimeSpan.Zero, default, out var removedEntries); //((6, EntryState.Removed)) 110builder.AddEntries(ImmutableArray.Create(1, 2, 3), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 111builder.AddEntries(ImmutableArray.Create(4, 5, 6), EntryState.Removed, TimeSpan.Zero, default, EntryState.Removed); 112builder.AddEntries(ImmutableArray.Create(7, 8, 9), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 127builder.AddEntries(ImmutableArray.Create(1, 2, 3), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 128builder.AddEntries(ImmutableArray.Create(4, 5, 6), EntryState.Removed, TimeSpan.Zero, default, EntryState.Removed); 129builder.AddEntries(ImmutableArray.Create(7, 8, 9), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 148builder.AddEntries(ImmutableArray.Create(1), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 158builder.AddEntries(ImmutableArray.Create(1), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 166bool didRemoveEntries = builder.TryRemoveEntries(TimeSpan.Zero, default); 169builder.AddEntries(ImmutableArray.Create(2), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 180builder.AddEntries(ImmutableArray.Create(1, 2), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 181builder.AddEntries(ImmutableArray<int>.Empty, EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 182builder.AddEntries(ImmutableArray.Create(3, 4), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 189Assert.True(builder.TryModifyEntries(ImmutableArray.Create(3, 2), TimeSpan.Zero, default, EntryState.Modified)); 190Assert.True(builder.TryModifyEntries(ImmutableArray<int>.Empty, TimeSpan.Zero, default, EntryState.Modified)); 191Assert.True(builder.TryModifyEntries(ImmutableArray.Create(3, 5), TimeSpan.Zero, default, EntryState.Modified)); 203builder.AddEntries(ImmutableArray.Create(1), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 204builder.AddEntries(ImmutableArray.Create(2), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 205builder.AddEntries(ImmutableArray.Create(3), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 206builder.AddEntries(ImmutableArray.Create(4), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 213Assert.True(builder.TryModifyEntry(1, TimeSpan.Zero, default, EntryState.Modified)); 214Assert.True(builder.TryModifyEntry(2, TimeSpan.Zero, default, EntryState.Modified)); 215Assert.True(builder.TryModifyEntry(5, TimeSpan.Zero, default, EntryState.Modified)); 216Assert.True(builder.TryModifyEntry(4, TimeSpan.Zero, default, EntryState.Modified)); 228builder.AddEntries(ImmutableArray.Create(1), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 229builder.AddEntries(ImmutableArray.Create(2), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 230builder.AddEntries(ImmutableArray.Create(3), EntryState.Added, TimeSpan.Zero, default, EntryState.Added); 237Assert.True(builder.TryModifyEntry(1, TimeSpan.Zero, default, EntryState.Modified)); // ((1, EntryState.Cached)) 238Assert.True(builder.TryModifyEntry(4, TimeSpan.Zero, default, EntryState.Modified)); // ((4, EntryState.Modified)) 239Assert.True(builder.TryModifyEntry(5, TimeSpan.Zero, default, EntryState.Modified)); // ((3, EntryState.Cached)) 282nodeBuilder.AddEntries(ImmutableArray.Create(1, 2, 3), EntryState.Cached, TimeSpan.Zero, default, EntryState.Cached); 311nodeBuilder.AddEntries(ImmutableArray.Create(1, 2, 3), EntryState.Added, TimeSpan.Zero, emptyInputSteps, EntryState.Added); 312nodeBuilder.AddEntries(ImmutableArray.Create(4), EntryState.Removed, TimeSpan.Zero, emptyInputSteps, EntryState.Removed); 313nodeBuilder.AddEntries(ImmutableArray.Create(5, 6), EntryState.Modified, TimeSpan.Zero, emptyInputSteps, EntryState.Modified); 600builder.AddEntry(value, state, TimeSpan.Zero, default, state); 1357runtime: TimeSpan.Zero);
SourceGeneration\SyntaxAwareGeneratorTests.cs (3)
2101Assert.NotEqual(TimeSpan.Zero, timing.ElapsedTime); 2107Assert.NotEqual(TimeSpan.Zero, timing1.ElapsedTime); 2114Assert.NotEqual(TimeSpan.Zero, timing2.ElapsedTime);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Compilation\GetSemanticInfoTests.cs (2)
2275TimeSpan timeout = TimeSpan.FromSeconds(2);
Microsoft.CodeAnalysis.EditorFeatures (24)
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (2)
60private readonly TimeSpan _diffTimeout; 91TimeSpan diffTimeout)
Copilot\RoslynProposalAdjusterProvider.cs (1)
40private static void SetDefaultTelemetryProperties(Dictionary<string, object?> map, string providerName, bool before, TimeSpan elapsedTime)
EditorConfigSettings\Aggregator\SettingsAggregator.cs (1)
46TimeSpan.FromSeconds(1),
GoOrFind\AbstractGoOrFindNavigationService.cs (2)
210var delay = this.NavigateToSingleResultIfQuick 212: TimeSpan.Zero;
InlineRename\UI\SmartRename\SmartRenameViewModel.cs (1)
48private TimeSpan _semanticContextDelay;
IntelliSense\AsyncCompletion\AsyncCompletionLogger.cs (4)
45internal static void LogSourceInitializationTicksDataPoint(TimeSpan elapsed) 51internal static void LogSourceGetContextTicksDataPoint(TimeSpan elapsed, bool isCanceled) 61internal static void LogItemManagerSortTicksDataPoint(TimeSpan elapsed) 67internal static void LogItemManagerUpdateDataPoint(TimeSpan elapsed, bool isCanceled)
Interactive\InteractiveSession.cs (1)
88TimeSpan.Zero,
LanguageServer\RazorInProcLanguageClient.cs (1)
84var regex = new Regex(regexExpression, RegexOptions.Compiled | RegexOptions.Singleline, TimeSpan.FromSeconds(1));
Lightup\ISmartRenameSessionWrapper.cs (4)
25private static readonly Func<object, TimeSpan> s_automaticFetchDelayAccessor; 49s_automaticFetchDelayAccessor = LightupHelpers.CreatePropertyAccessor<object, TimeSpan>(s_wrappedType, nameof(AutomaticFetchDelay), TimeSpan.Zero); 91public TimeSpan AutomaticFetchDelay => s_automaticFetchDelayAccessor(_instance);
QuickInfo\OnTheFlyDocsView.xaml.cs (1)
193var copilotRequestTime = stopwatch.Elapsed;
Remote\SolutionChecksumUpdater.cs (1)
73TimeSpan.Zero,
Shared\Tagging\EventSources\TaggerConstants.cs (2)
13internal static TimeSpan ComputeTimeDelay(this TaggerDelay behavior, ITextBuffer textBufferOpt) 25internal static TimeSpan ComputeTimeDelay(this TaggerDelay behavior)
Shared\Utilities\ResettableDelay.cs (1)
63if (!await expeditableDelaySource.Delay(TimeSpan.FromMilliseconds(_delayInMilliseconds), cancellationToken).ConfigureAwait(false))
src\Workspaces\Remote\ServiceHub\Services\EditAndContinue\EditAndContinueLogReporter.cs (1)
33delay: TimeSpan.Zero,
Workspaces\ITextBufferVisibilityTracker.cs (1)
50TimeSpan timeSpan,
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Async\AsynchronousOperationBlocker.cs (1)
67public bool WaitIfBlocked(TimeSpan timeout)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (17)
Utilities\AsynchronousOperationListenerTests.cs (17)
22private static readonly TimeSpan s_unexpectedDelay = TimeSpan.FromSeconds(60); 56public void Sleep(TimeSpan timeToSleep) 66Thread.Sleep(TimeSpan.FromMilliseconds(10)); 89sleepHelper.Sleep(TimeSpan.FromSeconds(1)); 111sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 116sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 144sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 177sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 181sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 185sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 212sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 217sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 221sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 259sleepHelper.Sleep(TimeSpan.FromSeconds(10)); 302sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 312sleepHelper.Sleep(TimeSpan.FromMilliseconds(500));
Microsoft.CodeAnalysis.Extensions.Package (1)
Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Microsoft.CodeAnalysis.ExternalAccess.Apex (2)
ApexAsynchronousOperationListenerProviderAccessor.cs (1)
31public Task WaitAllAsync(string[]? featureNames = null, Action? eventProcessingAction = null, TimeSpan? timeout = null)
IApexAsynchronousOperationListenerProviderAccessor.cs (1)
14Task WaitAllAsync(string[] featureNames = null, Action eventProcessingAction = null, TimeSpan? timeout = null);
Microsoft.CodeAnalysis.ExternalAccess.Copilot (2)
SemanticSearch\ICopilotSemanticSearchQueryService.cs (2)
42TimeSpan ExecutionTime = default); 47TimeSpan EmitTime = default);
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
Internal\Classification\FSharpClassificationService.cs (2)
72public TextChangeRange? ComputeSyntacticChangeRange(SolutionServices services, SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken) 78public ValueTask<TextChangeRange?> ComputeSyntacticChangeRangeAsync(Document oldDocument, Document newDocument, TimeSpan timeout, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (116)
ChangeSignature\ChangeSignatureTelemetryLogger.cs (1)
140internal static void LogCommitInformation(int numDeclarationsUpdated, int numCallSitesUpdated, TimeSpan elapsedTime)
Common\DelayTimeSpan.cs (12)
14public static readonly TimeSpan NearImmediate = TimeSpan.FromMilliseconds(50); 19public static readonly TimeSpan Short = TimeSpan.FromMilliseconds(250); 24public static readonly TimeSpan Medium = TimeSpan.FromMilliseconds(500); 29public static readonly TimeSpan Idle = TimeSpan.FromMilliseconds(1500); 34public static readonly TimeSpan IdleWithLongDelay = TimeSpan.FromMilliseconds(10000); 39public static readonly TimeSpan NonFocus = TimeSpan.FromMilliseconds(3000);
Completion\CompletionService.ProviderManager.cs (1)
43TimeSpan.FromSeconds(1),
Completion\Log\CompletionProvidersLogger.cs (1)
38internal static void LogTypeImportCompletionTicksDataPoint(TimeSpan elapsed)
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionCacheServiceFactory.cs (1)
31TimeSpan.FromSeconds(1),
Copilot\CopilotChangeAnalysis.cs (8)
24[property: DataMember(Order = 7)] TimeSpan TotalAnalysisTime, 25[property: DataMember(Order = 8)] TimeSpan ForkingTime, 26[property: DataMember(Order = 9)] TimeSpan TotalDiagnosticComputationTime, 38[property: DataMember(Order = 1)] TimeSpan ComputationTime, 52[property: DataMember(Order = 0)] TimeSpan TotalComputationTime, 53[property: DataMember(Order = 1)] TimeSpan TotalApplicationTime, 55[property: DataMember(Order = 3)] Dictionary<string, TimeSpan> DiagnosticIdToApplicationTime, 57[property: DataMember(Order = 5)] Dictionary<string, TimeSpan> ProviderNameToApplicationTime,
Copilot\CopilotChangeAnalysisUtilities.cs (1)
119if (value is TimeSpan timeSpan)
Copilot\ICopilotChangeAnalysisService.cs (11)
95var forkingTime = forkingTimeStopWatch.Elapsed; 107var totalDiagnosticComputationTime = totalDiagnosticComputationTimeStopWatch.Elapsed; 114var totalAnalysisTime = totalAnalysisTimeStopWatch.Elapsed; 156private static void IncrementElapsedTime<TKey>(Dictionary<TKey, TimeSpan> map, TKey key, TimeSpan elapsed) where TKey : notnull 158map.TryGetValue(key, out var currentElapsed); 241var totalComputationTime = totalComputationStopWatch.Elapsed; 244var diagnosticIdToApplicationTime = new Dictionary<string, TimeSpan>(); 246var providerNameToApplicationTime = new Dictionary<string, TimeSpan>(); 252await ProducerConsumer<(CodeFixCollection collection, bool success, TimeSpan elapsedTime)>.RunParallelAsync( 325var totalApplicationTime = totalApplicationTimeStopWatch.Elapsed;
EditAndContinue\DocumentAnalysisResults.cs (4)
90public TimeSpan ElapsedTime { get; } 117TimeSpan elapsedTime, 185public static DocumentAnalysisResults Blocked(DocumentId documentId, string filePath, ImmutableArray<RudeEditDiagnostic> rudeEdits, Diagnostic? syntaxError, TimeSpan elapsedTime, bool hasChanges) 204public static DocumentAnalysisResults Unchanged(DocumentId documentId, string filePath, TimeSpan elapsedTime)
EditAndContinue\EditSessionTelemetry.cs (7)
30public readonly TimeSpan EmitDifferenceTime = telemetry._emitDifferenceTime; 31public readonly TimeSpan AnalysisTime = telemetry._analysisTime; 50private TimeSpan _emitDifferenceTime; 51private TimeSpan _analysisTime; 71_emitDifferenceTime = TimeSpan.Zero; 81public void LogEmitDifferenceTime(TimeSpan span) 84public void LogAnalysisTime(TimeSpan span)
ExternalAccess\UnitTesting\Notification\AbstractGlobalOperationNotificationService.cs (1)
33TimeSpan.Zero,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingGlobalOperationAwareIdleProcessor.cs (1)
23TimeSpan backOffTimeSpan,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingIdleProcessor.cs (7)
17TimeSpan backOffTimeSpan, 20private static readonly TimeSpan s_minimumDelay = TimeSpan.FromMilliseconds(50); 26protected readonly TimeSpan BackOffTimeSpan = backOffTimeSpan; 105var timeLeft = BackOffTimeSpan - _timeSinceLastAccess.Elapsed; 106var delayTimeSpan = TimeSpan.FromMilliseconds(Math.Max(s_minimumDelay.TotalMilliseconds, timeLeft.TotalMilliseconds));
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerTimeSpan.cs (10)
11public static readonly TimeSpan AllFilesWorkerBackOff = TimeSpan.FromMilliseconds(1500); 12public static readonly TimeSpan EntireProjectWorkerBackOff = TimeSpan.FromMilliseconds(5000); 13public static readonly TimeSpan SemanticChangeBackOff = TimeSpan.FromMilliseconds(100); 14public static readonly TimeSpan ProjectPropagationBackOff = TimeSpan.FromMilliseconds(500); 15public static readonly TimeSpan PreviewBackOff = TimeSpan.FromMilliseconds(500);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.AbstractUnitTestingPriorityProcessor.cs (1)
33TimeSpan backOffTimeSpan,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (5)
51TimeSpan.Zero, 56var allFilesWorkerBackOffTimeSpan = UnitTestingSolutionCrawlerTimeSpan.AllFilesWorkerBackOff; 57var entireProjectWorkerBackOffTimeSpan = UnitTestingSolutionCrawlerTimeSpan.EntireProjectWorkerBackOff; 67var semanticBackOffTimeSpan = UnitTestingSolutionCrawlerTimeSpan.SemanticChangeBackOff; 68var projectBackOffTimeSpan = UnitTestingSolutionCrawlerTimeSpan.ProjectPropagationBackOff;
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (2)
47TimeSpan normalBackOffTimeSpan, 48TimeSpan lowBackOffTimeSpan,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingLowPriorityProcessor.cs (1)
32TimeSpan backOffTimeSpan,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (1)
48TimeSpan backOffTimeSpan,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (3)
45TimeSpan backOffTimeSpan, 46TimeSpan projectBackOffTimeSpan, 337TimeSpan backOffTimeSpan,
ExternalAccess\VSTypeScript\VSTypeScriptClassificationService.cs (2)
43public ValueTask<TextChangeRange?> ComputeSyntacticChangeRangeAsync(Document oldDocument, Document newDocument, TimeSpan timeout, CancellationToken cancellationToken) 46public TextChangeRange? ComputeSyntacticChangeRange(SolutionServices workspace, SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
161var timeout = TimeSpan.FromSeconds(5);
SemanticSearch\ExecuteQueryResult.cs (2)
27[property: DataMember(Order = 2)] TimeSpan ExecutionTime = default); 39[property: DataMember(Order = 2)] TimeSpan EmitTime = default);
SymbolSearch\Windows\IDelayService.cs (5)
17TimeSpan UpdateSucceededDelay { get; } 24TimeSpan ExpectedFailureDelay { get; } 32TimeSpan CatastrophicFailureDelay { get; } 37TimeSpan FileWriteDelay { get; } 42TimeSpan CachePollDelay { get; }
SymbolSearch\Windows\SymbolSearchUpdateEngine.DelayService.cs (10)
13public TimeSpan CachePollDelay { get; } = TimeSpan.FromMinutes(1); 14public TimeSpan FileWriteDelay { get; } = TimeSpan.FromSeconds(10); 15public TimeSpan ExpectedFailureDelay { get; } = TimeSpan.FromMinutes(1); 16public TimeSpan CatastrophicFailureDelay { get; } = TimeSpan.FromDays(1); 17public TimeSpan UpdateSucceededDelay { get; } = TimeSpan.FromDays(1);
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (16)
121var delayUntilNextUpdate = await UpdateDatabaseInBackgroundWorkerAsync(cancellationToken).ConfigureAwait(false); 164private async Task<TimeSpan> UpdateDatabaseInBackgroundWorkerAsync(CancellationToken cancellationToken) 204var delay = _service._delayService.ExpectedFailureDelay; 227private async Task<TimeSpan> DownloadFullDatabaseAsync(FileInfo databaseFileInfo, CancellationToken cancellationToken) 233private async Task<(bool succeeded, TimeSpan delay)> DownloadFullDatabaseWorkerAsync(FileInfo databaseFileInfo, CancellationToken cancellationToken) 249private async Task<(bool succeeded, TimeSpan delay)> ProcessFullDatabaseXElementAsync( 264var failureDelay = _service._delayService.CatastrophicFailureDelay; 284var failureDelay = _service._delayService.CatastrophicFailureDelay; 298var delay = _service._delayService.UpdateSucceededDelay; 388private async Task<TimeSpan> PatchLocalDatabaseAsync(FileInfo databaseFileInfo, CancellationToken cancellationToken) 423var delayUntilUpdate = await ProcessPatchXElementAsync( 466private async Task<TimeSpan> ProcessPatchXElementAsync( 490private async Task<TimeSpan?> TryProcessPatchXElementAsync( 586var pollingMinutes = (int)TimeSpan.FromDays(1).TotalMinutes; 611private async Task<(XElement? element, TimeSpan delay)> TryDownloadFileAsync(IFileDownloader fileDownloader, CancellationToken cancellationToken) 679var delay = _service._delayService.FileWriteDelay;
Microsoft.CodeAnalysis.InteractiveHost (7)
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.LanguageServer (5)
HostWorkspace\LanguageServerProjectLoader.cs (1)
111TimeSpan.FromMilliseconds(100),
Program.cs (2)
89var timeout = TimeSpan.FromMinutes(2);
Testing\RunTestsHandler.cs (1)
81internal static string GetShortTimespan(TimeSpan t)
Testing\TestDiscoverer.cs (1)
71var elapsed = stopwatch.Elapsed;
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Handler\AbstractRefreshQueue.cs (1)
68delay: TimeSpan.FromMilliseconds(2000),
Handler\Diagnostics\AbstractWorkspacePullDiagnosticsHandler.cs (1)
113await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false);
Handler\Telemetry\RequestTelemetryLogger.cs (2)
61TimeSpan queuedDuration, 62TimeSpan requestDuration,
LspServices\RequestTelemetryScope.cs (2)
19private TimeSpan _queuedDuration; 46var requestDuration = _stopwatch.Elapsed;
Protocol\Internal\Converters\RegexConverter.cs (1)
20return new Regex(reader.GetString(), RegexOptions.Compiled | RegexOptions.ECMAScript, matchTimeout: TimeSpan.FromMilliseconds(1000));
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (7)
Diagnostics\PullDiagnosticTests.cs (5)
2078await Task.Delay(TimeSpan.FromSeconds(5)); 2106await Task.Delay(TimeSpan.FromSeconds(5)); 2135await Task.Delay(TimeSpan.FromSeconds(5)); 2165await Task.Delay(TimeSpan.FromSeconds(5)); 2191await Task.Delay(TimeSpan.FromSeconds(5));
Ordering\RequestOrderingTests.cs (1)
142using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(1));
Workspaces\LspWorkspaceManagerTests.cs (1)
663await Task.Delay(TimeSpan.FromSeconds(1));
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Microsoft.CodeAnalysis.PublicApiAnalyzers (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Microsoft.CodeAnalysis.Remote.ServiceHub (19)
Host\AssetProvider.cs (1)
87var elapsed = timer.Elapsed;
Host\RemoteWorkspaceManager.cs (2)
53=> new SolutionAssetCache(workspace, cleanupInterval: TimeSpan.FromSeconds(30), purgeAfter: TimeSpan.FromMinutes(1));
Host\SolutionAssetCache.cs (4)
38private readonly TimeSpan _cleanupIntervalTimeSpan; 44private readonly TimeSpan _purgeAfterTimeSpan; 58public SolutionAssetCache(RemoteWorkspace? remoteWorkspace, TimeSpan cleanupInterval, TimeSpan purgeAfter)
Services\DiagnosticAnalyzer\PerformanceQueue.cs (8)
38public void Add(IEnumerable<(string analyzerId, TimeSpan timeSpan)> rawData, int unitCount) 134public Snapshot(IEnumerable<(string analyzerId, TimeSpan timeSpan)> snapshot, int unitCount) 139public Snapshot(IEnumerable<(int assignedAnalyzerNumber, TimeSpan timeSpan)> rawData, int unitCount) 146public void Update(IEnumerable<(string analyzerId, TimeSpan timeSpan)> rawData, int unitCount) 163Dictionary<int, double> map, IEnumerable<(int assignedAnalyzerNumber, TimeSpan timeSpan)> rawData, int fileCount) 166var minSpan = rawData.Select(kv => kv.timeSpan).Min(); 180private static IEnumerable<(int assignedAnalyzerNumber, TimeSpan timeSpan)> Convert(IEnumerable<(string analyzerId, TimeSpan timeSpan)> rawData)
Services\EditAndContinue\EditAndContinueLogReporter.cs (1)
33delay: TimeSpan.Zero,
Services\ProcessTelemetry\RemoteProcessTelemetryService.PerformanceReporter.cs (1)
38TimeSpan.FromMinutes(2),
src\VisualStudio\Core\Def\Watson\FaultReporter.cs (2)
316var oneDay = TimeSpan.FromDays(1);
Microsoft.CodeAnalysis.ResxSourceGenerator (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (1)
MetadataShadowCopyProviderTests.cs (1)
169File.SetLastWriteTimeUtc(path0, DateTime.Now + TimeSpan.FromHours(1));
Microsoft.CodeAnalysis.Test.Utilities (3)
FX\EventWaiter.cs (1)
78public bool WaitForEventToFire(TimeSpan timeout)
TestHelpers.cs (2)
28public static readonly TimeSpan HangMitigatingTimeout = TimeSpan.FromMinutes(4);
Microsoft.CodeAnalysis.Threading.Package (7)
AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.Workspaces (42)
Classification\AbstractClassificationService.cs (2)
228public ValueTask<TextChangeRange?> ComputeSyntacticChangeRangeAsync(Document oldDocument, Document newDocument, TimeSpan timeout, CancellationToken cancellationToken) 231public TextChangeRange? ComputeSyntacticChangeRange(SolutionServices services, SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
Classification\IClassificationService.cs (2)
105TimeSpan timeout, CancellationToken cancellationToken); 113TimeSpan timeout, CancellationToken cancellationToken);
Classification\SyntaxClassification\AbstractSyntaxClassificationService.cs (1)
59public TextChangeRange? ComputeSyntacticChangeRange(SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
Classification\SyntaxClassification\ISyntaxClassificationService.cs (1)
60SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken);
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (1)
41public static TextChangeRange ComputeSyntacticChangeRange(SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
Diagnostics\IRemoteDiagnosticAnalyzerService.cs (2)
66internal readonly struct AnalyzerPerformanceInfo(string analyzerId, bool builtIn, TimeSpan timeSpan) 75public readonly TimeSpan TimeSpan = timeSpan;
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
26private static readonly TimeSpan EntireProjectWorkerBackOff = TimeSpan.FromMilliseconds(5000);
Log\HistogramLogAggregator.cs (1)
42public void LogTime(TKey key, TimeSpan timeSpan)
Log\StatisticLogAggregator.cs (1)
20public void AddDataPoint(TKey key, TimeSpan timeSpan)
Shared\TestHooks\AsynchronousOperationListener.cs (3)
43public Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken) 168_expeditedDelayCancellationTokenSource.CancelAfter(TimeSpan.Zero); 193await Task.Delay(TimeSpan.FromMilliseconds(10)).ConfigureAwait(false);
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (3)
115public async Task WaitAllAsync(Workspace? workspace, string[]? featureNames = null, Action? eventProcessingAction = null, TimeSpan? timeout = null) 118var smallTimeout = TimeSpan.FromMilliseconds(10);
Shared\TestHooks\AsynchronousOperationListenerProvider+NullOperationListener.cs (1)
23public Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Storage\SQLite\v2\Interop\SqlConnection.cs (1)
110NativeMethods.sqlite3_busy_timeout(handle, (int)TimeSpan.FromMinutes(1).TotalMilliseconds);
Storage\SQLite\v2\SQLitePersistentStorage.cs (1)
114TimeSpan.FromMilliseconds(FlushAllDelayMS),
Telemetry\TelemetryLogging.cs (1)
140await Task.Delay(TimeSpan.FromMinutes(30), cancellationToken).ConfigureAwait(false);
Workspace\ProjectSystem\FileWatchedPortableExecutableReferenceFactory.cs (1)
60TimeSpan.FromSeconds(5),
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
461TimeSpan.FromMilliseconds(200), // 200 chosen with absolutely no evidence whatsoever
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
187TimeSpan.FromMilliseconds(200), // 200 chosen with absolutely no evidence whatsoever
Workspace\Solution\TextLoader.cs (2)
25internal static readonly TimeSpan RetryDelay = TimeSpan.FromSeconds(MaxDelaySecs / MaxRetries);
Workspace\Solution\VersionSource\RecoverableTextAndVersion.RecoverableText.cs (1)
29new(TimeSpan.Zero,
Workspace\Workspace.cs (2)
85TimeSpan.Zero, 99TimeSpan.FromMilliseconds(1500),
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\ProjectLoadProgress.cs (2)
33public TimeSpan ElapsedTime { get; } 35internal ProjectLoadProgress(string filePath, ProjectLoadOperation operation, string? targetFramework, TimeSpan elapsedTime)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (3)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (1)
969var delay = TextLoader.RetryDelay;
WorkspaceTestBase.cs (2)
22protected static readonly TimeSpan AsyncEventTimeout = TimeSpan.FromMinutes(5);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
MEF\UseExportProviderAttribute.cs (2)
54private static readonly TimeSpan CleanupTimeout = TimeSpan.FromMinutes(1);
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
158httpClient.Timeout = TimeSpan.FromSeconds(TimeoutInSeconds);
Microsoft.DotNet.ArcadeAzureIntegration (2)
AzureCliCredentialWithAzNoUpdateWrapper.cs (1)
95tokenSource.CancelAfter(TimeSpan.FromSeconds(30));
DefaultIdentityTokenCredential.cs (1)
95ProcessTimeout = TimeSpan.FromSeconds(30)
Microsoft.DotNet.Baselines.Tasks (1)
PRCreator.cs (1)
521var delay = resetTime - DateTime.UtcNow;
Microsoft.DotNet.Build.Tasks.Feed (11)
src\common\AzureStorageUtils.cs (1)
57Timeout = TimeSpan.FromSeconds(300)
src\common\GeneralUtils.cs (3)
27public static TimeSpan NugetFeedPublisherHttpClientTimeout => TimeSpan.FromSeconds(300); 328System.Threading.Tasks.Task.WaitAll(new System.Threading.Tasks.Task[] { stderrCompletion.Task, stdoutCompletion.Task }, TimeSpan.FromSeconds(5));
src\common\UploadToAzure.cs (1)
117CancellationTokenSource timeoutTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(UploadTimeoutInMinutes));
src\PublishArtifactsInManifestBase.cs (4)
941client.Timeout = TimeSpan.FromSeconds(TimeoutInSeconds); 996using CancellationTokenSource timeoutTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(TimeoutInMinutes)); 1031new CancellationTokenSource(TimeSpan.FromMinutes(TimeoutInMinutes)); 1392httpClient.Timeout = TimeSpan.FromSeconds(TimeoutInSeconds);
src\PublishBuildToMaestro.cs (2)
563TimeSpan? timeSpan = GetTimeToWait(response); 597public static TimeSpan? GetTimeToWait(HttpResponseMessage response)
Microsoft.DotNet.Build.Tasks.Feed.Tests (8)
PublishBuildToMaestroTests.cs (8)
30TimeSpan? actual = PublishBuildToMaestro.GetTimeToWait(response); 33actual.Should().BeCloseTo(resetTime - DateTime.UtcNow, TimeSpan.FromSeconds(1)); 50TimeSpan? actual = PublishBuildToMaestro.GetTimeToWait(response); 65TimeSpan? actual = PublishBuildToMaestro.GetTimeToWait(response); 67actual.Should().BeCloseTo(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(1)); 81TimeSpan? actual = PublishBuildToMaestro.GetTimeToWait(response); 83actual.Should().BeCloseTo(resetTime - DateTime.UtcNow, TimeSpan.FromSeconds(1));
Microsoft.DotNet.Build.Tasks.Installers (3)
src\ExecWithRetries.cs (2)
98TimeSpan delay = TimeSpan.FromSeconds(
src\RpmBuilder.cs (1)
181private static readonly DateTimeOffset UnixEpoch = new(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
Microsoft.DotNet.Helix.Client (1)
HelixApiOptions.cs (1)
23Retry.Delay = TimeSpan.FromSeconds(DefaultRetryDelaySeconds);
Microsoft.DotNet.Helix.JobSender (8)
IWorkItemDefinition.cs (1)
21IWorkItemDefinition WithTimeout(TimeSpan timeout);
JobDefinition.cs (1)
257TimeSpan untilRemoved = whenItExpires.ToUniversalTime().Subtract(DateTime.UtcNow);
StorageHelpers\StorageRetryPolicy.cs (2)
17options.Retry.Delay = TimeSpan.FromSeconds(5); 18options.Retry.MaxDelay = TimeSpan.FromSeconds(30);
WorkItemDefinition.cs (4)
25public static TimeSpan DefaultTimeout { get; } = TimeSpan.FromSeconds(300); 29public TimeSpan Timeout { get; private set; } 38public IWorkItemDefinition WithTimeout(TimeSpan timeout)
Microsoft.DotNet.Helix.Sdk (31)
CreateXHarnessAndroidWorkItems.cs (2)
167TimeSpan workItemTimeout, 168TimeSpan xHarnessTimeout,
CreateXHarnessAppleWorkItems.cs (9)
37private static readonly TimeSpan s_defaultSimulatorLaunchTimeout = TimeSpan.FromMinutes(6); 38private static readonly TimeSpan s_defaultDeviceLaunchTimeout = TimeSpan.FromMinutes(5); 141TimeSpan launchTimeout = target.Contains("device") ? s_defaultDeviceLaunchTimeout : s_defaultSimulatorLaunchTimeout; 144if (!TimeSpan.TryParse(launchTimeoutProp, out launchTimeout) || launchTimeout.Ticks < 0) 221TimeSpan workItemTimeout, 222TimeSpan testTimeout, 223TimeSpan launchTimeout,
CreateXUnitWorkItems.cs (3)
139TimeSpan timeout = TimeSpan.FromMinutes(5); 142if (!TimeSpan.TryParse(XUnitWorkItemTimeout, out timeout))
DownloadFromResultsContainer.cs (1)
103NetworkTimeout = TimeSpan.FromMinutes(5)
SendHelixJob.cs (3)
120/// Timeout - A <see cref="System.TimeSpan"/> string that specifies that Work Item execution timeout 383if (TimeSpan.TryParse(timeoutString, CultureInfo.InvariantCulture, out TimeSpan timeout))
XharnessTaskBase.cs (13)
18private static readonly TimeSpan s_defaultWorkItemTimeout = TimeSpan.FromMinutes(20); 19private static readonly TimeSpan s_defaultTestTimeout = TimeSpan.FromMinutes(12); 20private static readonly TimeSpan s_telemetryBuffer = TimeSpan.FromMinutes(2); // extra time to send the XHarness telemetry 55protected (TimeSpan TestTimeout, TimeSpan WorkItemTimeout, int ExpectedExitCode, string CustomCommands) ParseMetadata(ITaskItem xHarnessAppItem) 64TimeSpan testTimeout = s_defaultTestTimeout; 67if (!TimeSpan.TryParse(testTimeoutProp, out testTimeout) || testTimeout.Ticks < 0) 74TimeSpan workItemTimeout = s_defaultWorkItemTimeout; 77if (!TimeSpan.TryParse(workItemTimeoutProp, out workItemTimeout) || workItemTimeout.Ticks < 0) 105protected Build.Utilities.TaskItem CreateTaskItem(string workItemName, string payloadArchivePath, string command, TimeSpan timeout)
Microsoft.DotNet.Internal.SymbolHelper (5)
SymbolPromotionHelper.cs (2)
57Delay = TimeSpan.FromSeconds(5), 61MaxDelay = TimeSpan.FromMinutes(1),
SymbolUploadHelper.cs (1)
449lcts.CancelAfter(TimeSpan.FromMinutes(_symbolToolTimeoutInMins));
SymbolUploadHelperFactory.cs (2)
117Delay = TimeSpan.FromSeconds(15), 121MaxDelay = TimeSpan.FromMinutes(5),
Microsoft.DotNet.Open.Api.Tools.Tests (9)
OpenApiRefreshTests.cs (3)
30await Task.Delay(TimeSpan.FromSeconds(1)); 60await Task.Delay(TimeSpan.FromSeconds(1)); 86await Task.Delay(TimeSpan.FromSeconds(1));
src\Shared\Process\ProcessExtensions.cs (6)
14private static readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30); 18public static void KillTree(this Process process, TimeSpan timeout) 41private static void GetAllChildIdsUnix(int parentId, ISet<int> children, TimeSpan timeout) 79private static void KillProcessUnix(int processId, TimeSpan timeout) 95private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout, out string stdout)
Microsoft.DotNet.SignCheckLibrary (1)
Utils.cs (1)
21private static readonly HttpClient s_client = new(new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(10) });
Microsoft.DotNet.SignCheckTask (2)
src\SignCheck.cs (2)
443TimeSpan totalTime = endTime - startTime; 475httpClient.Timeout = TimeSpan.FromSeconds(10000); // 10 seconds
Microsoft.DotNet.SignTool (1)
src\VerifySignatures.cs (1)
29private static readonly HttpClient client = new(new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(10) });
Microsoft.DotNet.XliffTasks (3)
ExponentialRetry.cs (3)
18foreach (TimeSpan t in Intervals) 36private static IEnumerable<TimeSpan> Intervals 43yield return TimeSpan.FromMilliseconds(milliseconds);
Microsoft.DotNet.XUnitAssert.Tests (39)
EqualityAssertsTests.cs (34)
1762 var precision = TimeSpan.FromMinutes(1); 1777 var precision = TimeSpan.FromMinutes(1); 1778 var difference = TimeSpan.FromMinutes(2); 1812 var expected = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1813 var actual = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1826 var expected = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1827 var actual = new DateTimeOffset(2023, 2, 11, 15, 5, 0, TimeSpan.Zero); 1846 var expected = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1847 var actual = new DateTimeOffset(2023, 2, 11, 16, 4, 0, TimeSpan.FromHours(1)); 1859 var expected = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1860 var actual = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.FromHours(1)); 1879 var date1 = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1880 var date2 = new DateTimeOffset(2023, 2, 11, 15, 5, 0, TimeSpan.Zero); 1881 var precision = TimeSpan.FromMinutes(1); 1894 var date1 = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1895 var date2 = new DateTimeOffset(2023, 2, 11, 15, 6, 0, TimeSpan.Zero); 1896 var precision = TimeSpan.FromMinutes(1); 1897 var difference = TimeSpan.FromMinutes(2); 1928 var date1 = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1929 var date2 = new DateTimeOffset(2023, 2, 11, 16, 5, 0, TimeSpan.FromHours(1)); 1930 var precision = TimeSpan.FromMinutes(1); 1943 var date1 = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1944 var date2 = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.FromHours(1)); 1945 var precision = TimeSpan.FromMinutes(1); 1946 var difference = TimeSpan.FromHours(1);
EquivalenceAssertsTests.cs (4)
1503 var expected = new DateTimeOffset(2022, 12, 1, 1, 3, 1, TimeSpan.Zero); 1504 var actual = new DateTimeOffset(2022, 12, 1, 1, 3, 1, TimeSpan.Zero); 1512 var expected = new DateTimeOffset(2022, 12, 1, 1, 3, 1, TimeSpan.Zero); 1513 var actual = new DateTimeOffset(2011, 9, 13, 18, 22, 0, TimeSpan.Zero);
Sdk\ArgumentFormatterTests.cs (1)
477 MyProp3 = new DateTimeOffset(2014, 04, 17, 07, 45, 23, TimeSpan.Zero);
Microsoft.Extensions.AI (4)
ChatCompletion\FunctionInvokingChatClient.cs (4)
894TimeSpan elapsed = GetElapsedTime(startingTimestamp); 923private static TimeSpan GetElapsedTime(long startingTimestamp) => 937private partial void LogInvocationCompleted(string methodName, TimeSpan duration); 940private partial void LogInvocationCompletedSensitive(string methodName, TimeSpan duration, string result);
Microsoft.Extensions.AI.Abstractions (6)
SpeechToText\SpeechToTextResponse.cs (2)
42public TimeSpan? StartTime { get; set; } 45public TimeSpan? EndTime { get; set; }
SpeechToText\SpeechToTextResponseUpdate.cs (2)
65public TimeSpan? StartTime { get; set; } 68public TimeSpan? EndTime { get; set; }
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (1)
612[typeof(TimeSpan)] = _ => new JsonSchema
Utilities\AIJsonUtilities.Defaults.cs (1)
106[JsonSerializable(typeof(TimeSpan))]
Microsoft.Extensions.AI.Abstractions.Tests (66)
ChatCompletion\ChatResponseTests.cs (11)
61response.CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero); 62Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), response.CreatedAt); 91CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), 108Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), result.CreatedAt); 135CreatedAt = new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), 148Assert.Equal(new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), update0.CreatedAt); 164CreatedAt = new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), 169CreatedAt = new DateTimeOffset(2025, 1, 1, 10, 30, 0, TimeSpan.Zero), 177CreatedAt = new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), 190Assert.Equal(new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), update0.CreatedAt); 199Assert.Equal(new DateTimeOffset(2025, 1, 1, 10, 30, 0, TimeSpan.Zero), update1.CreatedAt);
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (13)
31new(ChatRole.Assistant, "Hello") { ResponseId = "someResponse", MessageId = "12345", CreatedAt = new DateTimeOffset(1, 2, 3, 4, 5, 6, TimeSpan.Zero), ModelId = "model123" }, 33new(null, "world!") { CreatedAt = new DateTimeOffset(2, 2, 3, 4, 5, 6, TimeSpan.Zero), ConversationId = "123", AdditionalProperties = new() { ["c"] = "d" } }, 49Assert.Equal(new DateTimeOffset(2, 2, 3, 4, 5, 6, TimeSpan.Zero), response.CreatedAt); 77new(null, "Hi! ") { CreatedAt = new DateTimeOffset(2023, 1, 1, 10, 0, 0, TimeSpan.Zero), AuthorName = "Assistant" }, 78new(ChatRole.Assistant, "Hello") { MessageId = "msg1", CreatedAt = new DateTimeOffset(2024, 1, 1, 10, 0, 0, TimeSpan.Zero), AuthorName = "Assistant" }, 79new(null, " from") { MessageId = "msg1", CreatedAt = new DateTimeOffset(2024, 1, 1, 10, 1, 0, TimeSpan.Zero) }, // Later CreatedAt should win 83new(ChatRole.User, "How") { MessageId = "msg2", CreatedAt = new DateTimeOffset(2024, 1, 1, 11, 0, 0, TimeSpan.Zero), AuthorName = "User" }, 84new(null, " are") { MessageId = "msg2", CreatedAt = new DateTimeOffset(2024, 1, 1, 11, 1, 0, TimeSpan.Zero) }, 88new(ChatRole.Assistant, "I'm doing well,") { MessageId = "msg3", CreatedAt = new DateTimeOffset(2024, 1, 1, 12, 0, 0, TimeSpan.Zero) }, 89new(null, " thank you!") { MessageId = "msg3", CreatedAt = new DateTimeOffset(2024, 1, 1, 12, 2, 0, TimeSpan.Zero) }, // Later CreatedAt should win 107Assert.Equal(new DateTimeOffset(2024, 1, 1, 10, 1, 0, TimeSpan.Zero), message1.CreatedAt); // Last value should win 115Assert.Equal(new DateTimeOffset(2024, 1, 1, 11, 1, 0, TimeSpan.Zero), message2.CreatedAt); // Last value should win 123Assert.Equal(new DateTimeOffset(2024, 1, 1, 12, 2, 0, TimeSpan.Zero), message3.CreatedAt); // Last value should win
ChatCompletion\ChatResponseUpdateTests.cs (4)
76update.CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero); 77Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), update.CreatedAt); 130CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), 161Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), result.CreatedAt);
SpeechToText\SpeechToTextResponseTests.cs (12)
124TimeSpan startTime = TimeSpan.FromSeconds(1); 129TimeSpan endTime = TimeSpan.FromSeconds(2); 157StartTime = TimeSpan.FromSeconds(1), 158EndTime = TimeSpan.FromSeconds(2), 178Assert.Equal(TimeSpan.FromSeconds(1), result.StartTime); 179Assert.Equal(TimeSpan.FromSeconds(2), result.EndTime); 214StartTime = TimeSpan.FromSeconds(1), 215EndTime = TimeSpan.FromSeconds(2), 232Assert.Equal(TimeSpan.FromSeconds(1), update.StartTime); 233Assert.Equal(TimeSpan.FromSeconds(2), update.EndTime);
SpeechToText\SpeechToTextResponseUpdateExtensionsTests.cs (12)
49new("human, ") { ModelId = "model123", StartTime = TimeSpan.FromSeconds(10), EndTime = TimeSpan.FromSeconds(20) }, 50new("How ") { ModelId = "model123", StartTime = TimeSpan.FromSeconds(22), EndTime = TimeSpan.FromSeconds(23) }, 51new("are ") { ModelId = "model123", StartTime = TimeSpan.FromSeconds(23), EndTime = TimeSpan.FromSeconds(24) }, 52new([new TextContent("You?")]) { ModelId = "model123", StartTime = TimeSpan.FromSeconds(24), EndTime = TimeSpan.FromSeconds(25), AdditionalProperties = new() { ["c"] = "d" } }, 53new() { ResponseId = "someResponse", ModelId = "model123", StartTime = TimeSpan.FromSeconds(25), EndTime = TimeSpan.FromSeconds(35) }, 63Assert.Equal(TimeSpan.FromSeconds(10), response.StartTime); 64Assert.Equal(TimeSpan.FromSeconds(35), response.EndTime);
SpeechToText\SpeechToTextResponseUpdateTests.cs (6)
52update.StartTime = TimeSpan.FromSeconds(10); 53update.EndTime = TimeSpan.FromSeconds(20); 54Assert.Equal(TimeSpan.FromSeconds(10), update.StartTime); 55Assert.Equal(TimeSpan.FromSeconds(20), update.EndTime); 90StartTime = TimeSpan.FromSeconds(5), 91EndTime = TimeSpan.FromSeconds(10),
test\Shared\JsonSchemaExporter\TestTypes.cs (5)
85Value: new(new DateTime(2021, 1, 1), TimeSpan.Zero), 89yield return new TestData<TimeSpan>( 91AdditionalValues: [TimeSpan.MinValue, TimeSpan.MaxValue], 1237[JsonSerializable(typeof(TimeSpan))]
Utilities\AIJsonUtilitiesTests.cs (3)
896public TimeSpan TimeSpanProp { get; set; } 1051string key3 = AIJsonUtilities.HashDataToString([TimeSpan.FromSeconds(1), null, 1.23], options); 1052string key4 = AIJsonUtilities.HashDataToString([TimeSpan.FromSeconds(1), null, 1.23], options);
Microsoft.Extensions.AI.Evaluation (8)
EvaluationMetricExtensions.cs (1)
151TimeSpan? duration = null)
EvaluationResultExtensions.cs (1)
181TimeSpan? duration = null)
Utilities\TimingHelper.cs (6)
12internal static TimeSpan ExecuteWithTiming(Action operation) 28internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 46internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 62internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 78internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>( 96internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>(
Microsoft.Extensions.AI.Evaluation.Console (6)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (6)
12internal static TimeSpan ExecuteWithTiming(Action operation) 28internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 46internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 62internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 78internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>( 96internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>(
Microsoft.Extensions.AI.Evaluation.NLP (9)
BLEUEvaluator.cs (1)
82(double score, TimeSpan duration) = TimingHelper.ExecuteWithTiming(() =>
F1Evaluator.cs (1)
73(double score, TimeSpan duration) = TimingHelper.ExecuteWithTiming(() =>
GLEUEvaluator.cs (1)
82(double score, TimeSpan duration) = TimingHelper.ExecuteWithTiming(() =>
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (6)
12internal static TimeSpan ExecuteWithTiming(Action operation) 28internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 46internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 62internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 78internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>( 96internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>(
Microsoft.Extensions.AI.Evaluation.Quality (21)
CoherenceEvaluator.cs (1)
93(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
CompletenessEvaluator.cs (1)
98(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
EquivalenceEvaluator.cs (1)
99(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
EvaluationMetricExtensions.cs (2)
58TimeSpan evaluationDuration) 69TimeSpan evaluationDuration)
FluencyEvaluator.cs (1)
85(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
GroundednessEvaluator.cs (1)
99(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
IntentResolutionEvaluator.cs (2)
143(ChatResponse evaluationResponse, TimeSpan evaluationDuration) = 326TimeSpan evaluationDuration,
RelevanceEvaluator.cs (1)
98(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
RelevanceTruthAndCompletenessEvaluator.cs (2)
120(ChatResponse evaluationResponse, TimeSpan evaluationDuration) = 274TimeSpan evaluationDuration,
RetrievalEvaluator.cs (1)
114(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (6)
12internal static TimeSpan ExecuteWithTiming(Action operation) 28internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 46internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 62internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 78internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>( 96internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>(
TaskAdherenceEvaluator.cs (1)
142(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
ToolCallAccuracyEvaluator.cs (1)
142(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
Microsoft.Extensions.AI.Evaluation.Reporting (17)
ChatTurnDetails.cs (3)
24public TimeSpan Latency { get; set; } 92TimeSpan latency, 132TimeSpan latency,
Defaults.cs (3)
29/// Gets a <see cref="TimeSpan"/> that specifies the default amount of time that cached AI responses should survive 32public static TimeSpan DefaultTimeToLiveForCacheEntries { get; } = TimeSpan.FromDays(14);
JsonSerialization\TimeSpanConverter.cs (4)
10internal sealed class TimeSpanConverter : JsonConverter<TimeSpan> 12public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 13=> TimeSpan.FromSeconds(reader.GetDouble()); 15public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options)
Storage\DiskBasedReportingConfiguration.cs (2)
36/// An optional <see cref="TimeSpan"/> that specifies the maximum amount of time that cached AI responses should 75TimeSpan? timeToLiveForCacheEntries = null,
Storage\DiskBasedResponseCache.cs (2)
36private readonly TimeSpan _timeToLiveForCacheEntries; 43TimeSpan? timeToLiveForCacheEntries = null)
Storage\DiskBasedResponseCacheProvider.cs (3)
25/// An optional <see cref="TimeSpan"/> that specifies the maximum amount of time that cached AI responses should 30TimeSpan? timeToLiveForCacheEntries = null) : IEvaluationResponseCacheProvider 40TimeSpan? timeToLiveForCacheEntries = null)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (11)
src\Libraries\Microsoft.Extensions.AI.Evaluation.Reporting\CSharp\JsonSerialization\TimeSpanConverter.cs (4)
10internal sealed class TimeSpanConverter : JsonConverter<TimeSpan> 12public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 13=> TimeSpan.FromSeconds(reader.GetDouble()); 15public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options)
Storage\AzureStorageReportingConfiguration.cs (2)
36/// An optional <see cref="TimeSpan"/> that specifies the maximum amount of time that cached AI responses should 75TimeSpan? timeToLiveForCacheEntries = null,
Storage\AzureStorageResponseCache.cs (2)
33TimeSpan? timeToLiveForCacheEntries = null) : IDistributedCache 44private readonly TimeSpan _timeToLiveForCacheEntries =
Storage\AzureStorageResponseCacheProvider.cs (3)
26/// An optional <see cref="TimeSpan"/> that specifies the maximum amount of time that cached AI responses should 31TimeSpan? timeToLiveForCacheEntries = null) : IEvaluationResponseCacheProvider 41TimeSpan? timeToLiveForCacheEntries = null)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (17)
CacheEntryTests.cs (4)
24expiration: DateTime.UtcNow.Add(TimeSpan.FromMinutes(5))); 44expiration: DateTime.UtcNow.Add(TimeSpan.FromMinutes(5))); 64expiration: DateTime.UtcNow.Add(TimeSpan.FromMinutes(5))); 85expiration: DateTime.UtcNow.Add(TimeSpan.FromMinutes(5)));
ChatTurnDetailsTests.cs (6)
27Assert.Equal(TimeSpan.FromSeconds(5), details!.Latency); 61Assert.Equal(TimeSpan.FromSeconds(5), details!.Latency); 96Assert.Equal(TimeSpan.FromSeconds(5), details!.Latency); 132Assert.Equal(TimeSpan.FromSeconds(1), details!.Latency); 174Assert.Equal(TimeSpan.FromSeconds(1), details!.Latency); 217Assert.Equal(TimeSpan.FromSeconds(2), details!.Latency);
ResultStoreTester.cs (2)
123await Task.Delay(TimeSpan.FromMilliseconds(500)); 133await Task.Delay(TimeSpan.FromMilliseconds(500));
ScenarioRunResultTests.cs (5)
65latency: TimeSpan.FromSeconds(1), 74latency: TimeSpan.FromSeconds(2), 157latency: TimeSpan.FromSeconds(1), 166latency: TimeSpan.FromSeconds(2), 217expiration: DateTime.UtcNow.Add(TimeSpan.FromMinutes(5)));
Microsoft.Extensions.AI.Evaluation.Safety (8)
ContentSafetyEvaluator.cs (1)
144(ChatResponse annotationResponse, TimeSpan annotationDuration) =
ContentSafetyService.cs (1)
383TimeSpan elapsedDuration = stopwatch.Elapsed;
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (6)
12internal static TimeSpan ExecuteWithTiming(Action operation) 28internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 46internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 62internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 78internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>( 96internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>(
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
461AIFunctionFactory.Create((TimeSpan ts) => ts, createOptions()),
Microsoft.Extensions.AI.OpenAI (12)
src\Shared\ServerSentEvents\SseFormatter.cs (2)
102TimeSpan? reconnectionInterval) 129Debug.Assert(retry >= TimeSpan.Zero);
src\Shared\ServerSentEvents\SseItem.cs (3)
24private readonly TimeSpan? _reconnectionInterval; 67public TimeSpan? ReconnectionInterval 72if (value < TimeSpan.Zero)
src\Shared\ServerSentEvents\SseParser_1.cs (7)
46/// <summary>The maximum number of milliseconds representible by <see cref="System.TimeSpan"/>.</summary> 47private readonly long TimeSpan_MaxValueMilliseconds = (long)TimeSpan.MaxValue.TotalMilliseconds; 99private TimeSpan? _nextReconnectionInterval; 451TimeSpan timeSpan = milliseconds == TimeSpan_MaxValueMilliseconds ? TimeSpan.MaxValue : TimeSpan.FromMilliseconds(milliseconds); 478public TimeSpan ReconnectionInterval { get; private set; } = Timeout.InfiniteTimeSpan;
Microsoft.Extensions.AI.OpenAI.Tests (12)
OpenAIConversionTests.cs (12)
212ChatMessageRole.User, null, null, null, new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 222Assert.Equal(new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), response.CreatedAt); 253Assert.Equal(new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), response.CreatedAt); 278null, null, null, OpenAI.Chat.ChatFinishReason.ToolCalls, new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 407CreatedAt = new DateTimeOffset(2025, 1, 3, 14, 30, 0, TimeSpan.Zero), 422Assert.Equal(new DateTimeOffset(2025, 1, 3, 14, 30, 0, TimeSpan.Zero), completion.CreatedAt); 569createdAt: new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 596CreatedAt = new DateTimeOffset(2025, 1, 1, 12, 0, 0, TimeSpan.Zero) 611Assert.Equal(new DateTimeOffset(2025, 1, 1, 12, 0, 0, TimeSpan.Zero), streamingUpdate.CreatedAt); 861new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 890CreatedAt = new DateTimeOffset(2025, 1, 15, 10, 30, 0, TimeSpan.Zero), 899Assert.Equal(new DateTimeOffset(2025, 1, 15, 10, 30, 0, TimeSpan.Zero), openAIResponse.CreatedAt);
Microsoft.Extensions.AI.Templates.Tests (4)
Infrastructure\TestCommand.cs (3)
20public TimeSpan? Timeout { get; set; } 105var elapsedTime = Stopwatch.GetElapsedTime(startTimestamp); 119var elapsedTime = Stopwatch.GetElapsedTime(startTimestamp);
Infrastructure\TestCommandExtensions.cs (1)
24public static TCommand WithTimeout<TCommand>(this TCommand command, TimeSpan timeout)
Microsoft.Extensions.AI.Tests (1)
Embeddings\DistributedCachingEmbeddingGeneratorTest.cs (1)
91CreatedAt = DateTimeOffset.Parse("2024-08-01T00:00:00Z") + TimeSpan.FromHours(i),
Microsoft.Extensions.ApiDescription.Client.Tests (13)
src\Shared\Process\ProcessEx.cs (7)
21private static readonly TimeSpan DefaultProcessTimeout = TimeSpan.FromMinutes(15); 32private readonly CancellationTokenSource _stdoutLinesCancellationSource = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 36public ProcessEx(ITestOutputHelper output, Process proc, TimeSpan timeout) 103public static ProcessEx Run(ITestOutputHelper output, string workingDirectory, string command, string args = null, IDictionary<string, string> envVars = null, TimeSpan? timeout = default) 205public void WaitForExit(bool assertSuccess, TimeSpan? timeSpan = null) 209timeSpan = TimeSpan.FromSeconds(600);
src\Shared\Process\ProcessExtensions.cs (6)
14private static readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30); 18public static void KillTree(this Process process, TimeSpan timeout) 41private static void GetAllChildIdsUnix(int parentId, ISet<int> children, TimeSpan timeout) 79private static void KillProcessUnix(int processId, TimeSpan timeout) 95private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout, out string stdout)
Microsoft.Extensions.Caching.Abstractions (25)
CacheEntryExtensions.cs (4)
49/// <param name="relative">The <see cref="TimeSpan"/> representing the expiration time relative to now.</param> 53TimeSpan relative) 78/// <param name="offset">A <see cref="TimeSpan"/> representing a sliding expiration.</param> 82TimeSpan offset)
DistributedCacheEntryExtensions.cs (2)
20TimeSpan relative) 47TimeSpan offset)
DistributedCacheEntryOptions.cs (6)
15private TimeSpan _absoluteExpirationRelativeToNow; 17private TimeSpan _slidingExpiration; 33public TimeSpan? AbsoluteExpirationRelativeToNow 38if (value <= TimeSpan.Zero) 54public TimeSpan? SlidingExpiration 59if (value <= TimeSpan.Zero)
Hybrid\HybridCacheEntryOptions.cs (2)
20public TimeSpan? Expiration { get; init; } 26public TimeSpan? LocalCacheExpiration { get; init; }
ICacheEntry.cs (2)
34TimeSpan? AbsoluteExpirationRelativeToNow { get; set; } 40TimeSpan? SlidingExpiration { get; set; }
MemoryCacheEntryExtensions.cs (2)
71TimeSpan relative) 100TimeSpan offset)
MemoryCacheEntryOptions.cs (6)
16private TimeSpan? _absoluteExpirationRelativeToNow; 17private TimeSpan? _slidingExpiration; 40public TimeSpan? AbsoluteExpirationRelativeToNow 48if (value <= TimeSpan.Zero) 64public TimeSpan? SlidingExpiration 72if (value <= TimeSpan.Zero)
MemoryCacheExtensions.cs (1)
113public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value, TimeSpan absoluteExpirationRelativeToNow)
Microsoft.Extensions.Caching.Hybrid (19)
Internal\DefaultHybridCache.cs (6)
43private readonly TimeSpan _defaultExpiration; 44private readonly TimeSpan _defaultLocalCacheExpiration; 111_defaultExpiration = defaultEntryOptions?.Expiration ?? TimeSpan.FromMinutes(DefaultExpirationMinutes); 212internal TimeSpan GetL1AbsoluteExpirationRelativeToNow(HybridCacheEntryOptions? options) 215internal TimeSpan GetL2AbsoluteExpirationRelativeToNow(HybridCacheEntryOptions? options) => options?.Expiration ?? _defaultExpiration; 229private static TimeSpan? GetEffectiveLocalCacheExpiration(HybridCacheEntryOptions? options)
Internal\DefaultHybridCache.L2.cs (4)
21private static readonly DistributedCacheEntryOptions _tagInvalidationEntryOptions = new() { AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(MaxCacheDays) }; 182internal void SetL1<T>(string key, CacheItem<T> value, HybridCacheEntryOptions? options, TimeSpan maxRelativeTime) 194var expiry = GetL1AbsoluteExpirationRelativeToNow(options); 269TimeSpan expiration = GetL2AbsoluteExpirationRelativeToNow(options);
Internal\DefaultHybridCache.StampedeStateT.cs (4)
233result.AsArraySegment(), Key.Key, CacheItem.Tags, Cache, out ArraySegment<byte> payload, out TimeSpan remainingTime, 444private void SetResultAndRecycleIfAppropriate(ref BufferChunk value, TimeSpan remainingTime) 530private void SetResult(CacheItem<T> value) => SetResult(value, TimeSpan.MaxValue); 532private void SetResult(CacheItem<T> value, TimeSpan maxRelativeTime)
Internal\DefaultHybridCache.TagInvalidation.cs (2)
197internal static TimeSpan TicksToTimeSpan(long ticks) => TimeSpan.FromTicks(ticks);
Internal\HybridCachePayload.cs (3)
104string key, long creationTime, TimeSpan duration, PayloadFlags flags, TagSet tags, ReadOnlySequence<byte> payload) 179out ArraySegment<byte> payload, out TimeSpan remainingTime, out PayloadFlags flags, out ushort entropy, out TagSet pendingTags, out Exception? fault) 187remainingTime = TimeSpan.Zero;
Microsoft.Extensions.Caching.Hybrid.Tests (50)
BufferReleaseTests.cs (2)
133var bytes = HybridCachePayload.Write(arr, key, cache.CurrentTimestamp(), TimeSpan.FromHours(1), 0, TagSet.Empty, writer.AsSequence()); 196var bytes = HybridCachePayload.Write(arr, key, cache.CurrentTimestamp(), TimeSpan.FromHours(1), 0, TagSet.Empty, writer.AsSequence());
DistributedCacheTests.cs (10)
39public void Add(TimeSpan delta) => UtcNow += delta; 81Clock.Add(TimeSpan.FromMinutes(4)); 86Clock.Add(TimeSpan.FromMinutes(2)); 127Clock.Add(TimeSpan.FromMinutes(4)); 132Clock.Add(TimeSpan.FromMinutes(2)); 195Clock.Add(TimeSpan.FromMinutes(4)); 200Clock.Add(TimeSpan.FromMinutes(2)); 257Clock.Add(TimeSpan.FromMinutes(4)); 262Clock.Add(TimeSpan.FromMinutes(2)); 393= new() { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(5) };
ExpirationTests.cs (5)
27HybridCacheEntryOptions options = new() { Expiration = TimeSpan.FromMinutes(2), LocalCacheExpiration = TimeSpan.FromMinutes(1) }; 43clock.Add(TimeSpan.FromSeconds(45)); // should still be fine from L1 (L1 has 1 minute expiration) 46clock.Add(TimeSpan.FromSeconds(45)); // should still be fine from L2 (L1 now expired, but fetches from L2 and detects 0:30 remaining, which limits L1 to 0:30) 49clock.Add(TimeSpan.FromSeconds(45)); // should now be expired
L2Tests.cs (2)
22private static readonly HybridCacheEntryOptions _expiry = new() { Expiration = TimeSpan.FromMinutes(3.5) }; 24private static readonly HybridCacheEntryOptions _expiryNoL1 = new() { Flags = HybridCacheEntryFlags.DisableLocalCache, Expiration = TimeSpan.FromMinutes(3.5) };
PayloadTests.cs (21)
50int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 55clock.Add(TimeSpan.FromSeconds(10)); 56var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 80int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 84clock.Add(TimeSpan.FromSeconds(58)); 85var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 90clock.Add(TimeSpan.FromSeconds(4)); 114int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 118clock.Add(TimeSpan.FromSeconds(2)); 121var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 144int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 148clock.Add(TimeSpan.FromSeconds(2)); 151var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 181int actualLength = HybridCachePayload.Write(oversized, key, creation, TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 185clock.Add(TimeSpan.FromSeconds(2)); 189var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 211var result = HybridCachePayload.TryParse(new(bytes), "whatever", TagSet.Empty, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 234int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 238var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength - 1), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 261int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 265var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength + 1), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _);
ServiceConstructionTests.cs (9)
41options.DefaultEntryOptions = new() { Expiration = TimeSpan.FromSeconds(120), Flags = HybridCacheEntryFlags.DisableLocalCacheRead }; 49Assert.Equal(TimeSpan.FromSeconds(120), defaults.Expiration); 81Assert.Equal(TimeSpan.FromSeconds(120), defaults.LocalCacheExpiration); 257Expiration = defaultExpiration is null ? null : TimeSpan.FromMinutes(defaultExpiration.GetValueOrDefault()), 258LocalCacheExpiration = defaultLocalCacheExpiration is null ? null : TimeSpan.FromMinutes(defaultLocalCacheExpiration.GetValueOrDefault()), 272Expiration = perItemExpiration is null ? null : TimeSpan.FromMinutes(perItemExpiration.GetValueOrDefault()), 273LocalCacheExpiration = perItemLocalCacheExpiration is null ? null : TimeSpan.FromMinutes(perItemLocalCacheExpiration.GetValueOrDefault()), 279Assert.Equal(TimeSpan.FromMinutes(expectedExpiration ?? DefaultHybridCache.DefaultExpirationMinutes), cache.GetL2AbsoluteExpirationRelativeToNow(itemOptions)); 280Assert.Equal(TimeSpan.FromMinutes(expectedLocalCacheExpiration ?? DefaultHybridCache.DefaultExpirationMinutes), cache.GetL1AbsoluteExpirationRelativeToNow(itemOptions));
TestEventListener.cs (1)
182await Task.Delay(TimeSpan.FromSeconds(EventCounterIntervalSec * 2));
Microsoft.Extensions.Caching.Memory (9)
CacheEntry.cs (7)
23private TimeSpan _absoluteExpirationRelativeToNow; 24private TimeSpan _slidingExpiration; 73var offset = new TimeSpan(_absoluteExpirationOffsetMinutes * TimeSpan.TicksPerMinute); 96internal TimeSpan AbsoluteExpirationRelativeToNow => _absoluteExpirationRelativeToNow; 98TimeSpan? ICacheEntry.AbsoluteExpirationRelativeToNow 122public TimeSpan? SlidingExpiration
MemoryCacheOptions.cs (2)
29public TimeSpan ExpirationScanFrequency { get; set; } = TimeSpan.FromMinutes(1);
Microsoft.Extensions.Caching.MicroBenchmarks (2)
DistributedCacheBenchmarks.cs (2)
105var options = new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(30) }; 106options.SlidingExpiration = Sliding ? TimeSpan.FromMinutes(5) : null;
Microsoft.Extensions.Caching.SqlServer (12)
DatabaseOperations.cs (1)
391private static void ValidateOptions(TimeSpan? slidingExpiration, DateTimeOffset? absoluteExpiration)
SqlParameterCollectionExtensions.cs (1)
66TimeSpan? value)
SqlServerCache.cs (7)
21private static readonly TimeSpan MinimumExpiredItemsDeletionInterval = TimeSpan.FromMinutes(5); 22private static readonly TimeSpan DefaultExpiredItemsDeletionInterval = TimeSpan.FromMinutes(30); 26private readonly TimeSpan _expiredItemsDeletionInterval; 29private readonly TimeSpan _defaultSlidingExpiration; 51if (cacheOptions.DefaultSlidingExpiration <= TimeSpan.Zero)
SqlServerCacheOptions.cs (3)
23public TimeSpan? ExpiredItemsDeletionInterval { get; set; } 44public TimeSpan DefaultSlidingExpiration { get; set; } = TimeSpan.FromMinutes(20);
Microsoft.Extensions.Caching.SqlServer.Tests (46)
CacheItemInfo.cs (1)
16public TimeSpan? SlidingExpirationInSeconds { get; set; }
SqlServerCacheWithDatabaseTest.cs (43)
105new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(30))); 168cacheOptions.DefaultSlidingExpiration = cacheOptions.DefaultSlidingExpiration.Add(TimeSpan.FromMinutes(10)); 214new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(30))); 236new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(slidingExpirationWindow))); 239testClock.Add(TimeSpan.FromHours(accessItemAt)); 256var slidingExpirationWindow = TimeSpan.FromSeconds(10); 266testClock.Add(TimeSpan.FromSeconds(accessItemAt)); 287var slidingExpiration = TimeSpan.FromSeconds(5); 288var absoluteExpiration = utcNow.Add(TimeSpan.FromSeconds(20)); 301utcNow = testClock.Add(TimeSpan.FromSeconds(accessItemAt)).UtcNow; 319new DistributedCacheEntryOptions().SetAbsoluteExpiration(relative: TimeSpan.FromSeconds(10))); 322testClock.Add(TimeSpan.FromHours(10)); 343.SetAbsoluteExpiration(absolute: testClock.UtcNow.Add(TimeSpan.FromSeconds(30)))); 346testClock.Add(TimeSpan.FromHours(10)); 361var absoluteExpirationRelativeToUtcNow = TimeSpan.FromSeconds(10); 390var expectedAbsoluteExpiration = new DateTimeOffset(2025, 1, 1, 1, 0, 0, TimeSpan.Zero); 421var absoluteExpiration = testClock.UtcNow.Add(TimeSpan.FromSeconds(10)); 438absoluteExpiration = testClock.UtcNow.Add(TimeSpan.FromMinutes(30)); 461var absoluteExpiration = testClock.UtcNow.Add(TimeSpan.FromSeconds(10)); 486var slidingExpiration = TimeSpan.FromSeconds(10); 498testClock.Add(TimeSpan.FromSeconds(5)); 517var slidingExpiration = TimeSpan.FromSeconds(5); 518var absoluteExpiration = utcNow.Add(TimeSpan.FromSeconds(20)); 536utcNow = testClock.Add(TimeSpan.FromSeconds(5)).UtcNow; 546utcNow = testClock.Add(TimeSpan.FromSeconds(5)).UtcNow; 556utcNow = testClock.Add(TimeSpan.FromSeconds(5)).UtcNow; 573var absoluteExpirationRelativeToNow = TimeSpan.FromSeconds(30); 582testClock.Add(TimeSpan.FromSeconds(25)); 603var slidingExpiration = TimeSpan.FromSeconds(10); 615testClock.Add(TimeSpan.FromSeconds(5)); 637new DistributedCacheEntryOptions().SetAbsoluteExpiration(relative: TimeSpan.FromHours(1))); 657new DistributedCacheEntryOptions().SetAbsoluteExpiration(relative: TimeSpan.FromHours(1))); 677new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(10))); 705ExpiredItemsDeletionInterval = TimeSpan.FromHours(2) 713TimeSpan? slidingExpiration, 754cacheItemInfo.SlidingExpirationInSeconds = TimeSpan.FromSeconds(reader.GetInt64(3));
TestClock.cs (2)
18UtcNow = new DateTimeOffset(2013, 1, 1, 1, 0, 0, offset: TimeSpan.Zero); 23public TestClock Add(TimeSpan timeSpan)
Microsoft.Extensions.Caching.StackExchangeRedis (23)
RedisCache.cs (23)
63private readonly TimeSpan ReconnectMinInterval = TimeSpan.FromSeconds(60); 66private readonly TimeSpan ReconnectErrorThreshold = TimeSpan.FromSeconds(30); 71return ticks == 0 ? DateTimeOffset.MinValue : new DateTimeOffset(ticks, TimeSpan.Zero); 188var setTtl = batch.KeyExpireAsync(prefixedKey, TimeSpan.FromSeconds(ttl.GetValueOrDefault())); 237cache.KeyExpireAsync(prefixedKey, TimeSpan.FromSeconds(ttl.GetValueOrDefault())) 249private static HashEntry[] GetHashFields(RedisValue value, DateTimeOffset? absoluteExpiration, TimeSpan? slidingExpiration) 413MapMetadata(results, out DateTimeOffset? absExpr, out TimeSpan? sldExpr); 452MapMetadata(results, out DateTimeOffset? absExpr, out TimeSpan? sldExpr); 503private static void MapMetadata(RedisValue[] results, out DateTimeOffset? absoluteExpiration, out TimeSpan? slidingExpiration) 510absoluteExpiration = new DateTimeOffset(absoluteExpirationTicks.Value, TimeSpan.Zero); 519private void Refresh(IDatabase cache, string key, DateTimeOffset? absExpr, TimeSpan sldExpr) 524TimeSpan? expr; 527var relExpr = absExpr.Value - DateTimeOffset.Now; 545private async Task RefreshAsync(IDatabase cache, string key, DateTimeOffset? absExpr, TimeSpan sldExpr, CancellationToken token) 552TimeSpan? expr; 555var relExpr = absExpr.Value - DateTimeOffset.Now; 639TimeSpan elapsedSinceLastReconnect = utcNow - previousConnectTime; 656TimeSpan elapsedSinceFirstError = utcNow - firstErrorTime; 657TimeSpan elapsedSinceMostRecentError = utcNow - ReadTimeTicks(ref _previousErrorTimeTicks); 731MapMetadata(metadata, out DateTimeOffset? absExpr, out TimeSpan? sldExpr); 778MapMetadata(metadata, out DateTimeOffset? absExpr, out TimeSpan? sldExpr);
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (50)
TimeExpirationAsyncTests.cs (25)
44var expected = DateTimeOffset.Now - TimeSpan.FromMinutes(1); 62await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(1))); 69await Task.Delay(TimeSpan.FromSeconds(0.5)); 83await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(0.25))); 98await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromMinutes(-1))); 102TimeSpan.FromMinutes(-1)); 114await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.Zero)); 118TimeSpan.Zero); 128await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(1))); 135await Task.Delay(TimeSpan.FromSeconds(0.5)); 148await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(0.25))); 163await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(-1))); 164}, nameof(DistributedCacheEntryOptions.SlidingExpiration), "The sliding expiration value must be positive.", TimeSpan.FromMinutes(-1)); 176await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.Zero)); 180TimeSpan.Zero); 190await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(1))); 195await Task.Delay(TimeSpan.FromSeconds(3.5)); 208await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(0.25))); 221await cache.SetAsync(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(1))); 228await Task.Delay(TimeSpan.FromSeconds(0.5)); 234await Task.Delay(TimeSpan.FromSeconds(3)); 247.SetSlidingExpiration(TimeSpan.FromSeconds(1)) 248.SetAbsoluteExpiration(TimeSpan.FromSeconds(3))); 256await Task.Delay(TimeSpan.FromSeconds(0.5)); 265await Task.Delay(TimeSpan.FromSeconds(0.5));
TimeExpirationTests.cs (25)
27var expected = DateTimeOffset.Now - TimeSpan.FromMinutes(1); 45cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(1))); 52Thread.Sleep(TimeSpan.FromSeconds(0.5)); 66cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(0.25))); 81cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromMinutes(-1))); 85TimeSpan.FromMinutes(-1)); 98cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.Zero)); 102TimeSpan.Zero); 112cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(1))); 119Thread.Sleep(TimeSpan.FromSeconds(0.5)); 132cache.Set(key, value, new DistributedCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(0.25))); 147cache.Set(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(-1))); 148}, nameof(DistributedCacheEntryOptions.SlidingExpiration), "The sliding expiration value must be positive.", TimeSpan.FromMinutes(-1)); 161cache.Set(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.Zero)); 165TimeSpan.Zero); 175cache.Set(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(1))); 180Thread.Sleep(TimeSpan.FromSeconds(3.5)); 193cache.Set(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(0.25))); 206cache.Set(key, value, new DistributedCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(1))); 213Thread.Sleep(TimeSpan.FromSeconds(0.5)); 219Thread.Sleep(TimeSpan.FromSeconds(3)); 232.SetSlidingExpiration(TimeSpan.FromSeconds(1)) 233.SetAbsoluteExpiration(TimeSpan.FromSeconds(3))); 241Thread.Sleep(TimeSpan.FromSeconds(0.5)); 250Thread.Sleep(TimeSpan.FromSeconds(0.5));
Microsoft.Extensions.Compliance.Redaction (10)
src\LegacySupport\StringSyntaxAttribute\StringSyntaxAttribute.cs (1)
66/// <summary>The syntax identifier for strings containing <see cref="TimeSpan"/> format specifiers.</summary>
src\Shared\Data.Validation\TimeSpanAttribute.cs (9)
15/// Provides boundary validation for <see cref="TimeSpan"/>. 28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 33public TimeSpan? Maximum 39return TimeSpan.FromMilliseconds((double)_maxMs); 43return _max == null ? null : TimeSpan.Parse(_max, CultureInfo.InvariantCulture); 116var min = Minimum; 130if (value is TimeSpan ts)
Microsoft.Extensions.Compliance.Testing (1)
src\LegacySupport\StringSyntaxAttribute\StringSyntaxAttribute.cs (1)
66/// <summary>The syntax identifier for strings containing <see cref="TimeSpan"/> format specifiers.</summary>
Microsoft.Extensions.Configuration.KeyPerFile.Tests (1)
KeyPerFileTests.cs (1)
220using (var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(250)))
Microsoft.Extensions.Diagnostics (2)
Metrics\DebugConsoleMetricListener.cs (2)
34_timer.Change(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1));
Microsoft.Extensions.Diagnostics.HealthChecks (50)
DefaultHealthCheckService.cs (8)
68var totalElapsedTime = totalTime.GetElapsedTime(); 99if (registration.Timeout > TimeSpan.Zero) 108var duration = stopwatch.GetElapsedTime(); 123var duration = stopwatch.GetElapsedTime(); 138var duration = stopwatch.GetElapsedTime(); 208public static void HealthCheckProcessingEnd(ILogger logger, HealthStatus status, TimeSpan duration) => 233public static void HealthCheckEnd(ILogger logger, HealthCheckRegistration registration, HealthReportEntry entry, TimeSpan duration) 254public static void HealthCheckError(ILogger logger, HealthCheckRegistration registration, Exception exception, TimeSpan duration) =>
DependencyInjection\HealthChecksBuilderAddCheckExtensions.cs (6)
51/// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param> 60TimeSpan? timeout = null) 108/// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param> 121TimeSpan? timeout = null) where T : class, IHealthCheck 236/// <param name="timeout">A <see cref="TimeSpan"/> representing the timeout of the check.</param> 248TimeSpan timeout,
DependencyInjection\HealthChecksBuilderDelegateExtensions.cs (8)
44/// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param> 52TimeSpan? timeout = default) 87/// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param> 95TimeSpan? timeout = default) 130/// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param> 138TimeSpan? timeout = default) 173/// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param> 181TimeSpan? timeout = default)
HealthCheckPublisherHostedService.cs (15)
53private (TimeSpan Delay, TimeSpan Period) GetTimerOptions(HealthCheckRegistration registration) 107var delayPeriodGroups = new HashSet<(TimeSpan Delay, TimeSpan Period)>(); 124private Timer CreateTimer((TimeSpan Delay, TimeSpan Period) timerOptions) 144internal async Task RunAsync((TimeSpan Delay, TimeSpan Period) timerOptions) 152var timeout = _healthCheckPublisherOptions.Value.Timeout; 178private async Task RunAsyncCore((TimeSpan Delay, TimeSpan Period) timerOptions, CancellationToken cancellationToken) 255public static void HealthCheckPublisherProcessingEnd(ILogger logger, TimeSpan duration, Exception? exception = null) => 264public static void HealthCheckPublisherEnd(ILogger logger, IHealthCheckPublisher HealthCheckPublisher, TimeSpan duration) => 270public static void HealthCheckPublisherError(ILogger logger, IHealthCheckPublisher publisher, TimeSpan duration, Exception exception) => 277public static void HealthCheckPublisherTimeout(ILogger logger, IHealthCheckPublisher publisher, TimeSpan duration) =>
HealthCheckPublisherOptions.cs (9)
13private TimeSpan _delay; 14private TimeSpan _period; 21_delay = TimeSpan.FromSeconds(5); 22_period = TimeSpan.FromSeconds(30); 30public TimeSpan Delay 51public TimeSpan Period 56if (value < TimeSpan.FromSeconds(1)) 85public TimeSpan Timeout { get; set; } = TimeSpan.FromSeconds(30);
src\Shared\NonCapturingTimer\NonCapturingTimer.cs (2)
16public static Timer Create(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (17)
HealthCheckRegistration.cs (11)
28private TimeSpan _timeout; 55/// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param> 56public HealthCheckRegistration(string name, IHealthCheck instance, HealthStatus? failureStatus, IEnumerable<string>? tags, TimeSpan? timeout) 61if (timeout <= TimeSpan.Zero && timeout != System.Threading.Timeout.InfiniteTimeSpan) 102/// <param name="timeout">An optional <see cref="TimeSpan"/> representing the timeout of the check.</param> 108TimeSpan? timeout) 113if (timeout <= TimeSpan.Zero && timeout != System.Threading.Timeout.InfiniteTimeSpan) 147public TimeSpan Timeout 152if (value <= TimeSpan.Zero && value != System.Threading.Timeout.InfiniteTimeSpan) 166public TimeSpan? Delay { get; set; } 171public TimeSpan? Period { get; set; }
HealthReport.cs (3)
19public HealthReport(IReadOnlyDictionary<string, HealthReportEntry> entries, TimeSpan totalDuration) 33public HealthReport(IReadOnlyDictionary<string, HealthReportEntry> entries, HealthStatus status, TimeSpan totalDuration) 58public TimeSpan TotalDuration { get; }
HealthReportEntry.cs (3)
26public HealthReportEntry(HealthStatus status, string? description, TimeSpan duration, Exception? exception, IReadOnlyDictionary<string, object>? data) 41public HealthReportEntry(HealthStatus status, string? description, TimeSpan duration, Exception? exception, IReadOnlyDictionary<string, object>? data, IEnumerable<string>? tags = null) 64public TimeSpan Duration { get; }
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (2)
TelemetryHealthChecksPublisherTests.cs (2)
159var entry = new HealthReportEntry(status, $"desc{index}", TimeSpan.Zero, null, null); 164return new HealthReport(healthStatusRecords, TimeSpan.Zero);
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (72)
DefaultHealthCheckServiceTest.cs (3)
514await Task.WhenAll(output1.Task, output2.Task).TimeoutAfter(TimeSpan.FromSeconds(10)); 543}, timeout: TimeSpan.FromMilliseconds(100)); 575using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(3)))
HealthCheckPublisherHostedServiceTest.cs (59)
112options.Delay = TimeSpan.FromMilliseconds(0); 120await publishers[0].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); 121await publishers[1].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); 122await publishers[2].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); 158await publisher.Started.TimeoutAfter(TimeSpan.FromSeconds(10)); 171await running.TimeoutAfter(TimeSpan.FromSeconds(10)); 200await publisher.Started.TimeoutAfter(TimeSpan.FromSeconds(10)); 204await running.TimeoutAfter(TimeSpan.FromSeconds(10)); 263Delay = TimeSpan.FromSeconds(1), 264Period = TimeSpan.FromSeconds(9) 275Delay = TimeSpan.FromSeconds(1), 276Period = TimeSpan.FromSeconds(9) 287Delay = TimeSpan.FromSeconds(1), 288Period = TimeSpan.FromSeconds(18) 303Delay = TimeSpan.FromSeconds(2), 304Period = TimeSpan.FromSeconds(18) 315Delay = TimeSpan.FromSeconds(7), 316Period = TimeSpan.FromSeconds(11) 327Delay = TimeSpan.FromSeconds(9), 328Period = TimeSpan.FromSeconds(5) 339Delay = TimeSpan.FromSeconds(10), 340Period = TimeSpan.FromSeconds(8) 351Delay = TimeSpan.FromSeconds(10), 352Period = TimeSpan.FromSeconds(9) 360await publisher.Started.TimeoutAfter(TimeSpan.FromSeconds(10)); 367await running.TimeoutAfter(TimeSpan.FromSeconds(10)); 373await unblockDelayedCheck.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 418await publishers[0].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); 419await publishers[1].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); 420await publishers[2].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); 426await running.TimeoutAfter(TimeSpan.FromSeconds(10)); 464await publisher.Started.TimeoutAfter(TimeSpan.FromSeconds(10)); 472await running.TimeoutAfter(TimeSpan.FromSeconds(10)); 519options.Delay = TimeSpan.Zero; 538Delay = TimeSpan.FromSeconds(1), 539Period = TimeSpan.FromSeconds(9) 550Delay = TimeSpan.FromSeconds(1), 551Period = TimeSpan.FromSeconds(9) 562Delay = TimeSpan.FromSeconds(1), 563Period = TimeSpan.FromSeconds(9) 578Delay = TimeSpan.FromSeconds(2), 579Period = TimeSpan.FromSeconds(18) 590Delay = TimeSpan.FromSeconds(7), 591Period = TimeSpan.FromSeconds(11) 602Delay = TimeSpan.FromSeconds(9), 603Period = TimeSpan.FromSeconds(5) 614Delay = TimeSpan.FromSeconds(10), 615Period = TimeSpan.FromSeconds(8) 626Delay = TimeSpan.FromSeconds(10), 627Period = TimeSpan.FromSeconds(9) 636await unblockDelayedCheck.Task.TimeoutAfter(TimeSpan.FromSeconds(10)); 681await RunServiceAsync(service).TimeoutAfter(TimeSpan.FromSeconds(10)); 725await RunServiceAsync(service).TimeoutAfter(TimeSpan.FromSeconds(10)); 761options.Delay = TimeSpan.FromMinutes(5); 762options.Period = TimeSpan.FromMinutes(5); 763options.Timeout = TimeSpan.FromMinutes(5); 788private Task RunServiceAsync(HealthCheckPublisherHostedService service) => service.RunAsync((TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5))); 792await Assert.ThrowsAsync<TaskCanceledException>(() => Task.Delay(TimeSpan.FromSeconds(10), cancellationToken));
HealthReportTest.cs (10)
22{"Foo", new HealthReportEntry(HealthStatus.Healthy, null,TimeSpan.MinValue, null, null) }, 23{"Bar", new HealthReportEntry(HealthStatus.Healthy, null, TimeSpan.MinValue,null, null) }, 24{"Baz", new HealthReportEntry(status, exception: null, description: null,duration:TimeSpan.MinValue, data: null) }, 25{"Quick", new HealthReportEntry(HealthStatus.Healthy, null, TimeSpan.MinValue, null, null) }, 26{"Quack", new HealthReportEntry(HealthStatus.Healthy, null, TimeSpan.MinValue, null, null) }, 27{"Quock", new HealthReportEntry(HealthStatus.Healthy, null, TimeSpan.MinValue, null, null) }, 28}, totalDuration: TimeSpan.MinValue); 41{"Foo", new HealthReportEntry(HealthStatus.Healthy, null,TimeSpan.MinValue, null, null) } 42}, totalDuration: TimeSpan.FromMilliseconds(milliseconds)); 44Assert.Equal(TimeSpan.FromMilliseconds(milliseconds), result.TotalDuration);
Microsoft.Extensions.Diagnostics.Probes (11)
src\Shared\Data.Validation\TimeSpanAttribute.cs (9)
15/// Provides boundary validation for <see cref="TimeSpan"/>. 28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 33public TimeSpan? Maximum 39return TimeSpan.FromMilliseconds((double)_maxMs); 43return _max == null ? null : TimeSpan.Parse(_max, CultureInfo.InvariantCulture); 116var min = Minimum; 130if (value is TimeSpan ts)
TcpEndpointProbesOptions.cs (2)
46public TimeSpan HealthAssessmentPeriod { get; set; } = TimeSpan.FromSeconds(30);
Microsoft.Extensions.Diagnostics.Probes.Tests (8)
MockHealthCheckService.cs (2)
25HealthReportEntry entry = new HealthReportEntry(healthStatus, null, TimeSpan.Zero, null, null); 27return Task.FromResult(new HealthReport(healthStatusRecords, TimeSpan.Zero));
TcpEndpointProbesExtensionsTests.cs (4)
51o.HealthAssessmentPeriod = TimeSpan.FromSeconds(15); 60Assert.Equal(TimeSpan.FromSeconds(15), config.Value.HealthAssessmentPeriod); 88o.HealthAssessmentPeriod = TimeSpan.FromSeconds(5); 98Assert.Equal(TimeSpan.FromSeconds(5), config.Get("Liveness").HealthAssessmentPeriod);
TcpEndpointProbesServiceTests.cs (2)
47timeProvider.Advance(TimeSpan.FromMinutes(1)); 56timeProvider.Advance(TimeSpan.FromMinutes(1));
Microsoft.Extensions.Diagnostics.ResourceMonitoring (50)
IResourceMonitor.cs (2)
20/// <param name="window">A <see cref="TimeSpan"/> representing the time window for which utilization is requested.</param> 25ResourceUtilization GetUtilization(TimeSpan window);
Log.cs (3)
29TimeSpan totalTimeSinceStart, 30TimeSpan kernelTimeSinceStart, 31TimeSpan userTimeSinceStart,
ResourceMonitoringOptions.cs (11)
22internal static readonly TimeSpan DefaultCollectionWindow = TimeSpan.FromSeconds(5); 23internal static readonly TimeSpan DefaultSamplingInterval = TimeSpan.FromSeconds(1); 24internal static readonly TimeSpan DefaultRefreshInterval = TimeSpan.FromSeconds(5); 40public TimeSpan CollectionWindow { get; set; } = DefaultCollectionWindow; 55public TimeSpan SamplingInterval { get; set; } = DefaultSamplingInterval; 70public TimeSpan PublishingWindow { get; set; } = DefaultCollectionWindow; 85public TimeSpan CpuConsumptionRefreshInterval { get; set; } = DefaultRefreshInterval; 100public TimeSpan MemoryConsumptionRefreshInterval { get; set; } = DefaultRefreshInterval;
ResourceMonitorService.cs (4)
48private readonly TimeSpan _samplingInterval; 50private readonly TimeSpan _publishingWindow; 52private readonly TimeSpan _collectionWindow; 88public ResourceUtilization GetUtilization(TimeSpan window)
Snapshot.cs (9)
24public TimeSpan TotalTimeSinceStart { get; } 29public TimeSpan KernelTimeSinceStart { get; } 34public TimeSpan UserTimeSinceStart { get; } 49TimeSpan totalTimeSinceStart, 50TimeSpan kernelTimeSinceStart, 51TimeSpan userTimeSinceStart, 74TimeSpan kernelTimeSinceStart, 75TimeSpan userTimeSinceStart, 82TotalTimeSinceStart = TimeSpan.FromTicks(timeProvider.GetUtcNow().Ticks);
src\Shared\Data.Validation\TimeSpanAttribute.cs (9)
15/// Provides boundary validation for <see cref="TimeSpan"/>. 28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 33public TimeSpan? Maximum 39return TimeSpan.FromMilliseconds((double)_maxMs); 43return _max == null ? null : TimeSpan.Parse(_max, CultureInfo.InvariantCulture); 116var min = Minimum; 130if (value is TimeSpan ts)
Windows\Disk\WindowsDiskIoRatePerfCounter.cs (1)
73TotalCountDict[counter.InstanceName] += (long)value / TimeSpan.TicksPerSecond;
Windows\Disk\WindowsDiskIoTimePerfCounter.cs (1)
71TotalSeconds[counter.InstanceName] += busyTimeTicks / TimeSpan.TicksPerSecond;
Windows\Network\WindowsTcpStateInfo.cs (1)
19private readonly TimeSpan _samplingInterval;
Windows\WindowsContainerSnapshotProvider.cs (6)
21private const double TicksPerSecondDouble = TimeSpan.TicksPerSecond; 38private readonly TimeSpan _cpuRefreshInterval; 39private readonly TimeSpan _memoryRefreshInterval; 161TimeSpan.FromTicks(_timeProvider.GetUtcNow().Ticks), 162TimeSpan.FromTicks(basicAccountingInfo.TotalKernelTime), 163TimeSpan.FromTicks(basicAccountingInfo.TotalUserTime),
Windows\WindowsSnapshotProvider.cs (3)
33private readonly TimeSpan _cpuRefreshInterval; 34private readonly TimeSpan _memoryRefreshInterval; 110totalTimeSinceStart: TimeSpan.FromTicks(_timeProvider.GetUtcNow().Ticks),
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (253)
CalculatorTests.cs (26)
19totalTimeSinceStart: TimeSpan.FromTicks(new FakeTimeProvider().GetUtcNow().Ticks), 20kernelTimeSinceStart: TimeSpan.FromTicks(0), 21userTimeSinceStart: TimeSpan.FromTicks(0), 31TimeSpan secondSnapshotTimeSpan = _firstSnapshot.TotalTimeSinceStart.Add(TimeSpan.FromSeconds(5)); 40kernelTimeSinceStart: TimeSpan.FromTicks(totalAvailableTicks / 4), 43userTimeSinceStart: TimeSpan.FromTicks(totalAvailableTicks / 4), 66TimeSpan secondSnapshotTimeSpan = _firstSnapshot.TotalTimeSinceStart.Add(TimeSpan.FromSeconds(5)); 75kernelTimeSinceStart: TimeSpan.FromTicks(totalAvailableTicks / 4), 78userTimeSinceStart: TimeSpan.FromTicks(totalAvailableTicks / 4), 95totalTimeSinceStart: _firstSnapshot.TotalTimeSinceStart.Add(TimeSpan.FromSeconds(5)), 122totalTimeSinceStart: TimeSpan.FromTicks(new FakeTimeProvider().GetUtcNow().Ticks), 123kernelTimeSinceStart: TimeSpan.FromTicks(1000), 124userTimeSinceStart: TimeSpan.FromTicks(1000), 127totalTimeSinceStart: firstSnapshot.TotalTimeSinceStart.Add(TimeSpan.FromSeconds(5)), 129kernelTimeSinceStart: TimeSpan.FromTicks(firstSnapshot.KernelTimeSinceStart.Ticks - 1), 130userTimeSinceStart: TimeSpan.FromTicks(firstSnapshot.UserTimeSinceStart.Ticks - 1)); 144TimeSpan secondSnapshotTimeSpan = _firstSnapshot.TotalTimeSinceStart.Add(TimeSpan.FromSeconds(5)); 151kernelTimeSinceStart: TimeSpan.FromTicks(totalAvailableTicks / 2), 152userTimeSinceStart: TimeSpan.FromTicks(totalAvailableTicks / 2), 175TimeSpan secondSnapshotTimeSpan = _firstSnapshot.TotalTimeSinceStart.Add(TimeSpan.FromSeconds(5)); 185kernelTimeSinceStart: TimeSpan.FromTicks(totalAvailableTicks), 186userTimeSinceStart: TimeSpan.FromTicks(totalAvailableTicks),
Helpers\DummyProvider.cs (5)
12public static readonly TimeSpan KernelTimeSinceStart = TimeSpan.FromTicks(1000); 17public static readonly TimeSpan UserTimeSinceStart = TimeSpan.FromTicks(1000); 28totalTimeSinceStart: TimeSpan.FromTicks(SnapshotTimeClock.GetUtcNow().Ticks),
Helpers\DummyTracker.cs (1)
16public ResourceUtilization GetUtilization(TimeSpan aggregationPeriod) => new(CpuPercentage, MemoryUsed, new SystemResources(CpuUnits, CpuUnits, MemoryTotal, MemoryTotal));
IResourceUtilizationTrackerTests.cs (1)
16var utilization = tracker.GetUtilization(TimeSpan.Zero);
Linux\AcceptanceTest.cs (31)
46var cpuRefresh = TimeSpan.FromMinutes(13); 47var memoryRefresh = TimeSpan.FromMinutes(14); 75var cpuRefresh = TimeSpan.FromMinutes(13); 76var memoryRefresh = TimeSpan.FromMinutes(14); 98var cpuRefresh = TimeSpan.FromMinutes(13); 99var memoryRefresh = TimeSpan.FromMinutes(14); 147var cpuRefresh = TimeSpan.FromMinutes(13); 148var memoryRefresh = TimeSpan.FromMinutes(14); 195var cpuRefresh = TimeSpan.FromMinutes(13); 196var memoryRefresh = TimeSpan.FromMinutes(14); 257var utilization = tracker.GetUtilization(TimeSpan.FromSeconds(5)); 270clock.Advance(TimeSpan.FromSeconds(6)); 275utilization = tracker.GetUtilization(TimeSpan.FromSeconds(5)); 293var cpuRefresh = TimeSpan.FromMinutes(13); 294var memoryRefresh = TimeSpan.FromMinutes(14); 361var utilization = tracker.GetUtilization(TimeSpan.FromSeconds(5)); 375clock.Advance(TimeSpan.FromSeconds(6)); 380utilization = tracker.GetUtilization(TimeSpan.FromSeconds(5)); 464clock.Advance(TimeSpan.FromSeconds(6));
Linux\Disk\LinuxSystemDiskMetricsTests.cs (8)
177fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 198fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 256fakeTimeProvider.Advance(TimeSpan.FromMinutes(5).Add(TimeSpan.FromSeconds(1))); 265fakeTimeProvider.Advance(TimeSpan.FromMinutes(5).Add(TimeSpan.FromSeconds(1))); 273fakeTimeProvider.Advance(TimeSpan.FromMinutes(5).Add(TimeSpan.FromSeconds(1)));
Linux\LinuxNetworkMetricsTests.cs (2)
88_timeProvider.Advance(TimeSpan.FromMinutes(2)); 106_timeProvider.Advance(TimeSpan.FromMinutes(6));
Linux\LinuxUtilizationProviderTests.cs (3)
345fakeTime.Advance(TimeSpan.FromMinutes(1)); 349fakeTime.Advance(TimeSpan.FromMinutes(5)); 412fakeTime.Advance(TimeSpan.FromMinutes(1));
Providers\ConditionallyFaultProvider.cs (3)
35TimeSpan.FromTicks(new FakeTimeProvider().GetUtcNow().Ticks), 36TimeSpan.FromSeconds(1), 37TimeSpan.FromSeconds(1),
Providers\FakeProvider.cs (3)
12TimeSpan.FromTicks(new FakeTimeProvider().GetUtcNow().Ticks), 13TimeSpan.FromSeconds(1), 14TimeSpan.FromSeconds(1),
Providers\FaultProvider.cs (3)
25return new Snapshot(TimeSpan.FromTicks(_clock.GetUtcNow().Ticks), TimeSpan.Zero, TimeSpan.Zero, ulong.MaxValue);
ResourceMonitoringExtensionsTests.cs (10)
136options.CollectionWindow = TimeSpan.FromSeconds(SamplingWindowValue); 137options.PublishingWindow = TimeSpan.FromSeconds(CalculationPeriodValue); 145Assert.Equal(TimeSpan.FromSeconds(SamplingWindowValue), options!.Value.CollectionWindow); 146Assert.Equal(TimeSpan.FromSeconds(CalculationPeriodValue), options!.Value.PublishingWindow); 161= TimeSpan.FromSeconds(SamplingWindowValue).ToString(), 163= TimeSpan.FromSeconds(SamplingPeriodValue).ToString(), 165= TimeSpan.FromSeconds(CalculationPeriod).ToString() 186Assert.Equal(TimeSpan.FromSeconds(SamplingWindowValue), options!.Value.CollectionWindow); 187Assert.Equal(TimeSpan.FromSeconds(SamplingPeriodValue), options!.Value.SamplingInterval); 188Assert.Equal(TimeSpan.FromSeconds(CalculationPeriod), options!.Value.PublishingWindow);
ResourceMonitoringOptionsCustomValidatorTests.cs (4)
50CollectionWindow = TimeSpan.FromSeconds(collectionWindow), 51PublishingWindow = TimeSpan.FromSeconds(calculationPeriod) 64CollectionWindow = TimeSpan.FromSeconds(1), 65PublishingWindow = TimeSpan.FromSeconds(2)
ResourceMonitoringOptionsTests.cs (3)
16CollectionWindow = TimeSpan.FromMilliseconds(100), 17SamplingInterval = TimeSpan.FromMilliseconds(10), 18PublishingWindow = TimeSpan.FromSeconds(50)
ResourceMonitoringOptionsValidatorTests.cs (15)
17CollectionWindow = TimeSpan.FromMilliseconds(100), 18SamplingInterval = TimeSpan.FromMilliseconds(10), 19PublishingWindow = TimeSpan.FromSeconds(200) 34CollectionWindow = TimeSpan.FromTicks(1), 35SamplingInterval = TimeSpan.FromSeconds(1), 36PublishingWindow = TimeSpan.FromSeconds(200) 49CollectionWindow = TimeSpan.FromMilliseconds(100), 50SamplingInterval = TimeSpan.FromMilliseconds(0), 51PublishingWindow = TimeSpan.FromSeconds(200) 64CollectionWindow = TimeSpan.FromMilliseconds(100), 65SamplingInterval = TimeSpan.FromMilliseconds(1), 66PublishingWindow = TimeSpan.FromSeconds(-5) 109CollectionWindow = TimeSpan.FromMilliseconds(samplingWindow), 110SamplingInterval = TimeSpan.FromMilliseconds(samplingPeriod), 111PublishingWindow = TimeSpan.FromMilliseconds(calculationPeriod)
ResourceMonitoringServiceTests.cs (80)
112CollectionWindow = TimeSpan.FromMilliseconds(int.MaxValue), 113SamplingInterval = TimeSpan.FromMilliseconds(int.MaxValue) 170CollectionWindow = TimeSpan.FromSeconds(1), 171PublishingWindow = TimeSpan.FromSeconds(1) 202CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod), 203SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod), 204PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod) 217await Task.Delay(TimeSpan.FromMilliseconds(TimerPeriod * 3)); 243CollectionWindow = TimeSpan.FromMilliseconds(100), 244PublishingWindow = TimeSpan.FromMilliseconds(100), 245SamplingInterval = TimeSpan.FromMilliseconds(1) 258clock.Advance(TimeSpan.FromMilliseconds(1)); 259clock.Advance(TimeSpan.FromMilliseconds(1)); 276CollectionWindow = TimeSpan.FromMilliseconds(100), 277PublishingWindow = TimeSpan.FromMilliseconds(100) 317CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod), 318PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod), 319SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 338clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 360CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod), 361PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod), 362SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 370clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 388TimeSpan.FromTicks(clock.GetUtcNow().Ticks), 389TimeSpan.Zero, 390TimeSpan.Zero, 402TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod).Ticks), 403TimeSpan.FromMilliseconds(250), 404TimeSpan.FromMilliseconds(250), 407TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 2).Ticks), 408TimeSpan.FromMilliseconds(250), 409TimeSpan.FromMilliseconds(250), 412TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 3).Ticks), 413TimeSpan.FromMilliseconds(250), 414TimeSpan.FromMilliseconds(250), 417TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 4).Ticks), 418TimeSpan.FromMilliseconds(250), 419TimeSpan.FromMilliseconds(250), 422TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 5).Ticks), 423TimeSpan.FromMilliseconds(250), 424TimeSpan.FromMilliseconds(250), 437CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 438PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 439SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 465clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 471clock.Advance(TimeSpan.FromTicks(1)); 495TimeSpan.FromTicks(clock.GetUtcNow().Ticks), 496TimeSpan.FromMilliseconds(250), 497TimeSpan.FromMilliseconds(250), 508TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod).Ticks), 509TimeSpan.FromMilliseconds(250), 510TimeSpan.FromMilliseconds(250), 513TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 2).Ticks), 514TimeSpan.FromMilliseconds(250), 515TimeSpan.FromMilliseconds(250), 518TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 3).Ticks), 519TimeSpan.FromMilliseconds(250), 520TimeSpan.FromMilliseconds(250), 523TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 4).Ticks), 524TimeSpan.FromMilliseconds(250), 525TimeSpan.FromMilliseconds(250), 528TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 5).Ticks), 529TimeSpan.FromMilliseconds(250), 530TimeSpan.FromMilliseconds(250), 546CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 547PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 548SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 574clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 643TimeSpan.FromTicks(_clock.GetUtcNow().Ticks), 644TimeSpan.FromSeconds(1), 645TimeSpan.FromSeconds(1), 653CollectionWindow = TimeSpan.FromSeconds(1), 654SamplingInterval = TimeSpan.FromMilliseconds(100), 655PublishingWindow = TimeSpan.FromSeconds(1) 663var exception = Record.Exception(() => _ = tracker.GetUtilization(TimeSpan.FromSeconds(1))); 678CollectionWindow = TimeSpan.FromSeconds(6), 679PublishingWindow = TimeSpan.FromSeconds(5) 687var exception = Record.Exception(() => tracker.GetUtilization(TimeSpan.FromSeconds(6))); 702CollectionWindow = TimeSpan.FromSeconds(5) 710var exception = Record.Exception(() => tracker.GetUtilization(TimeSpan.FromSeconds(6)));
SnapshotTests.cs (9)
18var snapshot = new Snapshot(TimeSpan.FromTicks(time.GetUtcNow().Ticks), TimeSpan.Zero, TimeSpan.FromSeconds(1), 10); 22snapshot = new Snapshot(time, TimeSpan.Zero, TimeSpan.FromSeconds(1), 10); 30=> new Snapshot(new FakeTimeProvider(), TimeSpan.MinValue, TimeSpan.FromSeconds(1), 1000)); 37=> new Snapshot(new FakeTimeProvider(), TimeSpan.Zero, TimeSpan.MinValue, 1000));
Windows\Disk\WindowsDiskIoRatePerfCounterTests.cs (2)
25var fakeTimeProvider = new FakeTimeProvider { AutoAdvanceAmount = TimeSpan.FromSeconds(60) }; 72var fakeTimeProvider = new FakeTimeProvider { AutoAdvanceAmount = TimeSpan.FromSeconds(30) };
Windows\Disk\WindowsDiskIoTimePerfCounterTests.cs (1)
25var fakeTimeProvider = new FakeTimeProvider { AutoAdvanceAmount = TimeSpan.FromSeconds(60) };
Windows\Disk\WindowsDiskMetricsTests.cs (8)
83fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 93fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 102fakeTimeProvider.Advance(TimeSpan.FromSeconds(30)); 111fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 157fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 167fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 176fakeTimeProvider.Advance(TimeSpan.FromSeconds(30)); 185fakeTimeProvider.Advance(TimeSpan.FromMinutes(1));
Windows\Tcp6TableInfoTests.cs (2)
21public static readonly TimeSpan DefaultTimeSpan = TimeSpan.FromSeconds(5);
Windows\TcpTableInfoTests.cs (2)
18public static readonly TimeSpan DefaultTimeSpan = TimeSpan.FromSeconds(5);
Windows\WindowsContainerSnapshotProviderTests.cs (23)
217var options = new ResourceMonitoringOptions { CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) }; 233Assert.Contains(_accountingInfo.TotalKernelTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 234Assert.Contains(_accountingInfo.TotalKernelTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 237fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 240Assert.Contains(updatedAccountingInfo.TotalKernelTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 241Assert.Contains(updatedAccountingInfo.TotalKernelTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 244fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 249Assert.Contains(updatedAccountingInfo.TotalKernelTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 250Assert.Contains(updatedAccountingInfo.TotalKernelTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 283CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 303fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 309fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 316fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 352MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 372fakeClock.Advance(options.MemoryConsumptionRefreshInterval - TimeSpan.FromMilliseconds(1)); 377fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 411MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) 437fakeClock.Advance(options.MemoryConsumptionRefreshInterval - TimeSpan.FromMilliseconds(1)); 449fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 489MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 507fakeClock.Advance(options.MemoryConsumptionRefreshInterval - TimeSpan.FromMilliseconds(1)); 512fakeClock.Advance(TimeSpan.FromMilliseconds(2)); 517fakeClock.Advance(TimeSpan.FromMilliseconds(2));
Windows\WindowsCountersTests.cs (2)
27SamplingInterval = TimeSpan.FromSeconds(5) 69SamplingInterval = TimeSpan.FromSeconds(5)
Windows\WindowsSnapshotProviderTests.cs (6)
82CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 103fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 108fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 123MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 144fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 150fakeClock.Advance(TimeSpan.FromMilliseconds(1));
Microsoft.Extensions.Diagnostics.Testing (1)
Metrics\MetricCollector.cs (1)
253public async Task WaitForMeasurementsAsync(int minCount, TimeSpan timeout)
Microsoft.Extensions.Diagnostics.Testing.Tests (15)
Logging\FakeLogCollectorTests.cs (2)
32timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 74timeProvider.Advance(TimeSpan.FromMilliseconds(1));
Logging\FakeLoggerTests.cs (3)
259timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 266Assert.Equal(start + TimeSpan.FromMilliseconds(1), records[2].Timestamp); 267Assert.Equal(start + TimeSpan.FromMilliseconds(1), records[3].Timestamp);
Metrics\MetricCollectorTests.cs (10)
69timeProvider.Advance(TimeSpan.FromSeconds(1)); 114timeProvider.Advance(TimeSpan.FromSeconds(1)); 161timeProvider.Advance(TimeSpan.FromSeconds(1)); 222timeProvider.Advance(TimeSpan.FromSeconds(1)); 312var wait = collector.WaitForMeasurementsAsync(2, TimeSpan.FromSeconds(1)); 321wait = collector.WaitForMeasurementsAsync(1, TimeSpan.FromSeconds(1)); 327await wait.WaitAsync(TimeSpan.FromSeconds(5), TimeProvider.System); 341await Assert.ThrowsAnyAsync<OperationCanceledException>(() => collector.WaitForMeasurementsAsync(1, TimeSpan.FromMilliseconds(50))); 356var wait = collector.WaitForMeasurementsAsync(2, TimeSpan.FromSeconds(1)); 367await Assert.ThrowsAsync<ObjectDisposedException>(async () => await collector.WaitForMeasurementsAsync(1, TimeSpan.FromSeconds(1)));
Microsoft.Extensions.FileProviders.Physical (7)
PhysicalFilesWatcher.cs (3)
27internal static TimeSpan DefaultPollingInterval = TimeSpan.FromSeconds(4); 107_timerFactory = () => NonCapturingTimer.Create(RaiseChangeEvents, state: PollingChangeTokens, dueTime: TimeSpan.Zero, period: DefaultPollingInterval);
PollingFileChangeToken.cs (1)
42internal static TimeSpan PollingInterval { get; set; } = PhysicalFilesWatcher.DefaultPollingInterval;
PollingWildCardChangeToken.cs (1)
69internal TimeSpan PollingInterval { get; set; } = PhysicalFilesWatcher.DefaultPollingInterval;
src\libraries\Common\src\Extensions\NonCapturingTimer\NonCapturingTimer.cs (2)
14public static Timer Create(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period)
Microsoft.Extensions.Hosting (5)
HostOptions.cs (5)
24public TimeSpan ShutdownTimeout { get; set; } = TimeSpan.FromSeconds(30); 34public TimeSpan StartupTimeout { get; set; } = Timeout.InfiniteTimeSpan; 68ShutdownTimeout = TimeSpan.FromSeconds(seconds); 75StartupTimeout = TimeSpan.FromSeconds(seconds);
Microsoft.Extensions.Hosting.Abstractions (1)
HostingAbstractionsHostExtensions.cs (1)
32public static async Task StopAsync(this IHost host, TimeSpan timeout)
Microsoft.Extensions.Hosting.Testing (7)
FakeHostOptions.cs (6)
19public TimeSpan StartUpTimeout { get; set; } = TimeSpan.FromSeconds(5); 26public TimeSpan ShutDownTimeout { get; set; } = TimeSpan.FromSeconds(10); 36public TimeSpan TimeToLive { get; set; } = TimeSpan.FromSeconds(30);
HostTerminatorService.cs (1)
64private partial void LogTimeToLiveUp(TimeSpan timeToLive);
Microsoft.Extensions.Hosting.Testing.Tests (10)
FakeHostTests.cs (10)
32x.TimeToLive = TimeSpan.Zero; 48var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.Zero }); 51await Task.Delay(TimeSpan.FromMilliseconds(100)); 66var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.Zero }); 77var cancellationTokenSource = timeProvider.CreateCancellationTokenSource(TimeSpan.FromMilliseconds(1)); 86var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.FromMilliseconds(-1) }); 108var sut = new FakeHost(hostMock.Object, new FakeHostOptions { ShutDownTimeout = TimeSpan.Zero }); 125var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.Zero }); 137var cancellationTokenSource = timeProvider.CreateCancellationTokenSource(TimeSpan.FromMilliseconds(1)); 146var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.FromMilliseconds(-1) });
Microsoft.Extensions.Http (37)
ActiveHandlerTrackingEntry.cs (2)
26TimeSpan lifetime) 38public TimeSpan Lifetime { get; }
DefaultHttpClientFactory.cs (4)
34private readonly TimeSpan DefaultCleanupInterval = TimeSpan.FromSeconds(10); 355public static void CleanupCycleEnd(Lazy<ILogger> loggerLazy, TimeSpan duration, int disposedCount, int finalCount) 371public static void HandlerExpired(Lazy<ILogger> loggerLazy, string clientName, TimeSpan lifetime)
DefaultHttpMessageHandlerBuilder.cs (2)
72TimeSpan lifetime = optionsMonitor.Get(_name).HandlerLifetime; 73if (lifetime >= TimeSpan.Zero)
DependencyInjection\HttpClientBuilderExtensions.cs (1)
616public static IHttpClientBuilder SetHandlerLifetime(this IHttpClientBuilder builder, TimeSpan handlerLifetime)
DependencyInjection\SocketsHttpHandlerBuilderExtensions.cs (11)
55/// Only simple (of type `bool`, `int`, <see cref="Enum"/> or <see cref="TimeSpan"/>) properties of <see cref="SocketsHttpHandler"/> will be parsed. 169public TimeSpan? PooledConnectionIdleTimeout { get; init; } 170public TimeSpan? PooledConnectionLifetime { get; init; } 172public TimeSpan? ResponseDrainTimeout { get; init; } 183public TimeSpan? ConnectTimeout { get; init; } 184public TimeSpan? Expect100ContinueTimeout { get; init; } 185public TimeSpan? KeepAlivePingDelay { get; init; } 186public TimeSpan? KeepAlivePingTimeout { get; init; } 222private static TimeSpan? ParseTimeSpan(string? timeSpanString) => TimeSpan.TryParse(timeSpanString, out var result) ? result : null;
HttpClientFactoryOptions.cs (5)
21internal static readonly TimeSpan MinimumHandlerLifetime = TimeSpan.FromSeconds(1); 23private TimeSpan _handlerLifetime = TimeSpan.FromMinutes(2); 59public TimeSpan HandlerLifetime
Logging\IHttpClientAsyncLogger.cs (2)
51ValueTask LogRequestStopAsync(object? context, HttpRequestMessage request, HttpResponseMessage response, TimeSpan elapsed, CancellationToken cancellationToken = default); 63ValueTask LogRequestFailedAsync(object? context, HttpRequestMessage request, HttpResponseMessage? response, Exception exception, TimeSpan elapsed, CancellationToken cancellationToken = default);
Logging\IHttpClientLogger.cs (2)
39void LogRequestStop(object? context, HttpRequestMessage request, HttpResponseMessage response, TimeSpan elapsed); 49void LogRequestFailed(object? context, HttpRequestMessage request, HttpResponseMessage? response, Exception exception, TimeSpan elapsed);
Logging\LogHelper.cs (4)
87public static void LogRequestEnd(this ILogger logger, HttpResponseMessage response, TimeSpan duration, Func<string, bool> shouldRedactHeaderValue) 102public static void LogRequestFailed(this ILogger logger, TimeSpan duration, HttpRequestException exception) => 126public static void LogRequestPipelineEnd(this ILogger logger, HttpResponseMessage response, TimeSpan duration, Func<string, bool> shouldRedactHeaderValue) 141public static void LogRequestPipelineFailed(this ILogger logger, TimeSpan duration, HttpRequestException exception) =>
src\libraries\Common\src\Extensions\NonCapturingTimer\NonCapturingTimer.cs (2)
14public static Timer Create(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period)
ValueStopwatch.cs (2)
11private static readonly double s_timestampToTicks = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency; 24public TimeSpan GetElapsedTime()
Microsoft.Extensions.Http.Diagnostics (13)
Logging\Internal\HttpClientLogger.cs (6)
116TimeSpan elapsed, 125TimeSpan elapsed, 132public void LogRequestStop(object? context, HttpRequestMessage request, HttpResponseMessage response, TimeSpan elapsed) 135public void LogRequestFailed(object? context, HttpRequestMessage request, HttpResponseMessage? response, Exception exception, TimeSpan elapsed) 158TimeSpan elapsed, 223LogRecord logRecord, LoggerMessageState loggerMessageState, in TimeSpan elapsed,
Logging\Internal\HttpRequestBodyReader.cs (2)
21internal readonly TimeSpan RequestReadTimeout; 59TimeSpan readTimeout, int readSizeLimit, CancellationToken cancellationToken)
Logging\Internal\HttpResponseBodyReader.cs (3)
23internal readonly TimeSpan ResponseReadTimeout; 63private static async ValueTask<string> ReadFromStreamWithTimeoutAsync(HttpResponseMessage response, TimeSpan readTimeout, int readSizeLimit, CancellationToken cancellationToken) 71if (readTimeout <= TimeSpan.Zero)
Logging\LoggingOptions.cs (2)
72public TimeSpan BodyReadTimeout { get; set; } = TimeSpan.FromSeconds(1);
Microsoft.Extensions.Http.Diagnostics.Tests (49)
Logging\HttpClientLoggerTest.cs (11)
59BodyReadTimeout = TimeSpan.FromMinutes(5) 209BodyReadTimeout = TimeSpan.FromMinutes(5), 302BodyReadTimeout = TimeSpan.FromMinutes(5), 411BodyReadTimeout = TimeSpan.FromMinutes(5), 508BodyReadTimeout = TimeSpan.FromMinutes(5), 623BodyReadTimeout = TimeSpan.FromMinutes(5), 894BodyReadTimeout = TimeSpan.FromMinutes(5), 919fakeTimeProvider.Advance(TimeSpan.FromMilliseconds(1000)); 992await logger.LogRequestStopAsync(new LogRecord(), httpRequestMessage, httpResponseMessage, TimeSpan.Zero); 1013Assert.Throws<NotSupportedException>(() => logger.LogRequestStop(null, httpRequestMessage, httpResponseMessage, TimeSpan.Zero)); 1014Assert.Throws<NotSupportedException>(() => logger.LogRequestFailed(null, httpRequestMessage, null, new InvalidOperationException(), TimeSpan.Zero));
Logging\HttpClientLoggingExtensionsTest.cs (18)
86.AddExtendedHttpClientLogging(options => options.BodyReadTimeout = TimeSpan.FromSeconds(1)) 89.AddExtendedHttpClientLogging(options => options.BodyReadTimeout = TimeSpan.FromSeconds(2)) 98optionsFirst.BodyReadTimeout.Should().Be(TimeSpan.FromSeconds(1)); 99optionsSecond.BodyReadTimeout.Should().Be(TimeSpan.FromSeconds(2)); 109.AddExtendedHttpClientLogging(options => options.BodyReadTimeout = TimeSpan.FromSeconds(1)) 112.AddExtendedHttpClientLogging(options => options.BodyReadTimeout = TimeSpan.FromSeconds(2)) 121optionsFirst.BodyReadTimeout.Should().Be(TimeSpan.FromSeconds(1)); 122optionsSecond.BodyReadTimeout.Should().Be(TimeSpan.FromSeconds(2)); 152var bodyReadTimeout = TimeSpan.FromSeconds(1); 209options.BodyReadTimeout = TimeSpan.Zero; 227var timeoutValue = TimeSpan.FromSeconds(seconds); 261var bodyReadTimeout = TimeSpan.FromSeconds(1); 319options.BodyReadTimeout = TimeSpan.Zero; 377var timeoutValue = TimeSpan.FromSeconds(seconds);
Logging\HttpRequestBodyReaderTest.cs (4)
129BodyReadTimeout = TimeSpan.FromMinutes(100) 153BodyReadTimeout = TimeSpan.FromMinutes(100) 254var timeout = TimeSpan.FromSeconds(274);
Logging\HttpRequestReaderTest.cs (8)
65BodyReadTimeout = TimeSpan.FromSeconds(100000), 129BodyReadTimeout = TimeSpan.FromSeconds(10), 191BodyReadTimeout = TimeSpan.FromSeconds(10), 265BodyReadTimeout = TimeSpan.FromSeconds(10), 337BodyReadTimeout = TimeSpan.FromSeconds(10), 396BodyReadTimeout = TimeSpan.FromSeconds(10), 467BodyReadTimeout = TimeSpan.FromSeconds(10), 534BodyReadTimeout = TimeSpan.FromSeconds(10),
Logging\HttpResponseBodyReaderTest.cs (4)
210BodyReadTimeout = TimeSpan.Zero 238BodyReadTimeout = TimeSpan.Zero 272var timeout = TimeSpan.FromSeconds(274);
Logging\Internal\TestConfiguration.cs (1)
17public static IConfigurationSection GetHttpClientLoggingConfigurationSection(TimeSpan timeout) =>
Logging\LoggingOptionsTest.cs (2)
43var testTimeout = TimeSpan.FromMinutes(1);
Logging\LoggingOptionsValidatorTest.cs (1)
34var options = new LoggingOptions { BodyReadTimeout = TimeSpan.Zero };
Microsoft.Extensions.Http.Polly (3)
src\Shared\ValueStopwatch\ValueStopwatch.cs (3)
12private static readonly double TimestampToTicks = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency; 26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
Microsoft.Extensions.Http.Polly.Tests (7)
PolicyHttpMessageHandlerTest.cs (7)
157.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking: 2, durationOfBreak: TimeSpan.FromSeconds(10)); 233.TimeoutAsync<HttpResponseMessage>(TimeSpan.FromMilliseconds(50)) // Apply a 50ms timeout 275var policy = Policy.TimeoutAsync<HttpResponseMessage>(TimeSpan.FromSeconds(10)); 303var policy = Policy.TimeoutAsync<HttpResponseMessage>(TimeSpan.FromSeconds(10)); 355var policy = Policy.TimeoutAsync<HttpResponseMessage>(TimeSpan.FromSeconds(10)); 382var policy = Policy.TimeoutAsync<HttpResponseMessage>(TimeSpan.FromSeconds(10)); 394using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(3)))
Microsoft.Extensions.Http.Resilience (22)
Hedging\HedgingEndpointOptions.cs (1)
57Timeout = TimeSpan.FromSeconds(10),
Hedging\Internals\Validators\HttpStandardHedgingResilienceOptionsCustomValidator.cs (4)
24var timeout = TimeSpan.FromMilliseconds(options.Endpoint.Timeout.Timeout.TotalMilliseconds * CircuitBreakerTimeoutMultiplier); 36var maxHedgingDelay = TimeSpan.FromMilliseconds(options.Hedging.MaxHedgedAttempts * options.Hedging.Delay.TotalMilliseconds);
Internal\RetryAfterHelper.cs (4)
13/// If not found then it will return <see cref="TimeSpan.Zero" />. 16internal static bool TryParse(HttpResponseMessage response, TimeProvider timeProvider, out TimeSpan retryAfter) 27if (parsed && delay < TimeSpan.Zero) 29delay = TimeSpan.Zero;
Polly\HttpRetryStrategyOptions.cs (2)
59HttpResponseMessage response when RetryAfterHelper.TryParse(response, TimeProvider.System, out var retryAfter) => new ValueTask<TimeSpan?>(retryAfter),
Resilience\HttpStandardResilienceOptions.cs (1)
95Timeout = TimeSpan.FromSeconds(10),
Resilience\Internal\Validators\HttpStandardResilienceOptionsCustomValidator.cs (1)
24if (options.CircuitBreaker.SamplingDuration < TimeSpan.FromMilliseconds(options.AttemptTimeout.Timeout.TotalMilliseconds * CircuitBreakerTimeoutMultiplier))
src\Shared\Data.Validation\TimeSpanAttribute.cs (9)
15/// Provides boundary validation for <see cref="TimeSpan"/>. 28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 33public TimeSpan? Maximum 39return TimeSpan.FromMilliseconds((double)_maxMs); 43return _max == null ? null : TimeSpan.Parse(_max, CultureInfo.InvariantCulture); 116var min = Minimum; 130if (value is TimeSpan ts)
Microsoft.Extensions.Http.Resilience.PerformanceTests (5)
RetryBenchmark.cs (2)
44Delay = TimeSpan.FromSeconds(1), 60.AddPolicyHandler(builder.WaitAndRetryAsync(3, _ => TimeSpan.FromSeconds(1)));
StandardResilienceBenchmark.cs (3)
54builder.AdvancedCircuitBreakerAsync(0.1, TimeSpan.FromSeconds(30), 100, TimeSpan.FromSeconds(5)), 55builder.WaitAndRetryAsync(3, _ => TimeSpan.FromSeconds(1)),
Microsoft.Extensions.Http.Resilience.Tests (58)
Hedging\HttpStandardHedgingResilienceOptionsCustomValidatorTests.cs (12)
19options.Endpoint.CircuitBreaker.SamplingDuration = TimeSpan.FromSeconds(1); 20options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(1); 47options.Endpoint.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.Endpoint.Timeout.Timeout.TotalMilliseconds * 2); 53TimeSpan.FromMilliseconds(options.Endpoint.Timeout.Timeout.TotalMilliseconds * 2) + TimeSpan.FromMilliseconds(10); 62options.Hedging.Delay = TimeSpan.FromDays(1); 63options.Hedging.DelayGenerator = _ => new ValueTask<TimeSpan>(TimeSpan.FromDays(1)); 82options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(2); 83options.Endpoint.Timeout.Timeout = TimeSpan.FromSeconds(3); 87options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(2); 92options.Endpoint.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.Endpoint.Timeout.Timeout.TotalMilliseconds / 2);
Hedging\HttpStandardHedgingResilienceOptionsTests.cs (2)
22_options.TotalRequestTimeout.Timeout.Should().Be(TimeSpan.FromSeconds(30)); 23_options.Endpoint.Timeout.Timeout.Should().Be(TimeSpan.FromSeconds(10));
Hedging\StandardHedgingTests.cs (6)
40options.Hedging.Delay = TimeSpan.FromMilliseconds(5); 55Builder.Configure(options => options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(1)); 328opt.Hedging.Delay = TimeSpan.FromSeconds(11); 330opt.Endpoint.CircuitBreaker.SamplingDuration = TimeSpan.FromSeconds(900); 331opt.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(200); 332opt.Endpoint.Timeout.Timeout = TimeSpan.FromSeconds(200);
Internal\RetryAfterHelperTests.cs (11)
20response.Headers.RetryAfter = new RetryConditionHeaderValue(TimeSpan.FromSeconds(10)); 22var parsed = RetryAfterHelper.TryParse(response, TimeProvider.System, out var retryAfter); 25retryAfter.Should().Be(TimeSpan.FromSeconds(10)); 33var parsed = RetryAfterHelper.TryParse(response, TimeProvider.System, out var retryAfter); 45response.Headers.RetryAfter = new RetryConditionHeaderValue(timeProvider.GetUtcNow() + TimeSpan.FromDays(1)); 47var parsed = RetryAfterHelper.TryParse(response, timeProvider, out var retryAfter); 50retryAfter.Should().Be(TimeSpan.FromDays(1)); 59response.Headers.RetryAfter = new RetryConditionHeaderValue(timeProvider.GetUtcNow() + TimeSpan.FromDays(1)); 61timeProvider.Advance(TimeSpan.FromDays(2)); 62var parsed = RetryAfterHelper.TryParse(response, timeProvider, out var retryAfter); 65retryAfter.Should().Be(TimeSpan.Zero);
Polly\HttpCircuitBreakerStrategyOptionsTests.cs (2)
40_testObject.BreakDuration.Should().Be(TimeSpan.FromSeconds(5)); 42_testObject.SamplingDuration.Should().Be(TimeSpan.FromSeconds(30));
Polly\HttpRetryStrategyOptionsTests.cs (3)
42options.Delay.Should().Be(TimeSpan.FromSeconds(2)); 134RetryAfter = new RetryConditionHeaderValue(TimeSpan.FromSeconds(10)) 143Assert.Equal(result, TimeSpan.FromSeconds(10));
Polly\HttpTimeoutStrategyOptionsTests.cs (1)
23_testObject.Timeout.Should().Be(TimeSpan.FromSeconds(30));
Resilience\HttpClientBuilderExtensionsTests.BySelector.cs (4)
33.AddResilienceHandler("dummy", builder => builder.AddTimeout(TimeSpan.FromSeconds(1))) 50var builder = _builder.AddResilienceHandler("dummy", builder => builder.AddTimeout(TimeSpan.FromSeconds(1))).SelectPipelineByAuthority(); 72.AddResilienceHandler("dummy", builder => builder.AddTimeout(TimeSpan.FromSeconds(1))) 119.AddResilienceHandler("dummy", builder => builder.AddTimeout(TimeSpan.FromSeconds(1)))
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (3)
74builder.AddTimeout(TimeSpan.FromSeconds(1)); 128options.Retry.Delay = TimeSpan.Zero; 361private void ConfigureBuilder(ResiliencePipelineBuilder<HttpResponseMessage> builder) => builder.AddTimeout(TimeSpan.FromSeconds(1));
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (3)
188options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(1); 189options.AttemptTimeout.Timeout = TimeSpan.FromSeconds(2); 238options.Retry.Delay = TimeSpan.Zero;
Resilience\HttpStandardResilienceOptionsCustomValidatorTests.cs (9)
25options.CircuitBreaker.SamplingDuration = TimeSpan.FromSeconds(1); 26options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(1); 53options.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.AttemptTimeout.Timeout.TotalMilliseconds * 2); 58options.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.AttemptTimeout.Timeout.TotalMilliseconds * 2) + TimeSpan.FromMilliseconds(10); 83options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(2); 84options.AttemptTimeout.Timeout = TimeSpan.FromSeconds(3); 88options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(2); 93options.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.AttemptTimeout.Timeout.TotalMilliseconds / 2);
Resilience\HttpStandardResilienceOptionsTests.cs (2)
17_options.AttemptTimeout.Timeout.Should().Be(TimeSpan.FromSeconds(10)); 18_options.TotalRequestTimeout.Timeout.Should().Be(TimeSpan.FromSeconds(30));
Microsoft.Extensions.Identity.Core (13)
LockoutOptions.cs (4)
31/// Gets or sets the <see cref="TimeSpan"/> a user is locked out for when a lockout occurs. Defaults to 5 minutes. 33/// <value>The <see cref="TimeSpan"/> a user is locked out for when a lockout occurs.</value> 34public TimeSpan DefaultLockoutTimeSpan { get; set; } = TimeSpan.FromMinutes(5);
Rfc6238AuthenticationService.cs (3)
17private static readonly TimeSpan _timestep = TimeSpan.FromMinutes(3); 84var delta = DateTimeOffset.UtcNow - DateTimeOffset.UnixEpoch;
src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
UserManagerMetrics.cs (4)
86var duration = GetElapsedTime(startTimestamp); 105var duration = GetElapsedTime(startTimestamp); 123var duration = GetElapsedTime(startTimestamp); 185private static TimeSpan GetElapsedTime(long startTimestamp)
Microsoft.Extensions.Logging.AzureAppServices (9)
BatchingLoggerOptions.cs (4)
15private TimeSpan _flushPeriod = TimeSpan.FromSeconds(1); 20public TimeSpan FlushPeriod 25if (value <= TimeSpan.Zero)
BatchingLoggerProvider.cs (4)
19private readonly TimeSpan _interval; 46if (loggerOptions.FlushPeriod <= TimeSpan.Zero) 127/// Wait for the given <see cref="TimeSpan"/>. 132protected virtual Task IntervalAsync(TimeSpan interval, CancellationToken cancellationToken)
BlobLoggerProvider.cs (1)
67new DateTimeOffset(key.Year, key.Month, key.Day, key.Hour, 0, 0, TimeSpan.Zero)));
Microsoft.Extensions.ML (11)
Builder\BuilderExtensions.cs (4)
69return builder.FromUri(modelName, uri, TimeSpan.FromMinutes(5)); 84this PredictionEnginePoolBuilder<TData, TPrediction> builder, string uri, TimeSpan period) 107this PredictionEnginePoolBuilder<TData, TPrediction> builder, string modelName, string uri, TimeSpan period) 131this PredictionEnginePoolBuilder<TData, TPrediction> builder, string modelName, Uri uri, TimeSpan period)
ModelLoaders\FileModelLoader.cs (3)
184public static void FileReloadEnd(ILogger logger, string filePath, TimeSpan duration) 189public static void FileReloadError(ILogger logger, string filePath, TimeSpan duration, Exception exception) 194public static void ReloadingFile(ILogger logger, string filePath, TimeSpan duration)
ModelLoaders\UriModelLoader.cs (4)
24private TimeSpan? _timerPeriod; 45internal void Start(Uri uri, TimeSpan period) 218public static void UriReloadEnd(ILogger logger, Uri uri, TimeSpan duration) 223public static void UriReloadError(ILogger logger, Uri uri, TimeSpan duration, Exception exception)
Microsoft.Extensions.ML.Tests (2)
UriLoaderTests.cs (2)
48loaderUnderTest.Start(new Uri("https://microsoft.com"), TimeSpan.FromMilliseconds(1)); 70loaderUnderTest.Start(new Uri("https://microsoft.com"), TimeSpan.FromMilliseconds(1));
Microsoft.Extensions.ServiceDiscovery (8)
Http\HttpServiceEndpointResolver.cs (2)
17private static readonly TimeSpan s_cleanupPeriod = TimeSpan.FromSeconds(10);
ServiceDiscoveryOptions.cs (2)
23public TimeSpan RefreshPeriod { get; set; } = TimeSpan.FromSeconds(60);
ServiceEndpointResolver.cs (2)
15private static readonly TimeSpan s_cleanupPeriod = TimeSpan.FromSeconds(10);
ServiceEndpointWatcher.cs (2)
244_pollingTimer = _timeProvider.CreateTimer(s_pollingAction, this, _options.RefreshPeriod, TimeSpan.Zero); 248_pollingTimer.Change(_options.RefreshPeriod, TimeSpan.Zero);
Microsoft.Extensions.ServiceDiscovery.Dns (47)
DnsServiceEndpointProvider.cs (7)
20protected override TimeSpan MinRetryPeriod => options.CurrentValue.MinRetryPeriod; 21protected override TimeSpan MaxRetryPeriod => options.CurrentValue.MaxRetryPeriod; 22protected override TimeSpan DefaultRefreshPeriod => options.CurrentValue.DefaultRefreshPeriod; 32var ttl = DefaultRefreshPeriod; 51static TimeSpan MinTtl(DateTime now, DateTime expiresAt, TimeSpan existing) 53var candidate = expiresAt - now;
DnsServiceEndpointProviderBase.cs (10)
24private TimeSpan _nextRefreshPeriod; 46private TimeSpan ElapsedSinceRefresh => _timeProvider.GetElapsedTime(_lastRefreshTimeStamp); 52protected abstract TimeSpan MinRetryPeriod { get; } 54protected abstract TimeSpan MaxRetryPeriod { get; } 56protected abstract TimeSpan DefaultRefreshPeriod { get; } 105protected void SetResult(List<ServiceEndpoint> endpoints, TimeSpan validityPeriod) 118validityPeriod = TimeSpan.Zero; 122if (validityPeriod <= TimeSpan.Zero) 137TimeSpan GetRefreshPeriod() 150return TimeSpan.FromTicks(nextTicks);
DnsServiceEndpointProviderOptions.cs (6)
14public TimeSpan DefaultRefreshPeriod { get; set; } = TimeSpan.FromMinutes(1); 19public TimeSpan MinRetryPeriod { get; set; } = TimeSpan.FromSeconds(1); 24public TimeSpan MaxRetryPeriod { get; set; } = TimeSpan.FromSeconds(30);
DnsSrvServiceEndpointProvider.cs (7)
22protected override TimeSpan MinRetryPeriod => options.CurrentValue.MinRetryPeriod; 24protected override TimeSpan MaxRetryPeriod => options.CurrentValue.MaxRetryPeriod; 26protected override TimeSpan DefaultRefreshPeriod => options.CurrentValue.DefaultRefreshPeriod; 35var ttl = DefaultRefreshPeriod; 61static TimeSpan MinTtl(DateTime now, DateTime expiresAt, TimeSpan existing) 63var candidate = expiresAt - now;
DnsSrvServiceEndpointProviderOptions.cs (6)
14public TimeSpan DefaultRefreshPeriod { get; set; } = TimeSpan.FromMinutes(1); 19public TimeSpan MinRetryPeriod { get; set; } = TimeSpan.FromSeconds(1); 24public TimeSpan MaxRetryPeriod { get; set; } = TimeSpan.FromSeconds(30);
FallbackDnsResolver.cs (3)
24private TimeSpan DefaultRefreshPeriod => _options.CurrentValue.DefaultRefreshPeriod; 66ExpiresAt = now.Add(TimeSpan.FromSeconds(record.TimeToLive)) 79ExpiresAt = now.Add(TimeSpan.FromSeconds(record.TimeToLive)),
Resolver\DnsResolver.cs (4)
23private static readonly TimeSpan s_maxTimeout = TimeSpan.FromMilliseconds(int.MaxValue); 44ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(options.Timeout, TimeSpan.Zero); 877TimeSpan timeout = _options.Timeout;
Resolver\DnsResolver.Telemetry.cs (2)
30activity.Stop(answers, error, endingTimestamp, out TimeSpan duration); 76public void Stop(object? answers, SendQueryError error, long endingTimestamp, out TimeSpan duration)
Resolver\ResolverOptions.cs (2)
12public TimeSpan Timeout = TimeSpan.FromSeconds(3);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (12)
DnsServiceEndpointResolverTests.cs (3)
22.AddDnsServiceEndpointProvider(o => o.DefaultRefreshPeriod = TimeSpan.FromSeconds(30)) 28timeProvider.Advance(TimeSpan.FromSeconds(7)); 32timeProvider.Advance(TimeSpan.FromSeconds(80));
Resolver\LoopbackDnsTestBase.cs (1)
28Timeout = TimeSpan.FromSeconds(5),
Resolver\ResolveAddressesTests.cs (3)
237Options.Timeout = TimeSpan.FromSeconds(1); 248Options.Timeout = TimeSpan.FromSeconds(1); 266Options.Timeout = TimeSpan.FromSeconds(5);
Resolver\TcpFailoverTests.cs (5)
46Options.Timeout = TimeSpan.FromSeconds(60); 59AddressResult[] results = await Resolver.ResolveIPAddressesAsync(hostName, AddressFamily.InterNetwork).AsTask().WaitAsync(TimeSpan.FromSeconds(10)); 70Options.Timeout = TimeSpan.FromMilliseconds(100000); 86Options.Timeout = TimeSpan.FromSeconds(1); 113Options.Timeout = TimeSpan.FromSeconds(1);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
Fuzzers\DnsResponseFuzzer.cs (1)
24Timeout = TimeSpan.FromSeconds(5),
Microsoft.Extensions.Telemetry (9)
src\Shared\Data.Validation\TimeSpanAttribute.cs (9)
15/// Provides boundary validation for <see cref="TimeSpan"/>. 28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 33public TimeSpan? Maximum 39return TimeSpan.FromMilliseconds((double)_maxMs); 43return _max == null ? null : TimeSpan.Parse(_max, CultureInfo.InvariantCulture); 116var min = Minimum; 130if (value is TimeSpan ts)
Microsoft.Extensions.Telemetry.Abstractions (1)
Latency\NullLatencyContext.cs (1)
17public LatencyData LatencyData => new(_tags, _checkpoints, _measures, 0, TimeSpan.TicksPerSecond);
Microsoft.Extensions.TimeProvider.Testing (16)
FakeTimeProvider.cs (13)
19private DateTimeOffset _now = new(2000, 1, 1, 0, 0, 0, 0, TimeSpan.Zero); 22private TimeSpan _autoAdvanceAmount; 60/// This defaults to <see cref="TimeSpan.Zero"/>. 62/// <exception cref="ArgumentOutOfRangeException">The time value is less than <see cref="TimeSpan.Zero"/>.</exception> 63public TimeSpan AutoAdvanceAmount 124/// <exception cref="ArgumentOutOfRangeException">The time value is less than <see cref="TimeSpan.Zero"/>.</exception> 125public void Advance(TimeSpan delta) 150var delta = value - _now; 173Debug.Assert(TimestampFrequency == TimeSpan.TicksPerSecond, "Assuming frequency equals ticks per second"); 192/// This is fixed to the value of <see cref="TimeSpan.TicksPerSecond"/>. 194public override long TimestampFrequency => TimeSpan.TicksPerSecond; 203public override ITimer CreateTimer(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
Timer.cs (3)
30public bool Change(TimeSpan dueTime, TimeSpan period) 64period = TimeSpan.Zero;
Microsoft.Extensions.TimeProvider.Testing.Tests (170)
FakeTimeProviderTests.cs (82)
30Assert.Equal(TimeSpan.Zero, now.Offset); 32Assert.Equal(TimeSpan.Zero, timeProvider.AutoAdvanceAmount); 46var nowOffset = new DateTimeOffset(2000, 1, 1, 0, 0, 0, 0, TimeSpan.Zero); 52Assert.Equal(nowOffset, new DateTimeOffset(timestamp1, TimeSpan.Zero)); 53Assert.Equal(nowOffset, new DateTimeOffset(timestamp2, TimeSpan.Zero)); 60var nowOffset = new DateTimeOffset(2000, 1, 1, 0, 0, 0, 0, TimeSpan.Zero); 63AutoAdvanceAmount = TimeSpan.FromMilliseconds(msToElapse) 69Assert.Equal(nowOffset, new DateTimeOffset(timestamp1, TimeSpan.Zero)); 70Assert.Equal(nowOffset.AddMilliseconds(msToElapse), new DateTimeOffset(timestamp2, TimeSpan.Zero)); 78timeProvider.Advance(TimeSpan.FromSeconds(1)); 79var t = timeProvider.GetElapsedTime(st); 81Assert.Equal(TimeSpan.FromSeconds(1), t); 89AutoAdvanceAmount = TimeSpan.FromSeconds(1) 93var elapsedTime = timeProvider.GetElapsedTime(st); 94var elapsedTime2 = timeProvider.GetElapsedTime(st); 96Assert.Equal(TimeSpan.FromSeconds(1), elapsedTime); 97Assert.Equal(TimeSpan.FromSeconds(2), elapsedTime2); 103var timeProvider = new FakeTimeProvider(new DateTimeOffset(2001, 2, 3, 4, 5, 6, TimeSpan.Zero)); 105timeProvider.Advance(TimeSpan.FromMilliseconds(8)); 116Assert.Equal(TimeSpan.Zero, now.Offset); 119Assert.Equal(TimeSpan.Zero, timeProvider.AutoAdvanceAmount); 121timeProvider.Advance(TimeSpan.FromMilliseconds(8)); 154var tz = TimeZoneInfo.CreateCustomTimeZone("DUMMY", TimeSpan.FromHours(2), null, null); 162var timeProvider = new FakeTimeProvider(new DateTimeOffset(2001, 2, 3, 4, 5, 6, TimeSpan.Zero)); 172var utcDelta = finalTimeUtcNow - initialTimeUtcNow; 174var elapsedTime = timeProvider.GetElapsedTime(initialTimestamp, finalTimeTimestamp); 186var timeProvider = new FakeTimeProvider(new DateTimeOffset(2001, 2, 3, 4, 5, 6, TimeSpan.Zero)); 191timeProvider.Advance(TimeSpan.FromMilliseconds(1234)); 196var utcDelta = finalTimeUtcNow - initialTimeUtcNow; 198var elapsedTime = timeProvider.GetElapsedTime(initialTimestamp, finalTimeTimestamp); 212Assert.Throws<ArgumentOutOfRangeException>(() => timeProvider.Advance(TimeSpan.FromTicks(-1))); 220Assert.Throws<ArgumentOutOfRangeException>(() => timeProvider.SetUtcNow(timeProvider.GetUtcNow() - TimeSpan.FromTicks(1))); 232}, null, TimeSpan.FromSeconds(1), TimeSpan.Zero); 234tp.AdjustTime(tp.GetUtcNow() + TimeSpan.FromMilliseconds(999)); 237tp.AdjustTime(tp.GetUtcNow() + TimeSpan.FromMilliseconds(1)); 240tp.AdjustTime(tp.GetUtcNow() + TimeSpan.FromSeconds(10)); 243tp.Advance(TimeSpan.FromMilliseconds(999)); 246tp.Advance(TimeSpan.FromMilliseconds(1)); 259}, null, TimeSpan.FromSeconds(1), TimeSpan.Zero); 261tp.AdjustTime(tp.GetUtcNow() - TimeSpan.FromMilliseconds(999)); 264tp.AdjustTime(tp.GetUtcNow() - TimeSpan.FromMilliseconds(1)); 267tp.AdjustTime(tp.GetUtcNow() - TimeSpan.FromSeconds(10)); 270tp.Advance(TimeSpan.FromMilliseconds(999)); 273tp.Advance(TimeSpan.FromMilliseconds(1)); 280var dto = new DateTimeOffset(new DateTime(2022, 1, 2, 3, 4, 5, 6), TimeSpan.Zero); 286private readonly TimeSpan _infiniteTimeout = TimeSpan.FromMilliseconds(-1); 292var t = timeProvider.Delay(TimeSpan.Zero, CancellationToken.None); 303var delay = timeProvider.Delay(TimeSpan.FromMilliseconds(1), CancellationToken.None); 304timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 332using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMilliseconds(1000)); 334var task = fakeTimeProvider.Delay(TimeSpan.FromMilliseconds(10000), cancellationTokenSource.Token); 336fakeTimeProvider.Advance(TimeSpan.FromMilliseconds(10000)); 348using var cts = timeProvider.CreateCancellationTokenSource(TimeSpan.FromMilliseconds(1)); 349timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 351await Assert.ThrowsAsync<TaskCanceledException>(() => timeProvider.Delay(TimeSpan.FromTicks(1), cts.Token)); 364await Assert.ThrowsAsync<ArgumentOutOfRangeException>(() => source.Task.WaitAsync(TimeSpan.FromTicks(-1), timeProvider, CancellationToken.None)); 366await Assert.ThrowsAsync<ArgumentOutOfRangeException>(() => source.Task.WaitAsync(TimeSpan.FromMilliseconds(-2), timeProvider, CancellationToken.None)); 375var t = source.Task.WaitAsync(TimeSpan.FromSeconds(100000), timeProvider, CancellationToken.None); 378timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 395var t = source.Task.WaitAsync(TimeSpan.FromMilliseconds(-1), timeProvider, CancellationToken.None); 398timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 414var t = source.Task.WaitAsync(TimeSpan.FromMilliseconds(1), timeProvider, CancellationToken.None); 417timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 446AutoAdvanceAmount = TimeSpan.FromSeconds(1) 454Assert.Equal(timeProvider.Start + TimeSpan.FromSeconds(1), second); 455Assert.Equal(timeProvider.Start + TimeSpan.FromSeconds(2), third); 473AutoAdvanceAmount = TimeSpan.FromSeconds(1) 478timeProvider.AutoAdvanceAmount = TimeSpan.Zero; 485var oneSecond = TimeSpan.FromSeconds(1); 494}, null, TimeSpan.Zero, oneSecond); 503var provider = new FakeTimeProvider { AutoAdvanceAmount = TimeSpan.FromSeconds(2) }; 505using var timer = provider.CreateTimer(calls.Add, "timer-1", TimeSpan.FromSeconds(3), TimeSpan.Zero); 515th.Join(TimeSpan.FromMilliseconds(200)); 544await provider.Delay(TimeSpan.FromSeconds(taskDelay)); 558await provider.Delay(TimeSpan.FromSeconds(delay)).ConfigureAwait(false); 569provider.Advance(TimeSpan.FromSeconds(taskDelay)); 572provider.Advance(TimeSpan.FromSeconds(delay));
TimerTests.cs (88)
25using var timer = timeProvider.CreateTimer(_ => { counter++; }, null, TimeSpan.FromMilliseconds(10), TimeSpan.Zero); 29timeProvider.Advance(TimeSpan.FromMilliseconds(20)); 33timeProvider.Advance(TimeSpan.FromMilliseconds(1000)); 47using var timer = timeProvider.CreateTimer(_ => { counter++; }, null, TimeSpan.FromMilliseconds(10), Timeout.InfiniteTimeSpan); 51timeProvider.Advance(TimeSpan.FromMilliseconds(20)); 55timeProvider.Advance(TimeSpan.FromMilliseconds(1000)); 69using var timer = timeProvider.CreateTimer(_ => { counter++; }, null, TimeSpan.Zero, Timeout.InfiniteTimeSpan); 73timeProvider.Advance(TimeSpan.FromMilliseconds(100)); 77timeProvider.Advance(TimeSpan.FromMilliseconds(100)); 91var timer = timeProvider.CreateTimer(_ => { counter++; }, null, Timeout.InfiniteTimeSpan, TimeSpan.FromMilliseconds(10)); 95timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 99timeProvider.Advance(TimeSpan.FromMilliseconds(50)); 113var timer = timeProvider.CreateTimer(_ => { counter++; }, null, TimeSpan.Zero, TimeSpan.FromMilliseconds(10)); 117timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 121timeProvider.Advance(TimeSpan.FromMilliseconds(10)); 125timeProvider.Advance(TimeSpan.FromMilliseconds(10)); 139_ = t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1)); 141Assert.Throws<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(-2), TimeSpan.FromMilliseconds(1))); 142Assert.Throws<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(-2), TimeSpan.FromSeconds(1))); 143Assert.Throws<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(0xFFFFFFFFL), TimeSpan.FromMilliseconds(1))); 144Assert.Throws<ArgumentOutOfRangeException>("dueTime", () => t.Change(TimeSpan.FromMilliseconds(0xFFFFFFFFL), TimeSpan.FromSeconds(1))); 151_ = t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1)); 153Assert.Throws<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(-2))); 154Assert.Throws<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(-2))); 155Assert.Throws<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(0xFFFFFFFFL))); 156Assert.Throws<ArgumentOutOfRangeException>("period", () => t.Change(TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(0xFFFFFFFFL))); 163_ = t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1)); 165Assert.True(t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1))); 167Assert.False(t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1))); 174_ = t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1)); 176Assert.True(t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1))); 178Assert.False(t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1))); 190var timer1 = timeProvider.CreateTimer(_ => timer1Counter++, null, TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1)); 191var timer2 = timeProvider.CreateTimer(_ => timer2Counter++, null, TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1)); 195timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 201timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 253using var timer = timeProvider.CreateTimer(_ => { callbackTime = timeProvider.GetUtcNow(); }, null, TimeSpan.Zero, TimeSpan.FromMilliseconds(10)); 257timeProvider.SetUtcNow(timeProvider.Start + TimeSpan.FromMilliseconds(20)); 261timeProvider.SetUtcNow(timeProvider.Start + TimeSpan.FromMilliseconds(1000)); 266Assert.Equal(timeProvider.Start + TimeSpan.FromMilliseconds(20), value2); 267Assert.Equal(timeProvider.Start + TimeSpan.FromMilliseconds(1000), value3); 275var period = TimeSpan.FromMilliseconds(10); 276var timer = timeProvider.CreateTimer(_ => { callbackTimes.Add(timeProvider.GetUtcNow()); }, null, TimeSpan.Zero, period); 298var callbacks = new List<(int timerId, TimeSpan callbackTime)>(); 301using var timer1 = timeProvider.CreateTimer(_ => callbacks.Add((1, timeProvider.GetElapsedTime(startTime))), null, TimeSpan.FromMilliseconds(3), TimeSpan.FromMilliseconds(3)); 302using var timer2 = timeProvider.CreateTimer(_ => callbacks.Add((2, timeProvider.GetElapsedTime(startTime))), null, TimeSpan.FromMilliseconds(3), TimeSpan.FromMilliseconds(3)); 303using var timer3 = timeProvider.CreateTimer(_ => callbacks.Add((3, timeProvider.GetElapsedTime(startTime))), null, TimeSpan.FromMilliseconds(6), TimeSpan.FromMilliseconds(5)); 305timeProvider.Advance(TimeSpan.FromMilliseconds(3)); 306timeProvider.Advance(TimeSpan.FromMilliseconds(3)); 307timeProvider.Advance(TimeSpan.FromMilliseconds(3)); 308timeProvider.Advance(TimeSpan.FromMilliseconds(2)); 312(1, TimeSpan.FromMilliseconds(3)), 313(2, TimeSpan.FromMilliseconds(3)), 314(3, TimeSpan.FromMilliseconds(6)), 315(1, TimeSpan.FromMilliseconds(6)), 316(2, TimeSpan.FromMilliseconds(6)), 317(1, TimeSpan.FromMilliseconds(9)), 318(2, TimeSpan.FromMilliseconds(9)), 319(3, TimeSpan.FromMilliseconds(11)), 339timers.Add(timeProvider.CreateTimer(index => triggers[(int)index!] = true, i, TimeSpan.FromSeconds(dueTimes[i]), TimeSpan.Zero)); 340timeProvider.Advance(TimeSpan.FromTicks(1)); 357timeProvider.Advance(TimeSpan.FromSeconds(2));
Microsoft.Extensions.Validation (1)
RuntimeValidatableParameterInfoResolver.cs (1)
95type == typeof(TimeSpan) ||
Microsoft.Extensions.Validation.GeneratorTests (8)
ValidationsGeneratorTestBase.cs (8)
233private static readonly TimeSpan s_defaultWaitTimeout = SetupDefaultTimeout(); 235private static TimeSpan SetupDefaultTimeout() 244return TimeSpan.FromSeconds((int)timeoutInSeconds); 247return TimeSpan.FromMinutes(5); 272TimeSpan waitTimeout = default, 312public static Func<string[], IServiceProvider> ResolveServiceProviderFactory(Assembly assembly, TimeSpan waitTimeout = default) 390private readonly TimeSpan _waitTimeout; 399public HostingListener(string[] args, MethodInfo entryPoint, TimeSpan waitTimeout, bool stopApplication, Action<object> configure, Action<Exception> entrypointCompleted)
Microsoft.Extensions.Validation.Tests (1)
RuntimeValidatableParameterInfoResolverTests.cs (1)
48[InlineData(typeof(TimeSpan))]
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesSpecialTypesExtensions.cs (1)
17public TimeSpan P2 { get; set; }
Microsoft.JSInterop (11)
JSObjectReferenceExtensions.cs (5)
93public static async ValueTask<TValue> InvokeAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(this IJSObjectReference jsObjectReference, string identifier, TimeSpan timeout, params object?[]? args) 111public static async ValueTask InvokeVoidAsync(this IJSObjectReference jsObjectReference, string identifier, TimeSpan timeout, params object?[]? args) 161public static ValueTask<IJSObjectReference> InvokeConstructorAsync(this IJSObjectReference jsObjectReference, string identifier, TimeSpan timeout, object?[]? args) 179public static ValueTask<TValue> GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(this IJSObjectReference jsObjectReference, string identifier, TimeSpan timeout) 198public static ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(this IJSObjectReference jsObjectReference, string identifier, TValue value, TimeSpan timeout)
JSRuntime.cs (1)
57protected TimeSpan? DefaultAsyncTimeout { get; set; }
JSRuntimeExtensions.cs (5)
93public static async ValueTask<TValue> InvokeAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(this IJSRuntime jsRuntime, string identifier, TimeSpan timeout, params object?[]? args) 111public static async ValueTask InvokeVoidAsync(this IJSRuntime jsRuntime, string identifier, TimeSpan timeout, params object?[]? args) 161public static ValueTask<IJSObjectReference> InvokeConstructorAsync(this IJSRuntime jsRuntime, string identifier, TimeSpan timeout, object?[]? args) 179public static ValueTask<TValue> GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(this IJSRuntime jsRuntime, string identifier, TimeSpan timeout) 198public static ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(this IJSRuntime jsRuntime, string identifier, TValue value, TimeSpan timeout)
Microsoft.JSInterop.Tests (5)
JSRuntimeExtensionsTest.cs (2)
106var result = await jsRuntime.Object.InvokeAsync<string>(method, TimeSpan.FromMinutes(5), args); 152await jsRuntime.Object.InvokeVoidAsync(method, TimeSpan.FromMinutes(5), args);
JSRuntimeTest.cs (3)
44runtime.DefaultTimeout = TimeSpan.FromSeconds(1); 58runtime.DefaultTimeout = TimeSpan.FromSeconds(10); 451public TimeSpan? DefaultTimeout
Microsoft.Maui (10)
Animations\AnimationManager.cs (1)
84 var milliseconds = TimeSpan.FromMilliseconds(now - _lastUpdate).TotalMilliseconds;
Core\ITimePicker.cs (1)
18 TimeSpan Time { get; set; }
Dispatching\Dispatcher.cs (1)
24 public bool DispatchDelayed(TimeSpan delay, Action action)
Dispatching\Dispatcher.Standard.cs (1)
18 bool DispatchDelayedImplementation(TimeSpan delay, Action action) =>
Dispatching\DispatcherExtensions.cs (1)
108 public static void StartTimer(this IDispatcher dispatcher, TimeSpan interval, Func<bool> callback)
Dispatching\IDispatcher.cs (2)
23 bool DispatchDelayed(TimeSpan delay, Action action); 45 TimeSpan Interval { get; set; }
ImageSources\IUriImageSource.cs (1)
10 TimeSpan CacheValidity { get; }
Platform\TimeExtensions.cs (2)
11 var time = timePicker.Time; 17 public static string ToFormattedString(this TimeSpan time, string format, CultureInfo? cultureInfo = null)
Microsoft.Maui.Controls (23)
Cells\Cell.cs (1)
274 await Task.Delay(TimeSpan.FromMilliseconds(16));
Device.cs (1)
134 public static void StartTimer(TimeSpan interval, Func<bool> callback)
Internals\ProfilePage.cs (1)
33 const long MS = TimeSpan.TicksPerMillisecond;
TimeChangedEventArgs.cs (4)
14 public TimeChangedEventArgs(TimeSpan oldTime, TimeSpan newTime) 23 public TimeSpan NewTime { get; private set; } 28 public TimeSpan OldTime { get; private set; }
TimePicker\TimePicker.cs (8)
23 public static readonly BindableProperty TimeProperty = BindableProperty.Create(nameof(Time), typeof(TimeSpan), typeof(TimePicker), new TimeSpan(0), BindingMode.TwoWay, 26 var time = (TimeSpan)value; 73 public TimeSpan Time 75 get { return (TimeSpan)GetValue(TimeProperty); } 160 TimeSpan ITimePicker.Time 169 timePicker.TimeSelected?.Invoke(timePicker, new TimeChangedEventArgs((TimeSpan)oldValue, (TimeSpan)newValue));
UriImageSource.cs (4)
23 nameof(CacheValidity), typeof(TimeSpan), typeof(UriImageSource), TimeSpan.FromDays(1)); 33 public TimeSpan CacheValidity 35 get => (TimeSpan)GetValue(CacheValidityProperty);
ViewExtensions.cs (2)
448 else if (element is TimePicker tp && TimeSpan.TryParse(text, out TimeSpan tpResult))
Xaml\TypeConversionExtensions.cs (2)
196 if (toType == typeof(TimeSpan)) 197 return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
Microsoft.Maui.Controls.Build.Tasks (5)
CreateObjectVisitor.cs (2)
520 if (hasValue && TimeSpan.TryParse(valueString, CultureInfo.InvariantCulture, out TimeSpan outspan))
NodeILExtensions.cs (2)
265 var ts = TryFormat(s => TimeSpan.Parse(s, CultureInfo.InvariantCulture), node, str);
PerformanceProvider.cs (1)
66 double total = TimeSpan.FromTicks(kvp.Value.TotalTime).TotalMilliseconds;
Microsoft.Maui.Controls.Xaml (3)
CreateValuesVisitor.cs (3)
371 if (nodeType == typeof(TimeSpan) && TimeSpan.TryParse(valuestring, CultureInfo.InvariantCulture, out TimeSpan timespanval))
Microsoft.Maui.Essentials (19)
Accelerometer\Accelerometer.shared.cs (1)
301 (time.Ticks / TimeSpan.TicksPerMillisecond) * 1_000_000;
Geolocation\GeolocationListeningRequest.shared.cs (4)
24 : this(accuracy, TimeSpan.FromSeconds(1)) 33 public GeolocationListeningRequest(GeolocationAccuracy accuracy, TimeSpan minimumTime) 43 public TimeSpan MinimumTime { get; set; } = TimeSpan.FromSeconds(1);
Geolocation\GeolocationRequest.shared.cs (4)
56 Timeout = TimeSpan.Zero; 66 Timeout = TimeSpan.Zero; 75 public GeolocationRequest(GeolocationAccuracy accuracy, TimeSpan timeout) 84 public TimeSpan Timeout { get; set; }
Types\Shared\Utils.shared.cs (3)
21 internal static CancellationToken TimeoutToken(CancellationToken cancellationToken, TimeSpan timeout) 27 if (timeout > TimeSpan.Zero) 34 internal static async Task<T> WithTimeout<T>(Task<T> task, TimeSpan timeSpan)
Vibration\Vibration.netstandard.tvos.watchos.macos.cs (1)
14 void PlatformVibrate(TimeSpan duration)
Vibration\Vibration.shared.cs (6)
27 void Vibrate(TimeSpan duration); 60 public static void Vibrate(TimeSpan duration) => 94 vibration.Vibrate(TimeSpan.FromMilliseconds(duration)); 107 public void Vibrate(TimeSpan duration) 113 duration = TimeSpan.Zero; 115 duration = TimeSpan.FromSeconds(5);
Microsoft.Maui.Resizetizer (1)
AsyncTask.cs (1)
286 var index = (WaitHandleIndex)System.Threading.WaitHandle.WaitAny(handles, TimeSpan.FromMilliseconds(10));
Microsoft.ML.AutoML (5)
AutoMLExperiment\AutoMLExperiment.cs (1)
83var timeoutManager = new TimeoutTrainingStopManager(TimeSpan.FromSeconds(trainingTimeInSeconds), channel);
AutoMLExperiment\IPerformanceMonitor.cs (3)
48private TimeSpan _totalCpuProcessorTime; 122var currentCpuProcessorTime = Process.GetCurrentProcess().TotalProcessorTime; 123var elapseCpuProcessorTime = currentCpuProcessorTime - _totalCpuProcessorTime;
AutoMLExperiment\IStopTrainingManager.cs (1)
64public TimeoutTrainingStopManager(TimeSpan timeoutInSeconds, IChannel? channel)
Microsoft.ML.AutoML.Interactive (3)
ActionThrottler.cs (2)
17private readonly TimeSpan _minDelay; 27public ActionThrottler(Action action, TimeSpan minDelay)
NotebookMonitor.cs (1)
31_updateThrottler = new ActionThrottler(Update, TimeSpan.FromSeconds(5));
Microsoft.ML.AutoML.Tests (3)
StopTrainingManagerTests.cs (3)
48var manager = new TimeoutTrainingStopManager(TimeSpan.FromSeconds(1), null); 73var timeoutManager = new TimeoutTrainingStopManager(TimeSpan.FromSeconds(1), null); 97aggregationManager = new AggregateTrainingStopManager(null, new TimeoutTrainingStopManager(TimeSpan.FromSeconds(100), null), cancellationManager);
Microsoft.ML.Core (5)
Data\ColumnTypeExtensions.cs (1)
101if (type == typeof(TimeSpan))
Data\DataKind.cs (3)
66/// <summary>type of <see cref="System.TimeSpan"/>.</summary> 278return typeof(TimeSpan); 322else if (type == typeof(TimeSpan))
Environment\ConsoleEnvironment.cs (1)
263var elapsed = ev.EventTime - ev.StartTime;
Microsoft.ML.Core.Tests (2)
UnitTests\CoreBaseTestClass.cs (2)
122return GetComparerVec<TimeSpan>(r1, r2, col, size, (x, y) => x.Ticks == y.Ticks); 165return GetComparerOne<TimeSpan>(r1, r2, col, (x, y) => x.Ticks == y.Ticks);
Microsoft.ML.Data (35)
Data\Conversion.cs (19)
27using TS = TimeSpan; 236AddStd<TX, TS>(Convert); 250AddStd<TS, I8>(Convert); 251AddStd<TS, R4>(Convert); 252AddStd<TS, R8>(Convert); 253AddAux<TS, SB>(Convert); 254AddStd<TS, TX>(Convert); 291AddIsDef<TS>(IsDefault); 313AddTryParse<TS>(TryParse); 789private bool IsDefault(in TS src) => src.Equals(default(TS)); 833public void Convert(in TS src, ref I8 dst) => dst = (I8)src.Ticks; 891public void Convert(in TS src, ref R4 dst) => dst = (R4)src.Ticks; 909public void Convert(in TS src, ref R8 dst) => dst = (R8)src.Ticks; 934public void Convert(in TS src, ref SB dst) { ClearDst(ref dst); dst.AppendFormat("{0:c}", src); } 952public void Convert(in TS src, ref TX dst) => dst = string.Format("{0:c}", src).AsMemory(); 1401public bool TryParse(in TX src, out TS dst) 1409if (TimeSpan.TryParse(src.ToString(), CultureInfo.InvariantCulture, out dst)) 1715public void Convert(in TX span, ref TS value) => TryParse(in span, out value);
Data\DataViewTypeManager.cs (1)
33typeof(TimeSpan), typeof(DataViewRowId)
DataLoadSave\Binary\CodecFactory.cs (2)
58RegisterSimpleCodec(new UnsafeTypeCodec<TimeSpan>(this)); 69RegisterOtherCodec("DvTimeSpan", new UnsafeTypeCodec<TimeSpan>(this).GetCodec);
DataLoadSave\Binary\Codecs.cs (1)
162return type == typeof(TimeSpan) ? TimeSpanDataViewType.Instance :
DataLoadSave\Binary\UnsafeTypeOps.cs (6)
43_type2ops[typeof(TimeSpan)] = new TimeSpanUnsafeTypeOps(); 172private sealed class TimeSpanUnsafeTypeOps : UnsafeTypeOps<TimeSpan> 175public override unsafe void Apply(ReadOnlySpan<TimeSpan> array, Action<IntPtr> func) 177fixed (TimeSpan* pArray = &MemoryMarshal.GetReference(array)) 181public override void Write(TimeSpan a, BinaryWriter writer) { writer.Write(a.Ticks); } 182public override TimeSpan Read(BinaryReader reader)
DataLoadSave\Database\DbExtensions.cs (1)
55return typeof(TimeSpan);
DataLoadSave\Text\TextSaver.cs (3)
112ValueMapper<TimeSpan, StringBuilder> c = MapTimeSpan; 138protected void MapTimeSpan(in TimeSpan src, ref StringBuilder sb) 854internal static void MapTimeSpan(in TimeSpan src, ref StringBuilder sb)
EntryPoints\EntryPointNode.cs (1)
428public TimeSpan RunTime { get; internal set; }
Utils\ApiUtils.cs (1)
41t == typeof(DateTime) || t == typeof(DateTimeOffset) || t == typeof(TimeSpan) ||
Microsoft.ML.DataView (2)
DataViewType.cs (2)
434/// The standard timespan type. This has representation type of <see cref="TimeSpan"/>. 454: base(typeof(TimeSpan))
Microsoft.ML.IntegrationTests (2)
Datasets\TypeTestData.cs (2)
59public TimeSpan Ts { get; set; } 142Ts = TimeSpan.FromSeconds(rng.NextDouble() * (1 + rng.Next())),
Microsoft.ML.Maml (2)
MAML.cs (2)
216TimeSpan interval = TimeSpan.FromSeconds(0.6);
Microsoft.ML.Parquet (4)
ParquetLoader.cs (4)
531return CreateGetterDelegateCore<Interval, TimeSpan>(col, _parquetConversions.Conv); 747public void Conv(in Interval src, ref TimeSpan dst) 749dst = TimeSpan.FromDays(src.Months * 30 + src.Days) + TimeSpan.FromMilliseconds(src.Millis);
Microsoft.ML.PerformanceTests (1)
Harness\Configs.cs (1)
21Add(DefaultConfig.Instance.WithOption(ConfigOptions.Default, true).WithBuildTimeout(TimeSpan.FromMinutes(5))); // this config contains all of the basic settings (exporters, columns etc)
Microsoft.ML.Samples (1)
Dynamic\DataOperations\Cache.cs (1)
79var elapsed = watch.Elapsed;
Microsoft.ML.TestFramework (4)
DataPipe\TestDataPipeBase.cs (4)
920else if (rawType == typeof(TimeSpan)) 921return GetComparerOne<TimeSpan>(r1, r2, col, (x, y) => x == y); 971else if (itemType == typeof(TimeSpan)) 972return GetComparerVec<TimeSpan>(r1, r2, col, size, (x, y) => x == y);
Microsoft.ML.TestFrameworkCommon (3)
AsyncTestHelper.cs (3)
12public static TimeSpan UnexpectedTimeout 16return Debugger.IsAttached ? TimeSpan.FromHours(1) : TimeSpan.FromMinutes(1);
Microsoft.ML.Tests (1)
Scenarios\Api\TestApi.cs (1)
412public TimeSpan TimeSpanStrat { get; set; }
Microsoft.ML.Tokenizers (6)
Model\TiktokenTokenizer.cs (3)
1270private static Regex Cl100kBaseRegex() => _cl100kBaseRegex ??= new Regex(Cl100kBaseRegexPattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(PreTokenizer.DefaultTimeOutInMilliseconds)); 1273internal static Regex P50kBaseRegex() => _p50kBaseRegex ??= new Regex(P50kBaseRegexPattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(PreTokenizer.DefaultTimeOutInMilliseconds)); 1276internal static Regex O200kBaseRegex() => _o200kBaseRegex ??= new Regex(O200kBaseRegexPattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(PreTokenizer.DefaultTimeOutInMilliseconds));
PreTokenizer\PreTokenizer.cs (3)
52private static Regex WhiteSpaceOrPunctuationRegex() => new Regex(WhiteSpaceOrPunctuationPattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds)); 81private static Regex WordOrNonWordRegex() => new Regex(WordOrNonWordPattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds)); 111private static Regex WhiteSpaceRegex() => new Regex(WhiteSpacePattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds));
Microsoft.ML.Tokenizers.Data.Tests (1)
test\Microsoft.ML.Tokenizers.Tests\Utils.cs (1)
17using (var client = new HttpClient() { Timeout = TimeSpan.FromMinutes(5) })
Microsoft.ML.Tokenizers.Tests (3)
BpeTests.cs (1)
984preTokenizers.Add(new RegexPreTokenizer(new Regex(pattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds)), null));
LlamaTests.cs (1)
21private static readonly HttpClient _httpClient = new HttpClient() { Timeout = TimeSpan.FromMinutes(5) };
Utils.cs (1)
17using (var client = new HttpClient() { Timeout = TimeSpan.FromMinutes(5) })
Microsoft.Net.Http.Headers (16)
CacheControlHeaderValue.cs (9)
90private TimeSpan? _maxAge; 91private TimeSpan? _sharedMaxAge; 93private TimeSpan? _maxStaleLimit; 94private TimeSpan? _minFresh; 161public TimeSpan? MaxAge 174public TimeSpan? SharedMaxAge 201public TimeSpan? MaxStaleLimit 214public TimeSpan? MinFresh 771private static bool TrySetTimeSpan(NameValueHeaderValue nameValue, ref TimeSpan? timeSpan)
HeaderUtilities.cs (5)
213/// <see cref="TimeSpan"/>. 222/// When this method returns, contains the parsed <see cref="TimeSpan"/>, if the parsing succeeded, or 224/// found or could not be parsed as a <see cref="TimeSpan"/>. This parameter is passed uninitialized; 232public static bool TryParseSeconds(StringValues headerValues, string targetValue, [NotNullWhen(true)] out TimeSpan? value) 257value = TimeSpan.FromSeconds(seconds);
SetCookieHeaderValue.cs (2)
126public TimeSpan? MaxAge { get; set; } 600result.MaxAge = TimeSpan.FromSeconds(maxAge);
Microsoft.Net.Http.Headers.Tests (37)
CacheControlHeaderValueTest.cs (1)
34TimeSpan timeSpan = new TimeSpan(1, 2, 3);
DateParserTest.cs (6)
20yield return new object[] { "Tue, 15 Nov 1994 08:12:31 GMT", new DateTimeOffset(1994, 11, 15, 8, 12, 31, TimeSpan.Zero) }; 21yield return new object[] { " Sunday, 06-Nov-94 08:49:37 GMT ", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }; 22yield return new object[] { " Tue,\r\n 15 Nov\r\n 1994 08:12:31 GMT ", new DateTimeOffset(1994, 11, 15, 8, 12, 31, TimeSpan.Zero) }; 23yield return new object[] { "Sat, 09-Dec-2017 07:07:03 GMT ", new DateTimeOffset(2017, 12, 09, 7, 7, 3, TimeSpan.Zero) }; 46HeaderUtilities.FormatDate(new DateTimeOffset(2010, 7, 31, 15, 38, 57, TimeSpan.Zero))); 49HeaderUtilities.FormatDate(new DateTimeOffset(2010, 1, 1, 1, 1, 1, TimeSpan.Zero)));
HeaderUtilitiesTest.cs (3)
75TimeSpan? value; 77Assert.Equal(TimeSpan.FromSeconds(expectedValue), value); 95TimeSpan? value;
RangeConditionHeaderValueTest.cs (12)
33new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 35Assert.Equal(new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero), rangeCondition.LastModified); 44rangeCondition = new RangeConditionHeaderValue(new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 54new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 56new DateTimeOffset(2008, 8, 16, 13, 44, 10, TimeSpan.Zero)); 58new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 75new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 77new DateTimeOffset(2008, 8, 16, 13, 44, 10, TimeSpan.Zero)); 79new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 97new RangeConditionHeaderValue(new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero))); 99new RangeConditionHeaderValue(new DateTimeOffset(1994, 11, 9, 8, 49, 37, TimeSpan.Zero))); 128new RangeConditionHeaderValue(new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero)));
SetCookieHeaderValueTest.cs (15)
18Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 21MaxAge = TimeSpan.FromDays(1), 37MaxAge = TimeSpan.FromDays(1), 44Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 67MaxAge = TimeSpan.FromDays(-1), 73MaxAge = TimeSpan.FromDays(0), 135Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 138MaxAge = TimeSpan.FromDays(1), 152MaxAge = TimeSpan.FromDays(1), 159Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 238Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 241MaxAge = TimeSpan.FromDays(1), 252MaxAge = TimeSpan.FromDays(1), 259Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 271Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero),
Microsoft.VisualBasic.Core (5)
Microsoft\VisualBasic\DateAndTime.vb (5)
41Return New DateTime(Ticks - Ticks Mod TimeSpan.TicksPerSecond) 128(TimeSpan.TicksPerMillisecond * 1000) 178Dim tm As TimeSpan 449Return (New DateTime(TotalSeconds * TimeSpan.TicksPerSecond)) 460Return New DateTime(CDate([StringTime]).Ticks Mod TimeSpan.TicksPerDay)
Microsoft.VisualStudio.LanguageServices (16)
InheritanceMargin\InheritanceMarginLogger.cs (1)
20public static void LogGenerateBackgroundInheritanceInfo(TimeSpan elapsedTime)
InheritanceMargin\InheritanceMarginTaggerProvider.cs (1)
99var elapsed = stopwatch.Elapsed;
Interop\CleanableWeakComHandleTable.cs (4)
28private static readonly TimeSpan s_defaultCleanUpTimeSlice = TimeSpan.FromMilliseconds(15); 42public TimeSpan CleanUpTimeSlice { get; } 48public CleanableWeakComHandleTable(IThreadingContext threadingContext, int? cleanUpThreshold = null, TimeSpan? cleanUpTimeSlice = null)
KeybindingReset\KeybindingResetDetector.cs (1)
314await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken).ConfigureAwait(false);
LanguageService\AbstractCreateServicesOnTextViewConnection.cs (1)
54TimeSpan.FromSeconds(1),
Packaging\PackageInstallerServiceFactory.cs (1)
132TimeSpan.FromSeconds(1),
ProjectSystem\FileChangeWatcher.cs (1)
52TimeSpan.FromMilliseconds(500),
TaskList\ExternalErrorDiagnosticUpdateSource.cs (1)
75TimeSpan.Zero,
Utilities\TimeSlice.cs (1)
13public TimeSlice(TimeSpan duration)
Watson\FaultReporter.cs (2)
316var oneDay = TimeSpan.FromDays(1);
Workspace\SourceGeneratedFileManager.cs (1)
289TimeSpan.FromSeconds(1),
Workspace\VisualStudioSourceGeneratorTelemetryCollectorWorkspaceServiceFactory.cs (1)
59TimeSpan.FromMinutes(5),
Microsoft.VisualStudio.LanguageServices.CodeLens (1)
ReferenceCodeLensProvider.cs (1)
99await Task.Delay(TimeSpan.FromSeconds(1.5), _cancellationTokenSource.Token).ConfigureAwait(false);
Microsoft.VisualStudio.LanguageServices.CSharp (4)
SemanticSearch\SemanticSearchQueryExecutor.cs (3)
128var emitTime = TimeSpan.Zero; 204private static void ReportTelemetry(string queryString, ExecuteQueryResult result, TimeSpan emitTime, bool canceled)
SemanticSearch\SemanticSearchToolWindowImpl.cs (1)
403delay: TimeSpan.Zero,
Mongo.AppHost (1)
Program.cs (1)
15await Task.Delay(TimeSpan.FromSeconds(10), ct);
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1194[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.TimeSpan))]
Mvc.RoutingWebSite (1)
TestParameterTransformer.cs (1)
13return value == null ? null : Regex.Replace(value.ToString(), "([a-z])([A-Z])", "$1-$2", RegexOptions.None, TimeSpan.FromSeconds(10)).ToLowerInvariant();
MvcFormSample (1)
Models\Todo.cs (1)
9public DateTime DueDate { get; set; } = DateTime.Now.Add(TimeSpan.FromDays(1));
Nats.ApiService (1)
Program.cs (1)
25var rtt = await nats.PingAsync();
netstandard (1)
netstandard.cs (1)
2161[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.TimeSpan))]
OpenIdConnectSample (1)
Startup.cs (1)
271var expiresAt = DateTimeOffset.UtcNow + TimeSpan.FromSeconds(seconds);
OutputCachingSample (2)
Startup.cs (2)
12options.AddBasePolicy(builder => builder.With(c => c.HttpContext.Request.Path.StartsWithSegments("/js")).Expire(TimeSpan.FromDays(1))); 55}).CacheOutput(p => p.SetLocking(false).Expire(TimeSpan.FromMilliseconds(1)));
PortableTask (1)
Sleep.cs (1)
17Task.Delay(TimeSpan.FromSeconds(Seconds)).Wait();
PresentationBuildTasks (3)
MS\Internal\MarkupCompiler\VersionHelper.cs (1)
203TimeSpan days = time.Date - new DateTime(2000, 1, 1);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypes.cs (1)
5506case KnownElements.TimeSpan: t = typeof(TimeSpan); break;
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (1)
208else if (typeof(TimeSpan).IsAssignableFrom(type))
PresentationCore (811)
MS\Internal\Automation\ElementUtil.cs (1)
190TimeSpan.FromMinutes(3),
System\Windows\Duration.cs (8)
16private readonly TimeSpan _timeSpan; 23public Duration(TimeSpan timeSpan) 25if (timeSpan < TimeSpan.Zero) 59public static implicit operator Duration(TimeSpan timeSpan) 61if (timeSpan < TimeSpan.Zero) 391public TimeSpan TimeSpan 487/// This method does not use the current <see cref="System.TimeSpan"/>'s <see cref="TypeDescriptor"/> for retrieving the 488/// current converter, but rather uses the standard <see cref="TimeSpan.ToString()"/> override for <see cref="DurationConverter"/> needs.
System\Windows\DurationConverter.cs (5)
65/// Facilities parsing from <paramref name="valueSpan"/> to <see cref="TimeSpan"/> and initializes new <see cref="Duration"/> instance. 71/// <exception cref="FormatException">Thrown when parsing of <paramref name="valueSpan"/> to <see cref="TimeSpan"/> instance fails.</exception> 76return new Duration(TimeSpan.Parse(valueSpan, cultureInfo)); 80throw new FormatException($"{valueSpan} is not a valid value for {nameof(TimeSpan)}.", e); 108MemberInfo mi = typeof(Duration).GetConstructor(new Type[] { typeof(TimeSpan) });
System\Windows\Input\InputManager.cs (1)
164_inputTimer.Interval = TimeSpan.FromMilliseconds(125);
System\Windows\Input\ManipulationDevice.cs (1)
514private const Int64 ThrottleTimeout = TimeSpan.TicksPerSecond * 5; // 5 seconds (in 100ns units) of no activity will throttle down
System\Windows\Input\ManipulationLogic.cs (1)
248Interval = TimeSpan.FromMilliseconds(15)
System\Windows\InterOp\HwndTarget.cs (2)
279_restoreDT.Interval = TimeSpan.FromMilliseconds(100); 984TimeSpan delta = DateTime.Now - _lastWakeOrUnlockEvent;
System\Windows\LayoutManager.cs (2)
278TimeSpan loopDuration = (DateTime.UtcNow - loopStartTime); 346TimeSpan loopDuration = (DateTime.UtcNow - loopStartTime);
System\Windows\Media\Animation\Clock.cs (146)
120_nextTickNeededTime = TimeSpan.Zero; 263public TimeSpan? CurrentTime 484protected virtual TimeSpan GetCurrentTimeCore() 488return _currentTime ?? TimeSpan.Zero; 519protected TimeSpan CurrentGlobalTime 525return TimeSpan.Zero; 606if (!_resolvedDuration.HasTimeSpan || _resolvedDuration.TimeSpan > TimeSpan.Zero) 682TimeSpan beginTime, TimeSpan? endTime, 691TimeSpan beginTime, TimeSpan endTime, Duration period, 704TimeSpan? lastCurrentTime = _currentTime; 757InternalSeek(TimeSpan.Zero); 852internal void InternalSeek(TimeSpan destination) 875internal void InternalSeekAlignedToLastTick(TimeSpan destination) 961TimeSpan? effectiveDuration; 1232TimeSpan? expirationTime; 1351internal TimeSpan? InternalNextTickNeededTime 1862TimeSpan previewParentTime = CurrentGlobalTime; 1919TimeSpan nextDesiredTick = InternalNextTickNeededTime == TimeSpan.Zero ? _rootData.CurrentAdjustedGlobalTime 1932private bool ComputeCurrentIteration(TimeSpan parentTime, double parentSpeed, 1933TimeSpan? expirationTime, 1934out TimeSpan localProgress) 1948TimeSpan beginTimeForOffsetComputation = _currentIterationBeginTime ?? _beginTime.Value; 1949TimeSpan offsetFromBegin = MultiplyTimeSpan(parentTime - beginTimeForOffsetComputation, _appliedSpeedRatio); 1956if (_currentDuration.TimeSpan == TimeSpan.Zero) // We must be post-filling if we have gotten here 1961localProgress = TimeSpan.Zero; 1964_currentTime = TimeSpan.Zero; 2063TimeSpan optimizedOffsetFromBegin; 2086localProgress = TimeSpan.FromTicks(offsetFromBegin.Ticks % _currentDuration.TimeSpan.Ticks); 2091if ((localProgress == TimeSpan.Zero) 2115if (localProgress == TimeSpan.Zero) 2122InternalNextTickNeededTime = TimeSpan.Zero; 2138TimeSpan timeUntilNextBoundary; 2140if (localProgress == TimeSpan.Zero) // We are currently exactly at a boundary 2146TimeSpan decelBegin = MultiplyTimeSpan(_currentDuration.TimeSpan, 1.0 - _timeline.DecelerationRatio); 2151TimeSpan accelEnd = MultiplyTimeSpan(_currentDuration.TimeSpan, _timeline.AccelerationRatio); 2155TimeSpan proposedNextTickTime = CurrentGlobalTime + timeUntilNextBoundary; 2182private void ComputeCurrentIterationWithGrow(TimeSpan parentTime, TimeSpan? expirationTime, 2183out TimeSpan localProgress, out int newIteration) 2191TimeSpan offsetFromBegin = MultiplyTimeSpan(parentTime - _currentIterationBeginTime.Value, _appliedSpeedRatio); 2204localProgress = TimeSpan.FromTicks(offsetOnLaterIterations % _resolvedDuration.TimeSpan.Ticks); 2248private bool ComputeCurrentState(TimeSpan? expirationTime, ref TimeSpan parentTime, double parentSpeed, bool isInTick) 2292InternalNextTickNeededTime = TimeSpan.Zero; // We need ticks immediately 2330private bool ComputeCurrentTime(TimeSpan localProgress, out double localSpeed) 2340Debug.Assert(_currentDuration.TimeSpan > TimeSpan.Zero, "ComputeCurrentTime was entered with _currentDuration <= 0"); 2376InternalNextTickNeededTime = TimeSpan.Zero; 2400InternalNextTickNeededTime = TimeSpan.Zero; 2404_currentTime = TimeSpan.FromTicks((long)((t * durationInTicks) + 0.5)); 2465private TimeSpan? ComputeEffectiveDuration() 2475TimeSpan? effectiveDuration; 2478if (_currentDuration.HasTimeSpan && _currentDuration.TimeSpan == TimeSpan.Zero) 2481effectiveDuration = TimeSpan.Zero; 2487effectiveDuration = TimeSpan.Zero; 2511TimeSpan previousIterationDuration = TimeSpan.Zero; 2538effectiveDuration = TimeSpan.FromTicks((long)(presentAndFutureDuration / _appliedSpeedRatio + 0.5)) + previousIterationDuration; 2557private void ComputeEvents(TimeSpan? expirationTime, 2579postFillDuration = TimeSpan.Zero; // There is no reachable postfill zone because the active period is infinite 2615else if (postFillDuration != TimeSpan.Zero && // Our active period is finite and we have fill behavior 2639private bool ComputeExpirationTime(out TimeSpan? expirationTime) 2644TimeSpan? effectiveDuration; 2665expirationTime += TimeSpan.FromMilliseconds(50); // This compensation is roughly one frame of video 2796TimeSpan? endOfActivePeriod) 2804TimeSpan relativeBeginTime = _currentIterationBeginTime ?? _beginTime.Value; 2827TimeSpan? endOfActivePeriod, 2831TimeSpan relativeBeginTime = _currentIterationBeginTime ?? _beginTime.Value; 2875TimeSpan? parentTime; // Computed parent-local time 2876TimeSpan? expirationTime; // Computed expiration time with respect to repeat behavior and resolved duration; 2877TimeSpan localProgress; // Computed time inside simple duration 2879TimeSpan parentTimeValue; 2989private bool ComputeNextTickNeededTime(TimeSpan? expirationTime, 2990TimeSpan parentTime, double parentSpeed) 3000InternalNextTickNeededTime = IsInteractivelyPaused ? TimeSpan.Zero : (TimeSpan?)null; 3005TimeSpan? timeUntilNextBoundary = null; 3017TimeSpan timeUntilBegin = MultiplyTimeSpan(_beginTime.Value - parentTime, invertedParentSpeed); 3026if (timeUntilBegin >= TimeSpan.Zero) 3033TimeSpan timeUntilExpiration = MultiplyTimeSpan(expirationTime.Value - parentTime, invertedParentSpeed); 3035if (timeUntilExpiration >= TimeSpan.Zero && 3063private bool ComputeParentParameters(out TimeSpan? parentTime, out double? parentSpeed, 3081InternalNextTickNeededTime = TimeSpan.Zero; // When TimeManager wakes up, we will need an update 3148TimeSpan currentParentTimePT) 3173TimeSpan relativeBeginTimePT = _currentIterationBeginTime ?? _beginTime.Value; 3174TimeSpan previewCurrentOffsetPT = currentParentTimePT - relativeBeginTimePT; // This is our time offset (not yet scaled by speed) 3175TimeSpan previewCurrentTimeLT = MultiplyTimeSpan(previewCurrentOffsetPT, _appliedSpeedRatio); // This is what our time would be 3185TimeSpan? expirationTimePT; 3191TimeSpan ourSyncTimeST = (_syncData.SyncClock == this) ? 3196TimeSpan? syncClockEffectiveDurationST = _syncData.SyncClockEffectiveDuration; 3205_syncData.PreviousSyncClockTime = TimeSpan.FromTicks(ourSyncTimeST.Ticks % syncClockDuration.TimeSpan.Ticks); 3211_syncData.PreviousRepeatTime = TimeSpan.Zero; 3228TimeSpan? previousSyncParentTimeSPT = (_syncData.SyncClock == this) ? 3241TimeSpan timeIntoSyncPeriodPT = previewCurrentOffsetPT; 3263_syncData.PreviousSyncClockTime = TimeSpan.Zero; 3264_syncData.PreviousRepeatTime = TimeSpan.Zero; 3281TimeSpan currentParentTimePT, double currentParentSpeed) 3301TimeSpan previousParentTimePT = parentIntervalCollection.IsEmptyOfRealPoints ? currentParentTimePT 3303TimeSpan parentElapsedTimePT = currentParentTimePT - previousParentTimePT; 3306TimeSpan ourProjectedElapsedTimeLT = MultiplyTimeSpan(parentElapsedTimePT, _appliedSpeedRatio); 3308TimeSpan syncTimeST = _syncData.SyncClock.GetCurrentTimeCore(); 3309TimeSpan syncElapsedTimeST = syncTimeST - _syncData.PreviousSyncClockTime; // Elapsed from last tick 3311if (syncElapsedTimeST > TimeSpan.Zero) // Only store the last value if it is greater than 3315TimeSpan? effectiveDurationST = _syncData.SyncClockEffectiveDuration; 3322_syncData.PreviousRepeatTime = TimeSpan.Zero; 3334_syncData.PreviousSyncClockTime = TimeSpan.Zero; 3344syncElapsedTimeST = TimeSpan.Zero; 3348TimeSpan syncElapsedTimeLT = (_syncData.SyncClock == this) 3353TimeSpan parentTimeSlipPT = parentElapsedTimePT - DivideTimeSpan(syncElapsedTimeLT, _appliedSpeedRatio); 3501private TimeSpan GetCurrentDesiredFrameTime(TimeSpan time) 3507private TimeSpan GetDesiredFrameTime(TimeSpan time, int frameOffset) 3516return TimeSpan.FromTicks(desiredFrameTick); 3520private TimeSpan GetNextDesiredFrameTime(TimeSpan time) 3651private TimeSpan DivideTimeSpan(TimeSpan timeSpan, double factor) 3654return TimeSpan.FromTicks((long)(((double)timeSpan.Ticks) / factor + 0.5)); 3670private static TimeSpan MultiplyTimeSpan(TimeSpan timeSpan, double factor) 3672return TimeSpan.FromTicks((long)(factor * (double)timeSpan.Ticks + 0.5)); 3682subtree.Current.InternalNextTickNeededTime = TimeSpan.Zero; 3686while (current != null && current.InternalNextTickNeededTime != TimeSpan.Zero) 3688current.InternalNextTickNeededTime = TimeSpan.Zero; 4023internal TimeSpan? SyncClockEffectiveDuration 4045internal TimeSpan PreviousSyncClockTime 4051internal TimeSpan PreviousRepeatTime 4057internal TimeSpan SyncClockBeginTime 4072private TimeSpan? _syncClockEffectiveDuration; // This reflects RepeatBehavior (local coordinates) 4074private TimeSpan? _syncClockBeginTime; 4075private TimeSpan _previousSyncClockTime; 4076private TimeSpan _previousRepeatTime; // How many complete iterations we already have done 4088internal TimeSpan CurrentAdjustedGlobalTime 4106internal TimeSpan LastAdjustedGlobalTime 4115internal TimeSpan? PendingSeekDestination 4130private TimeSpan _currentAdjustedGlobalTime; 4131private TimeSpan _lastAdjustedGlobalTime; 4132private TimeSpan? _pendingSeekDestination; 4398private TimeSpan? _currentTime; // Precalculated current global time 4413internal TimeSpan? _beginTime; 4419private TimeSpan? _currentIterationBeginTime; 4422internal TimeSpan? _nextTickNeededTime = null; 4470private static Int64 s_TimeSpanTicksPerSecond = TimeSpan.FromSeconds(1).Ticks;
System\Windows\Media\Animation\ClockController.cs (4)
147public void Seek(TimeSpan offset, TimeSeekOrigin origin) 177if (offset < TimeSpan.Zero) 189public void SeekAlignedToLastTick(TimeSpan offset, TimeSeekOrigin origin) 219if (offset < TimeSpan.Zero)
System\Windows\Media\Animation\ClockGroup.cs (8)
138if ((!duration.HasTimeSpan || duration.TimeSpan > TimeSpan.Zero) 249TimeSpan? previousTickNeededTime = InternalNextTickNeededTime; 338Duration currentDuration = TimeSpan.Zero; 370childEndOfActivePeriod += TimeSpan.FromMilliseconds(50); // This compensation is roughly one frame of video 577TimeSpan beginTime, TimeSpan? endTime, 591TimeSpan beginTime, TimeSpan endTime, Duration period,
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 399TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 403TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 404TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 548private TimeSpan LargestTimeSpanKeyTime 553TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 581return TimeSpan.FromSeconds(1.0); 621TimeSpan calculationDuration = TimeSpan.Zero; 651_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 692_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 751TimeSpan blockBeginTime = TimeSpan.Zero; 769TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 772TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 834TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 876TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 887_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 399TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 403TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 404TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 548private TimeSpan LargestTimeSpanKeyTime 553TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 581return TimeSpan.FromSeconds(1.0); 621TimeSpan calculationDuration = TimeSpan.Zero; 651_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 692_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 751TimeSpan blockBeginTime = TimeSpan.Zero; 769TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 772TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 834TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 876TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 887_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 399TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 403TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 404TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 548private TimeSpan LargestTimeSpanKeyTime 553TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 581return TimeSpan.FromSeconds(1.0); 621TimeSpan calculationDuration = TimeSpan.Zero; 651_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 692_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 751TimeSpan blockBeginTime = TimeSpan.Zero; 769TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 772TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 834TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 876TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 887_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 399TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 403TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 404TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 548private TimeSpan LargestTimeSpanKeyTime 553TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 581return TimeSpan.FromSeconds(1.0); 621TimeSpan calculationDuration = TimeSpan.Zero; 651_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 692_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 751TimeSpan blockBeginTime = TimeSpan.Zero; 769TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 772TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 834TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 876TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 887_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 399TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 403TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 404TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 548private TimeSpan LargestTimeSpanKeyTime 553TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 581return TimeSpan.FromSeconds(1.0); 621TimeSpan calculationDuration = TimeSpan.Zero; 651_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 692_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 751TimeSpan blockBeginTime = TimeSpan.Zero; 769TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 772TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 834TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 876TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 887_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\IClock.cs (1)
50TimeSpan CurrentTime
System\Windows\Media\Animation\KeyTime.cs (7)
46public static KeyTime FromTimeSpan(TimeSpan timeSpan) 48if (timeSpan < TimeSpan.Zero) 123if ((TimeSpan)keyTime1._value != (TimeSpan)keyTime2._value) 221public static implicit operator KeyTime(TimeSpan timeSpan) 236public TimeSpan TimeSpan 242return (TimeSpan)_value;
System\Windows\Media\Animation\KeyTimeConverter.cs (5)
107TimeSpan timeSpanValue = (TimeSpan)TypeDescriptor.GetConverter( 108typeof(TimeSpan)).ConvertFrom( 151mi = typeof(KeyTime).GetMethod("FromTimeSpan", new Type[] { typeof(TimeSpan) }); 194typeof(TimeSpan)).ConvertTo(
System\Windows\Media\Animation\ParallelTimeline.cs (4)
34public ParallelTimeline(TimeSpan? beginTime) 48public ParallelTimeline(TimeSpan? beginTime, Duration duration) 65public ParallelTimeline(TimeSpan? beginTime, Duration duration, RepeatBehavior repeatBehavior) 85Duration simpleDuration = TimeSpan.Zero;
System\Windows\Media\Animation\RepeatBehavior.cs (5)
27private readonly TimeSpan _repeatDuration; 41_repeatDuration = TimeSpan.Zero; 51public RepeatBehavior(TimeSpan duration) 53if (duration < TimeSpan.Zero) 121public TimeSpan Duration
System\Windows\Media\Animation\RepeatBehaviorConverter.cs (4)
93TimeSpan timeSpanValue = (TimeSpan)TypeDescriptor.GetConverter(typeof(TimeSpan)).ConvertFrom(td, cultureInfo, stringValue); 136mi = typeof(RepeatBehavior).GetConstructor(new Type[] { typeof(TimeSpan) });
System\Windows\Media\Animation\ResolvedKeyFrameEntry.cs (1)
11internal TimeSpan _resolvedKeyTime;
System\Windows\Media\Animation\TimeIntervalCollection.cs (85)
121private TimeIntervalCollection(TimeSpan point) 130private void InitializePoint(TimeSpan point) 147private TimeIntervalCollection(TimeSpan point, bool includePoint) 172private TimeIntervalCollection(TimeSpan from, bool includeFrom, TimeSpan to, bool includeTo) 246internal TimeSpan FirstNodeTime 264internal TimeIntervalCollection SlipBeginningOfConnectedInterval(TimeSpan slipTime) 266if (slipTime == TimeSpan.Zero) // The no-op case 293internal TimeIntervalCollection SetBeginningOfConnectedInterval(TimeSpan beginTime) 316internal static TimeIntervalCollection CreatePoint(TimeSpan time) 324internal static TimeIntervalCollection CreateClosedOpenInterval(TimeSpan from, TimeSpan to) 332internal static TimeIntervalCollection CreateOpenClosedInterval(TimeSpan from, TimeSpan to) 340internal static TimeIntervalCollection CreateInfiniteClosedInterval(TimeSpan from) 397internal bool Contains(TimeSpan time) 527internal bool Intersects(TimeSpan from, TimeSpan to) 535TimeSpan temp = from; 852internal bool IntersectsPeriodicCollection(TimeSpan beginTime, Duration period, double appliedSpeedRatio, 859|| (period == TimeSpan.Zero) // The PTIC has no nonzero period, we define such intersections nonexistent 981internal bool IntersectsMultiplePeriods(TimeSpan beginTime, Duration period, double appliedSpeedRatio) 986|| (period == TimeSpan.Zero) // The PTIC has no nonzero period, we define such intersections nonexistent 1004TimeSpan lastNodeTime = _nodeTime[_count - 1]; 1027TimeSpan beginTime, TimeSpan endTime, Duration period, 1036Debug.Assert(!period.HasTimeSpan || period.TimeSpan > TimeSpan.Zero || beginTime == endTime); // Check the consistency of degenerate case where simple duration is zero; expiration time should equal beginTime 1101projection.InitializePoint(TimeSpan.FromTicks(outputInTicks)); 1149TimeSpan beginTime, Nullable<TimeSpan> endTime, 1161Debug.Assert(endTime.HasValue || fillDuration == TimeSpan.Zero); // Either endTime is finite, or it's infinite hence we cannot have any fill zone 1162Debug.Assert(!period.HasTimeSpan || period.TimeSpan > TimeSpan.Zero || (endTime.HasValue && beginTime == endTime)); // Check the consistency of degenerate case where simple duration is zero; expiration time should equal beginTime 1175&& _nodeIsPoint[_count - 1] && (endTime > beginTime || fillDuration.TimeSpan > TimeSpan.Zero)))); // ...we may have a point intersection with the stopped zone 1181projection.InitializePoint(TimeSpan.Zero); 1185bool includeFillPeriod = !fillDuration.HasTimeSpan || fillDuration.TimeSpan > TimeSpan.Zero; // This variable represents whether we have a non-zero fill zone 1194Nullable<TimeSpan> activeDuration; 1235TimeSpan beginTime, Nullable<TimeSpan> endTime, bool includeFillPeriod, double speedRatio) 1256projection.CurrentNodeTime = TimeSpan.Zero; 1269projection.CurrentNodeTime = TimeSpan.FromTicks((long)(speedRatio * timeOffset)); 1287projection.CurrentNodeTime = TimeSpan.FromTicks((long)(speedRatio * timeOffset)); 1304private void ProjectionFold(ref TimeIntervalCollection projection, Nullable<TimeSpan> activeDuration, 1312Debug.Assert(CurrentNodeTime >= TimeSpan.Zero); // Verify that we are already clipped 1346private void ProjectionFoldPoint(ref TimeIntervalCollection projection, Nullable<TimeSpan> activeDuration, 1375projection.MergePoint(TimeSpan.FromTicks(currentProjection)); 1389private bool ProjectionFoldInterval(ref TimeIntervalCollection projection, Nullable<TimeSpan> activeDuration, 1440projection.MergeInterval(TimeSpan.Zero, true, 1441TimeSpan.FromTicks(currentProjection), includeTime); 1446projection.MergeInterval(TimeSpan.FromTicks(currentProjection), includeTime, 1447TimeSpan.FromTicks(periodInTicks), true); 1457projection.MergeInterval(TimeSpan.Zero, true, 1458TimeSpan.FromTicks(clippedTime), NextNodeIsPoint); 1465projection.MergeInterval(TimeSpan.FromTicks(clippedTime), NextNodeIsPoint, 1466TimeSpan.FromTicks(periodInTicks), true); 1477projection.MergeInterval(TimeSpan.FromTicks(currentProjection - intervalLength), NextNodeIsPoint, 1478TimeSpan.FromTicks(currentProjection), CurrentNodeIsPoint); 1482projection.MergeInterval(TimeSpan.FromTicks(currentProjection), CurrentNodeIsPoint, 1483TimeSpan.FromTicks(currentProjection + intervalLength), NextNodeIsPoint); 1499projection._nodeTime[0] = TimeSpan.Zero; 1503projection._nodeTime[1] = TimeSpan.FromTicks(periodInTicks); 1513projection.MergeInterval(TimeSpan.FromTicks(currentProjection), CurrentNodeIsPoint, 1514TimeSpan.FromTicks(periodInTicks), false); 1517projection.MergeInterval(TimeSpan.Zero, true, 1518TimeSpan.FromTicks(intervalLength - timeBeforeNextPeriod), NextNodeIsPoint); 1524projection.MergePoint(TimeSpan.FromTicks(periodInTicks)); 1528projection.MergePoint(TimeSpan.Zero); 1536projection.MergeInterval(TimeSpan.FromTicks(currentProjection), CurrentNodeIsPoint, 1537TimeSpan.FromTicks(currentProjection + intervalLength), NextNodeIsPoint); 1550private void MergePoint(TimeSpan point) 1605private void MergeInterval(TimeSpan from, bool includeFrom, 1606TimeSpan to, bool includeTo) 1776_nodeTime = new TimeSpan[requiredCapacity]; 1787TimeSpan[] newNodeTime = new TimeSpan[newCapacity]; 1821TimeSpan accelEnd = TimeSpan.FromTicks((long)(dpPeriod * accelRatio)); 1822TimeSpan decelStart = TimeSpan.FromTicks(periodInTicks - (long)(dpPeriod * decelRatio)); 1832_nodeTime[_current] = TimeSpan.FromTicks((long)(halfMaxRate * inversePeriod * t * t / accelRatio)); 1840_nodeTime[_current] = TimeSpan.FromTicks((long)(halfMaxRate * (2 * t - (accelRatio * dpPeriod)))); 1848_nodeTime[_current] = TimeSpan.FromTicks(periodInTicks - (long)(halfMaxRate * inversePeriod * t * t / decelRatio)); 2121private int Locate(TimeSpan time) 2196private TimeSpan CurrentNodeTime 2238private TimeSpan NextNodeTime 2283private TimeSpan[] _nodeTime; // An interval's begin time
System\Windows\Media\Animation\Timeline.cs (8)
54protected Timeline(Nullable<TimeSpan> beginTime) 69protected Timeline(Nullable<TimeSpan> beginTime, Duration duration) 88protected Timeline(Nullable<TimeSpan> beginTime, Duration duration, RepeatBehavior repeatBehavior) 272typeof(TimeSpan?), 275(TimeSpan?)TimeSpan.Zero, 289public TimeSpan? BeginTime 293return (TimeSpan?)GetValue(BeginTimeProperty);
System\Windows\Media\Animation\TimelineGroup.cs (3)
32protected TimelineGroup(Nullable<TimeSpan> beginTime) 46protected TimelineGroup(Nullable<TimeSpan> beginTime, Duration duration) 63protected TimelineGroup(Nullable<TimeSpan> beginTime, Duration duration, RepeatBehavior repeatBehavior)
System\Windows\Media\Animation\TimeManager.cs (29)
111public Nullable<TimeSpan> CurrentTime 215if (GetNextTickNeeded() >= TimeSpan.Zero) 266TimeSpan offsetTime = TimeSpan.FromMilliseconds((double)offset); 296_lastTickTime = TimeSpan.Zero; 300_globalTime = TimeSpan.Zero; 368EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordAnimation | EventTrace.Keyword.KeywordPerf, EventTrace.Event.WClientTimeManagerTickBegin, (_startTime + _globalTime).Ticks / TimeSpan.TicksPerMillisecond); 442TimeSpan IClock.CurrentTime 446return TimeSpan.FromTicks(DateTime.Now.Ticks); 468public TimeSpan CurrentTime 483private TimeSpan _currentTime; 543internal TimeSpan GetCurrentGlobalTime() 551return TimeSpan.Zero; 576return TimeSpan.Zero; 705internal TimeSpan InternalCurrentGlobalTime 750internal TimeSpan GetNextTickNeeded() 758TimeSpan? nextTickNeededTime = _timeManagerClock.InternalNextTickNeededTime; 763TimeSpan timeManagerCurrentTime = _systemClock.CurrentTime - _startTime; 766TimeSpan nextTickNeededTimeFromCurrentTime = nextTickNeededTime.Value - timeManagerCurrentTime; 768if (nextTickNeededTimeFromCurrentTime <= TimeSpan.Zero) 772return TimeSpan.Zero; 782return TimeSpan.FromTicks(-1); 788return TimeSpan.FromTicks(-1); 795internal TimeSpan LastTickDelta 806internal TimeSpan LastTickTime 887private TimeSpan _globalTime; 888private TimeSpan _startTime; 889private TimeSpan _lastTickTime; 890private TimeSpan _pauseTime;
System\Windows\Media\HostVisual.cs (1)
282TimeSpan.FromMilliseconds(1000),
System\Windows\Media\Imaging\WriteableBitmap.cs (4)
227TimeSpan timeoutSpan; 234timeoutSpan = TimeSpan.FromMilliseconds(-1); 588AcquireBackBuffer(TimeSpan.Zero, false); 934private bool AcquireBackBuffer(TimeSpan timeout, bool waitForCopy)
System\Windows\Media\mediaclock.cs (5)
71protected override TimeSpan GetCurrentTimeCore() 93_mediaPlayer.SetPosition(TimeSpan.FromTicks(0)); 123TimeSpan? currentTimeProperty = this.CurrentTime; 124TimeSpan currentTimeValue = currentTimeProperty ?? TimeSpan.Zero;
System\Windows\Media\MediaContext.cs (33)
69return (long)(TimeSpan.TicksPerSecond * (counts / _perfCounterFreq) + (TimeSpan.TicksPerSecond * (counts % _perfCounterFreq)) / _perfCounterFreq); 80return (long)(_perfCounterFreq * (ticks / TimeSpan.TicksPerSecond) + (_perfCounterFreq * (ticks % TimeSpan.TicksPerSecond)) / TimeSpan.TicksPerSecond); 194_estimatedNextPresentationTime = TimeSpan.FromTicks(CountsToTicks(_lastPresentationTime)); 532private void ScheduleNextRenderOp(TimeSpan minimumDelay) 548TimeSpan nextTickNeeded = TimeSpan.Zero; 564if (nextTickNeeded >= TimeSpan.Zero) 566nextTickNeeded = TimeSpan.FromTicks(Math.Max(nextTickNeeded.Ticks, minimumDelay.Ticks)); 575if (nextTickNeeded > TimeSpan.FromSeconds(1)) 586else if (nextTickNeeded > TimeSpan.Zero) 597_promoteRenderOpToRender.Interval = TimeSpan.FromSeconds(1); 601else if (nextTickNeeded == TimeSpan.Zero) 660long earliestWakeupTicks = currentTicks + TicksUntilNextVsync(currentTicks) + TimeSpan.TicksPerMillisecond; 661_estimatedNextVSyncTimer.Interval = TimeSpan.FromTicks(earliestWakeupTicks - currentTicks); 668_estimatedNextVSyncTimer.Interval = TimeSpan.FromMilliseconds(17); 714TimeSpan presentationDelay = TimeSpan.Zero; 909return TimeSpan.TicksPerSecond / _animationRenderRate; 1073TimeSpan IClock.CurrentTime 1165if ((nextPresentationTicks - _estimatedNextPresentationTime.Ticks) * _animationRenderRate > TimeSpan.FromMilliseconds(500).Ticks) 1168_estimatedNextPresentationTime = TimeSpan.FromTicks(nextPresentationTicks); 1173_estimatedNextPresentationTime = TimeSpan.FromTicks(countsTicks); 1178_estimatedNextPresentationTime = TimeSpan.FromTicks(countsTicks); 1880ScheduleNextRenderOp(TimeSpan.Zero); 2527timer.Interval = TimeSpan.FromTicks(earliestWakeupTicks - currentTicks); 2539ScheduleNextRenderOp(TimeSpan.Zero); 2715private TimeSpan _timeDelay = TimeSpan.FromMilliseconds(10); 2861private TimeSpan _estimatedNextPresentationTime; 2889private const long MaxTicksWithoutInput = TimeSpan.TicksPerSecond / 2;
System\Windows\Media\MediaPlayer.cs (2)
245public TimeSpan Position 871TimeSpan value
System\Windows\Media\MediaPlayerState.cs (7)
394return new Duration(TimeSpan.FromTicks(mediaLength)); 402internal TimeSpan Position 658SetPosition(TimeSpan.Zero); 697Position = TimeSpan.FromTicks(0); 876internal void SetPosition(TimeSpan value) 886private TimeSpan GetPosition() 892return TimeSpan.FromTicks(position);
System\Windows\Media\MediaTimeline.cs (3)
57public MediaTimeline(Nullable<TimeSpan> beginTime) : this() 67public MediaTimeline(Nullable<TimeSpan> beginTime, Duration duration) 80public MediaTimeline(Nullable<TimeSpan> beginTime, Duration duration, RepeatBehavior repeatBehavior)
System\Windows\Media\RenderingEventArgs.cs (3)
16internal RenderingEventArgs(TimeSpan renderingTime) 25public TimeSpan RenderingTime 33private TimeSpan _renderingTime;
System\Windows\Nrbf\SerializationRecordExtensions.cs (2)
154SZArrayRecord<TimeSpan> ar => ar.GetArray().CreateTrimmedList(size), 241SZArrayRecord<TimeSpan> ar => ar.GetArray(),
PresentationCore.Tests (36)
System\Windows\DurationConverter.Tests.cs (8)
16[InlineData(false, typeof(TimeSpan))] 31[InlineData(false, typeof(TimeSpan))] 48Assert.Equal(expected, TimeSpan.Parse(expected).ToString()); 78[InlineData(typeof(TimeSpan))] 106yield return new object?[] { new Duration(TimeSpan.FromTicks(6488853448000)), CultureInfo.InvariantCulture, "07:12:14:45.3448 " }; 107yield return new object?[] { new Duration(TimeSpan.FromTicks(5624853448000)), new CultureInfo("ru-RU"), " 6:12:14:45,3448 " }; 109yield return new object?[] { new Duration(TimeSpan.FromTicks(5184000000000)), CultureInfo.InvariantCulture, " 6 " }; 111yield return new object?[] { new Duration(TimeSpan.FromTicks(223200000000)), CultureInfo.InvariantCulture, " 6:12 " };
System\Windows\Media\Animation\KeySplineConverter.Tests.cs (3)
16[InlineData(false, typeof(TimeSpan))] 33[InlineData(false, typeof(TimeSpan))] 303yield return new object[] { new KeySpline(0.2, 0.3, 0.4, 0.5), typeof(TimeSpan), CultureInfo.InvariantCulture };
System\Windows\Media\Animation\RepeatBehavior.Tests.cs (25)
53public void Constructor_NegativeDuration_ThrowsArgumentOutOfRangeException(TimeSpan duration) 62yield return new object[] { TimeSpan.MinValue }; 63yield return new object[] { TimeSpan.FromTicks(-1) }; 69public void Kind_Duration_ReturnsExpected_Value(TimeSpan duration) 80yield return new object[] { TimeSpan.Zero }; 81yield return new object[] { TimeSpan.MaxValue }; 82yield return new object[] { TimeSpan.FromSeconds(1) }; 89RepeatBehavior behavior = new RepeatBehavior(TimeSpan.FromSeconds(1)); 98RepeatBehavior behavior = new RepeatBehavior(TimeSpan.FromSeconds(1)); 161yield return new object[] { new RepeatBehavior(TimeSpan.FromSeconds(1)), new RepeatBehavior(TimeSpan.FromSeconds(1)), true }; 162yield return new object[] { new RepeatBehavior(TimeSpan.FromDays(3)), new RepeatBehavior(TimeSpan.FromDays(3)), true }; 163yield return new object[] { new RepeatBehavior(TimeSpan.FromSeconds(1111)), new RepeatBehavior(TimeSpan.FromSeconds(1111)), true }; 166yield return new object[] { new RepeatBehavior(TimeSpan.FromSeconds(1111)), new RepeatBehavior(TimeSpan.FromSeconds(1112)), false }; 167yield return new object[] { new RepeatBehavior(TimeSpan.FromSeconds(0)), new RepeatBehavior(TimeSpan.FromSeconds(8888)), false }; 168yield return new object[] { new RepeatBehavior(TimeSpan.FromDays(5)), new RepeatBehavior(TimeSpan.FromDays(7)), false }; 171yield return new object[] { new RepeatBehavior(1), new RepeatBehavior(TimeSpan.FromSeconds(1)), false }; 172yield return new object[] { new RepeatBehavior(1111), new RepeatBehavior(TimeSpan.FromSeconds(1112)), false }; 178yield return new object[] { RepeatBehavior.Forever, new RepeatBehavior(TimeSpan.FromSeconds(1112)), false }; 182yield return new object[] { RepeatBehavior.Forever, new RepeatBehavior(TimeSpan.Zero), false };
PresentationFramework (78)
MS\Internal\Documents\FlowDocumentPaginator.cs (1)
811long timeSpan = (dtStop.Ticks - dtStart.Ticks) / TimeSpan.TicksPerMillisecond;
System\Windows\Controls\AVElementHelper.cs (4)
56_position = new SettableState<TimeSpan>(new TimeSpan(0)); 173internal TimeSpan Position 199TimeSpan position 853private SettableState<TimeSpan> _position;
System\Windows\Controls\ItemsControl.cs (2)
3306internal static TimeSpan AutoScrollTimeout 3314return TimeSpan.FromMilliseconds(MS.Win32.SafeNativeMethods.GetDoubleClickTime() * 0.8);
System\Windows\Controls\MediaElement.cs (1)
523public TimeSpan Position
System\Windows\Controls\MenuItem.cs (1)
2573timer.Interval = TimeSpan.FromMilliseconds(SystemParameters.MenuShowDelay);
System\Windows\Controls\PopupControlService.cs (3)
388Interval = TimeSpan.FromMilliseconds(showDelay) 482Interval = TimeSpan.FromMilliseconds(ToolTipService.GetShowDuration(o)) 610Interval = TimeSpan.FromMilliseconds(betweenShowDelay)
System\Windows\Controls\Primitives\Popup.cs (2)
1690_asyncDestroy.Interval = animating ? AnimationDelayTime : TimeSpan.Zero; 2902internal static TimeSpan AnimationDelayTime = new TimeSpan(0, 0, 0, 0, AnimationDelay);
System\Windows\Controls\Primitives\RepeatButton.cs (3)
117_timer.Interval = TimeSpan.FromMilliseconds(Delay); 137TimeSpan interval = TimeSpan.FromMilliseconds(Interval);
System\Windows\Controls\ProgressBar.cs (8)
230TimeSpan translateTime = TimeSpan.FromSeconds(((int)(endPos - startPos) / 200.0)); // travel at 200px /second 231TimeSpan pauseTime = TimeSpan.FromSeconds(1.0); // pause 1 second between animations 232TimeSpan startTime; 239startTime = TimeSpan.FromSeconds(-1*(_glow.Margin.Left-startPos)/200.0); 243startTime = TimeSpan.Zero; 254animation.KeyFrames.Add(new LinearThicknessKeyFrame(new Thickness(startPos,0,0,0), TimeSpan.FromSeconds(0)));
System\Windows\Controls\TextSearch.cs (2)
689private TimeSpan TimeOut 700return TimeSpan.FromMilliseconds(SafeNativeMethods.GetDoubleClickTime() * 2);
System\Windows\Controls\VirtualizingStackPanel.cs (1)
8850_cleanupDelay.Interval = TimeSpan.FromMilliseconds(500.0);
System\Windows\Data\BindingExpressionBase.cs (1)
2713timer.Interval = TimeSpan.FromMilliseconds(delay);
System\windows\Documents\CaretElement.cs (1)
895Duration blinkDuration = new Duration(TimeSpan.FromMilliseconds(blinkInterval * 2));
System\windows\Documents\TextEditor.cs (1)
505_mouseSelectionState.Timer.Interval = TimeSpan.FromMilliseconds(Math.Max(SystemParameters.MenuShowDelay, 200));
System\Windows\Markup\Baml2006\Baml2006KnownTypes.cs (1)
756case 663: t = () => typeof(TimeSpan); break;
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
11386typeof(System.TimeSpan),
System\Windows\Markup\KnownTypes.cs (1)
6210case KnownElements.TimeSpan: t = typeof(System.TimeSpan); break;
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (20)
336TimeSpan currentTime = animationClock.CurrentTime.Value; 410TimeSpan previousResolvedKeyTime = _sortedResolvedKeyFrames[previousResolvedKeyFrameIndex]._resolvedKeyTime; 414TimeSpan segmentCurrentTime = currentTime - previousResolvedKeyTime; 415TimeSpan segmentDuration = _sortedResolvedKeyFrames[currentResolvedKeyFrameIndex]._resolvedKeyTime - previousResolvedKeyTime; 640private TimeSpan LargestTimeSpanKeyTime 645TimeSpan largestTimeSpanKeyTime = TimeSpan.Zero; 673return TimeSpan.FromSeconds(1.0); 713TimeSpan calculationDuration = TimeSpan.Zero; 743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 784_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.Zero; 843TimeSpan blockBeginTime = TimeSpan.Zero; 861TimeSpan uniformTimeStep = TimeSpan.FromTicks((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount); 864TimeSpan resolvedTime = blockBeginTime + uniformTimeStep; 926TimeSpan prePacedBlockKeyTime = _sortedResolvedKeyFrames[index - 1]._resolvedKeyTime; 968TimeSpan pacedBlockDuration = _sortedResolvedKeyFrames[index]._resolvedKeyTime - prePacedBlockKeyTime; 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\SeekStoryboard.cs (4)
27public TimeSpan Offset 52return !(TimeSpan.Zero.Equals(_offset)); 104private TimeSpan _offset = TimeSpan.Zero;
System\Windows\Media\Animation\Storyboard.cs (16)
1472public Nullable<TimeSpan> GetCurrentTime( FrameworkElement containingObject ) 1482public Nullable<TimeSpan> GetCurrentTime( FrameworkContentElement containingObject ) 1491public TimeSpan GetCurrentTime() 1493Nullable<TimeSpan> currentTime = GetCurrentTimeImpl(this); 1501return default(TimeSpan); 1505private Nullable<TimeSpan> GetCurrentTimeImpl( DependencyObject containingObject ) 1694public void Seek( FrameworkElement containingObject, TimeSpan offset, TimeSeekOrigin origin ) 1704public void Seek( FrameworkContentElement containingObject, TimeSpan offset, TimeSeekOrigin origin ) 1714public void Seek( TimeSpan offset, TimeSeekOrigin origin ) 1724public void Seek( TimeSpan offset ) 1729private void SeekImpl( DependencyObject containingObject, TimeSpan offset, TimeSeekOrigin origin ) 1742public void SeekAlignedToLastTick( FrameworkElement containingObject, TimeSpan offset, TimeSeekOrigin origin ) 1752public void SeekAlignedToLastTick( FrameworkContentElement containingObject, TimeSpan offset, TimeSeekOrigin origin ) 1762public void SeekAlignedToLastTick( TimeSpan offset, TimeSeekOrigin origin ) 1772public void SeekAlignedToLastTick( TimeSpan offset ) 1777private void SeekAlignedToLastTickImpl( DependencyObject containingObject, TimeSpan offset, TimeSeekOrigin origin )
System\Windows\SystemParameters.cs (2)
733public static TimeSpan MouseHoverTime 737return TimeSpan.FromMilliseconds(MouseHoverTimeMilliseconds);
System\Windows\VisualStateManager.cs (2)
372dynamic.Duration = new Duration(TimeSpan.Zero); 780private static readonly Duration DurationZero = new Duration(TimeSpan.Zero);
PresentationFramework.Aero (31)
Microsoft\Windows\Themes\BulletChrome.cs (6)
120Duration duration = new Duration(TimeSpan.FromSeconds(0.2)); 173Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 268Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 344Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 437Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 502Duration duration = new Duration(TimeSpan.FromSeconds(0.3));
Microsoft\Windows\Themes\ButtonChrome.cs (13)
113Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 125daukf.KeyFrames.Add(new LinearDoubleKeyFrame(1.0, TimeSpan.FromSeconds(0.5))); 126daukf.KeyFrames.Add(new DiscreteDoubleKeyFrame(1.0, TimeSpan.FromSeconds(0.75))); 127daukf.KeyFrames.Add(new LinearDoubleKeyFrame(0.0, TimeSpan.FromSeconds(2.0))); 144Duration duration = new Duration(TimeSpan.FromSeconds(0.2)); 208Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 234daukf.KeyFrames.Add(new LinearDoubleKeyFrame(1.0, TimeSpan.FromSeconds(to1))); 235daukf.KeyFrames.Add(new DiscreteDoubleKeyFrame(1.0, TimeSpan.FromSeconds(to1 + 0.25))); 236daukf.KeyFrames.Add(new LinearDoubleKeyFrame(0.0, TimeSpan.FromSeconds(to1 + 1.5))); 237daukf.KeyFrames.Add(new LinearDoubleKeyFrame(currentOpacity, TimeSpan.FromSeconds(2))); 245Duration duration = new Duration(TimeSpan.FromSeconds(0.2)); 299Duration duration = new Duration(TimeSpan.FromSeconds(0.1)); 332Duration duration = new Duration(TimeSpan.FromSeconds(0.1));
Microsoft\Windows\Themes\ListBoxChrome.cs (2)
137Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 149Duration duration = new Duration(TimeSpan.FromSeconds(0.2));
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (5)
84TimeSpan translateTime = TimeSpan.FromSeconds(twiceWidth / 200.0); // travel at 200px /second 85TimeSpan pauseTime = TimeSpan.FromSeconds(1.0); // pause 1 second between animations 89BeginTime = TimeSpan.Zero,
Microsoft\Windows\Themes\ScrollChrome.cs (5)
107Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 144Duration duration = new Duration(TimeSpan.FromSeconds(0.2)); 225Duration duration = new Duration(TimeSpan.FromSeconds(0.2)); 250Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 327Duration duration = new Duration(TimeSpan.FromSeconds(0.3));
PresentationFramework.Aero2 (31)
Microsoft\Windows\Themes\BulletChrome.cs (6)
120Duration duration = new Duration(TimeSpan.FromSeconds(0.2)); 173Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 268Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 344Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 437Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 502Duration duration = new Duration(TimeSpan.FromSeconds(0.3));
Microsoft\Windows\Themes\ButtonChrome.cs (13)
113Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 125daukf.KeyFrames.Add(new LinearDoubleKeyFrame(1.0, TimeSpan.FromSeconds(0.5))); 126daukf.KeyFrames.Add(new DiscreteDoubleKeyFrame(1.0, TimeSpan.FromSeconds(0.75))); 127daukf.KeyFrames.Add(new LinearDoubleKeyFrame(0.0, TimeSpan.FromSeconds(2.0))); 144Duration duration = new Duration(TimeSpan.FromSeconds(0.2)); 208Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 234daukf.KeyFrames.Add(new LinearDoubleKeyFrame(1.0, TimeSpan.FromSeconds(to1))); 235daukf.KeyFrames.Add(new DiscreteDoubleKeyFrame(1.0, TimeSpan.FromSeconds(to1 + 0.25))); 236daukf.KeyFrames.Add(new LinearDoubleKeyFrame(0.0, TimeSpan.FromSeconds(to1 + 1.5))); 237daukf.KeyFrames.Add(new LinearDoubleKeyFrame(currentOpacity, TimeSpan.FromSeconds(2))); 245Duration duration = new Duration(TimeSpan.FromSeconds(0.2)); 299Duration duration = new Duration(TimeSpan.FromSeconds(0.1)); 332Duration duration = new Duration(TimeSpan.FromSeconds(0.1));
Microsoft\Windows\Themes\ListBoxChrome.cs (2)
137Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 149Duration duration = new Duration(TimeSpan.FromSeconds(0.2));
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (5)
84TimeSpan translateTime = TimeSpan.FromSeconds(twiceWidth / 200.0); // travel at 200px /second 85TimeSpan pauseTime = TimeSpan.FromSeconds(1.0); // pause 1 second between animations 89BeginTime = TimeSpan.Zero,
Microsoft\Windows\Themes\ScrollChrome.cs (5)
107Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 144Duration duration = new Duration(TimeSpan.FromSeconds(0.2)); 225Duration duration = new Duration(TimeSpan.FromSeconds(0.2)); 250Duration duration = new Duration(TimeSpan.FromSeconds(0.3)); 327Duration duration = new Duration(TimeSpan.FromSeconds(0.3));
PresentationFramework.AeroLite (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
108Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds)), // Repeat every 3 seconds
PresentationFramework.Classic (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
108Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds)), // Repeat every 3 seconds
PresentationFramework.Luna (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
108Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds)), // Repeat every 3 seconds
PresentationFramework.Royale (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
108Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds)), // Repeat every 3 seconds
PresentationFramework.Tests (4)
System\Windows\Controls\VirtualizationCacheLengthConverter.Tests.cs (4)
24[InlineData(false, typeof(TimeSpan))] 42[InlineData(false, typeof(TimeSpan))] 178yield return new object?[] { new CultureInfo("ru-RU"), typeof(TimeSpan) }; 289yield return new object[] { new VirtualizationCacheLength(0.4, 0.5), typeof(TimeSpan), new CultureInfo("it-IT") };
Producer (2)
ContinuousProducerWorker.cs (1)
12using var timer = new PeriodicTimer(TimeSpan.FromSeconds(10));
IntermittentProducerWorker.cs (1)
25await Task.Delay(TimeSpan.FromSeconds(10), stoppingToken);
RateLimitingSample (2)
Program.cs (1)
31options.ReplenishmentPeriod = TimeSpan.FromSeconds(10);
SampleRateLimiterPolicy.cs (1)
33Window = TimeSpan.FromSeconds(5),
RazorWebSite (2)
Controllers\HtmlHelperOptionsController.cs (2)
22offset: TimeSpan.FromHours(0)) 42offset: TimeSpan.FromHours(0))
ReachFramework (1)
AlphaFlattener\Utility.cs (1)
36 TimeSpan elapsed = DateTime.Now - s_startTime;
ResponseCachingSample (1)
Startup.cs (1)
23MaxAge = TimeSpan.FromSeconds(10)
ResponseCompressionSample (1)
Startup.cs (1)
54await Task.Delay(TimeSpan.FromSeconds(1));
Roslyn.Diagnostics.Analyzers (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
Roslyn.VisualStudio.DiagnosticsWindow (3)
PerfMargin\PerfMarginPanel.cs (1)
51_timer = new DispatcherTimer(TimeSpan.FromMilliseconds(500), DispatcherPriority.Background, UpdateUI, Dispatcher);
PerfMargin\StatusIndicator.xaml.cs (2)
48private static readonly DoubleAnimation s_growAnimation = new DoubleAnimation(1.0, new Duration(TimeSpan.FromSeconds(1.0)), FillBehavior.HoldEnd); 49private static readonly DoubleAnimation s_shrinkAnimation = new DoubleAnimation(0.0, new Duration(TimeSpan.FromSeconds(0.33333)), FillBehavior.HoldEnd);
Roslyn.VisualStudio.Next.UnitTests (5)
Services\PerformanceTrackerServiceTests.cs (1)
183yield return new AnalyzerPerformanceInfo(kv.Key, true, TimeSpan.FromMilliseconds(timeSpan));
Services\SolutionAssetCacheTests.cs (4)
46remoteWorkspace: null, cleanupInterval: TimeSpan.FromMilliseconds(1), purgeAfter: TimeSpan.FromMilliseconds(2)); 79workspace, cleanupInterval: TimeSpan.FromMilliseconds(1), purgeAfter: TimeSpan.FromMilliseconds(2));
RoutingSandbox (3)
SlugifyParameterTransformer.cs (1)
13return value == null ? null : Regex.Replace(value.ToString(), "([a-z])([A-Z])", "$1-$2", RegexOptions.None, TimeSpan.FromMilliseconds(100)).ToLowerInvariant();
UseRouterStartup.cs (2)
11private static readonly TimeSpan RegexMatchTimeout = TimeSpan.FromSeconds(10);
RoutingWebSite (2)
UseRouterStartup.cs (2)
11private static readonly TimeSpan RegexMatchTimeout = TimeSpan.FromSeconds(10);
RunTests (30)
AssemblyInfo.cs (1)
27public readonly record struct TestMethodInfo(string Name, string FullyQualifiedName, TimeSpan ExecutionTime)
AssemblyScheduler.cs (12)
29private static readonly TimeSpan s_maxExecutionTime = TimeSpan.FromSeconds(60 * 10); 38ImmutableDictionary<string, TimeSpan> testHistory) 79private static void LogLongTests(ImmutableDictionary<string, TimeSpan> testHistory) 97ImmutableDictionary<string, TimeSpan> testHistory) 100var averageExecutionTime = TimeSpan.FromMilliseconds(testHistory.Values.Average(t => t.TotalMilliseconds)); 126if (testHistory.TryGetValue(methodInfo.FullyQualifiedName, out var executionTime)) 153var totalExpectedRunTime = TimeSpan.FromMilliseconds(updated.Values.SelectMany(types => types).SelectMany(type => type.Tests).Sum(test => test.ExecutionTime.TotalMilliseconds)); 234TimeSpan.FromSeconds(executionTime)); 264.Select(group => new TypeInfo(GetName(group.Key), group.Key, group.Select(test => new TestMethodInfo(GetName(test), test, TimeSpan.Zero)).ToImmutableArray()))
HelixTestRunner.cs (2)
25TimeSpan? estimatedExecutionTime) 31public TimeSpan? EstimatedExecutionTime { get; } = estimatedExecutionTime;
ITestExecutor.cs (3)
41internal TimeSpan Elapsed { get; } 55internal TestResultInfo(int exitCode, string? resultsFilePath, string? htmlResultsFilePath, TimeSpan elapsed, string standardOutput, string errorOutput) 81internal TimeSpan Elapsed => TestResultInfo.Elapsed;
Options.cs (2)
61public TimeSpan? Timeout { get; set; } 253Timeout = timeout is { } t ? TimeSpan.FromMinutes(t) : null,
ProcessTestExecutor.cs (1)
149var span = DateTime.UtcNow - start;
Program.cs (1)
152var elapsed = DateTime.Now - start;
TestHistoryManager.cs (8)
30public static async Task<ImmutableDictionary<string, TimeSpan>> GetTestHistoryAsync(Options options, CancellationToken cancellationToken) 51return ImmutableDictionary<string, TimeSpan>.Empty; 67return ImmutableDictionary<string, TimeSpan>.Empty; 76return ImmutableDictionary<string, TimeSpan>.Empty; 83Dictionary<string, TimeSpan> testInfos = new(); 103if (!testInfos.TryAdd(testName, TimeSpan.FromMilliseconds(testResult.DurationInMs))) 123var totalTestRuntime = TimeSpan.FromMilliseconds(testInfos.Values.Sum(t => t.TotalMilliseconds));
SampleStartups (1)
StartupExternallyControlled.cs (1)
48await _host.StopAsync(TimeSpan.FromSeconds(5));
ScenarioTests.Common.Tests (15)
ScenarioTestHelpers.cs (4)
26public static TimeSpan TestTimeout 32return TimeSpan.Parse(timeSpanAsString); 127TimeSpanValue = TimeSpan.MinValue, 169TimeSpanValue = TimeSpan.MinValue,
ScenarioTestTypes.cs (6)
384private TimeSpan _timeSpanValue; 507public TimeSpan TimeSpanValue 1068public TimeSpan ReadThrottle { get; set; } 1074public TimeSpan StreamDuration { get; set; } 1118if (StreamDuration != TimeSpan.Zero) 1145if (ReadThrottle != TimeSpan.Zero)
ServiceInterfaces.cs (5)
27String EchoWithTimeout(String message, TimeSpan serviceOperationTimeout); 30Task<String> EchoWithTimeoutAsync(String message, TimeSpan serviceOperationTimeout); 452Stream DownloadCustomizedStream(TimeSpan readThrottle, TimeSpan streamDuration); 458string DelayOperation(TimeSpan delay);
Security.TransportSecurity.IntegrationTests (3)
Tcp\StreamingTests.4.1.0.cs (3)
202TimeSpan serviceOperationTimeout = TimeSpan.FromMilliseconds(10000); 211binding.SendTimeout = TimeSpan.FromMilliseconds(5000);
ServiceBusWorker (1)
Producer.cs (1)
13var periodicTimer = new PeriodicTimer(TimeSpan.FromSeconds(5));
SessionSample (1)
Startup.cs (1)
38o.IdleTimeout = TimeSpan.FromSeconds(10);
Shared (21)
Data.Validation\TimeSpanAttribute.cs (9)
15/// Provides boundary validation for <see cref="TimeSpan"/>. 28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 33public TimeSpan? Maximum 39return TimeSpan.FromMilliseconds((double)_maxMs); 43return _max == null ? null : TimeSpan.Parse(_max, CultureInfo.InvariantCulture); 116var min = Minimum; 130if (value is TimeSpan ts)
ServerSentEvents\SseFormatter.cs (2)
102TimeSpan? reconnectionInterval) 129Debug.Assert(retry >= TimeSpan.Zero);
ServerSentEvents\SseItem.cs (3)
24private readonly TimeSpan? _reconnectionInterval; 67public TimeSpan? ReconnectionInterval 72if (value < TimeSpan.Zero)
ServerSentEvents\SseParser_1.cs (7)
46/// <summary>The maximum number of milliseconds representible by <see cref="System.TimeSpan"/>.</summary> 47private readonly long TimeSpan_MaxValueMilliseconds = (long)TimeSpan.MaxValue.TotalMilliseconds; 99private TimeSpan? _nextReconnectionInterval; 451TimeSpan timeSpan = milliseconds == TimeSpan_MaxValueMilliseconds ? TimeSpan.MaxValue : TimeSpan.FromMilliseconds(milliseconds); 478public TimeSpan ReconnectionInterval { get; private set; } = Timeout.InfiniteTimeSpan;
Shared.Tests (37)
Data.Validation\TimeSpanAttributeTests.cs (32)
16public TimeSpan? Time { get; set; } 19public TimeSpan? Time2 { get; set; } 36options.Time = TimeSpan.FromTicks(-1); 42options.Time = TimeSpan.FromTicks(TimeSpan.FromMilliseconds(10).Ticks + 1); 49options.Time = TimeSpan.FromTicks(0); 54options.Time = TimeSpan.FromMilliseconds(10); 61options.Time2 = TimeSpan.FromTicks(-1); 67options.Time2 = TimeSpan.FromTicks(0); 72options.Time2 = TimeSpan.FromMilliseconds(int.MaxValue); 81public TimeSpan? Time { get; set; } 84public TimeSpan? Time2 { get; set; } 101options.Time = TimeSpan.FromTicks(0); 107options.Time = TimeSpan.FromMilliseconds(10); 114options.Time = TimeSpan.FromMilliseconds(5); 121options.Time2 = TimeSpan.FromTicks(-1); 128options.Time2 = TimeSpan.FromTicks(0); 135options.Time2 = TimeSpan.FromMilliseconds(int.MaxValue); 144public TimeSpan? Time { get; set; } 147public TimeSpan? Time2 { get; set; } 164options.Time = TimeSpan.FromTicks(-1); 170options.Time = TimeSpan.FromTicks(TimeSpan.FromMilliseconds(10).Ticks + 1); 177options.Time = TimeSpan.FromTicks(0); 182options.Time = TimeSpan.FromMilliseconds(10); 189options.Time2 = TimeSpan.FromTicks(-1); 195options.Time2 = TimeSpan.FromTicks(0); 200options.Time2 = TimeSpan.FromMilliseconds(int.MaxValue); 215public TimeSpan Time { get; set; } 221public TimeSpan Time { get; set; } 246var value = TimeSpan.FromTicks(-1);
JsonSchemaExporter\TestTypes.cs (5)
85Value: new(new DateTime(2021, 1, 1), TimeSpan.Zero), 89yield return new TestData<TimeSpan>( 91AdditionalValues: [TimeSpan.MinValue, TimeSpan.MaxValue], 1237[JsonSerializable(typeof(TimeSpan))]
SignalRSamples (3)
Hubs\Streaming.cs (3)
17await Task.Delay(TimeSpan.FromMilliseconds(delay)); 23var observable = Observable.Interval(TimeSpan.FromMilliseconds(delay)) 39await Task.Delay(TimeSpan.FromMilliseconds(delay));
SocialSample (2)
Startup.cs (2)
345var expiresAt = DateTimeOffset.UtcNow + TimeSpan.FromSeconds(seconds); 375var expiresAt = DateTimeOffset.UtcNow + TimeSpan.FromSeconds(seconds);
Sockets.BindTests (6)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (2)
18private static readonly TimeSpan Timeout = TimeSpan.FromMinutes(1);
src\Servers\Kestrel\shared\test\TestConstants.cs (2)
11public static TimeSpan DefaultTimeout = TimeSpan.FromSeconds(30);
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
71public TimeSpan ShutdownTimeout { get; set; }
src\Servers\Kestrel\shared\test\TransportTestHelpers\DiagnosticMemoryPoolFactory.cs (1)
38public Task WhenAllBlocksReturned(TimeSpan span)
Sockets.FunctionalTests (32)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (2)
18private static readonly TimeSpan Timeout = TimeSpan.FromMinutes(1);
src\Servers\Kestrel\shared\test\TestConstants.cs (2)
11public static TimeSpan DefaultTimeout = TimeSpan.FromSeconds(30);
src\Servers\Kestrel\shared\test\TestServiceContext.cs (1)
71public TimeSpan ShutdownTimeout { get; set; }
src\Servers\Kestrel\shared\test\TransportTestHelpers\DiagnosticMemoryPoolFactory.cs (1)
38public Task WhenAllBlocksReturned(TimeSpan span)
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (1)
34KeepAlivePingDelay = TimeSpan.MaxValue,
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (10)
119var bytesWrittenTimeout = TimeSpan.FromMilliseconds(100); 120var bytesWrittenPollingInterval = TimeSpan.FromMilliseconds(bytesWrittenTimeout.TotalMilliseconds / 10); 212var bytesWrittenTimeout = TimeSpan.FromMilliseconds(100); 213var bytesWrittenPollingInterval = TimeSpan.FromMilliseconds(bytesWrittenTimeout.TotalMilliseconds / 10); 347await startReadingRequestBody.Task.TimeoutAfter(TimeSpan.FromSeconds(120)); 356await clientFinishedSendingRequestBody.Task.TimeoutAfter(TimeSpan.FromSeconds(120));
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (15)
515MinResponseDataRate = new MinDataRate(bytesPerSecond: 1024 * 1024, gracePeriod: TimeSpan.FromSeconds(2)) 582await requestAborted.Task.DefaultTimeout(TimeSpan.FromSeconds(30)); 649MinResponseDataRate = new MinDataRate(bytesPerSecond: 1024 * 1024, gracePeriod: TimeSpan.FromSeconds(2)) 705await aborted.Task.DefaultTimeout(TimeSpan.FromSeconds(30)); 770MinResponseDataRate = new MinDataRate(bytesPerSecond: 1024 * 1024, gracePeriod: TimeSpan.FromSeconds(2)), 831await requestAborted.Task.DefaultTimeout(TimeSpan.FromSeconds(30)); 868MinResponseDataRate = new MinDataRate(bytesPerSecond: 240, gracePeriod: TimeSpan.FromSeconds(2)) 945MinResponseDataRate = new MinDataRate(bytesPerSecond: 240, gracePeriod: TimeSpan.FromSeconds(2)) 1032MinResponseDataRate = new MinDataRate(bytesPerSecond: 240, gracePeriod: TimeSpan.FromSeconds(2)) 1134var expectedTimeElapsed = TimeSpan.FromSeconds(totalReceived / targetBytesPerSecond); 1135var timeElapsed = DateTimeOffset.UtcNow - startTime; 1155var expectedTimeElapsed = TimeSpan.FromSeconds(totalReceived / targetBytesPerSecond); 1156var timeElapsed = DateTimeOffset.UtcNow - startTime;
StartRequestDelegateUrlApp (1)
Program.cs (1)
40messageSent.Wait(TimeSpan.FromSeconds(30));
StartRouteBuilderUrlApp (1)
Program.cs (1)
41messageSent.Wait(TimeSpan.FromSeconds(30));
StartWithIApplicationBuilderUrlApp (1)
Program.cs (1)
44messageSent.Wait(TimeSpan.FromSeconds(30));
Stress.ApiService (2)
Program.cs (2)
124await Task.Delay(TimeSpan.FromSeconds(0.5)); 198while (stopwatch.Elapsed < TimeSpan.FromMinutes(1))
Stress.AppHost (1)
TestResource.cs (1)
72using var timer = new PeriodicTimer(TimeSpan.FromSeconds(seconds));
Stress.TelemetryService (2)
TelemetryStresser.cs (2)
37await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken); 136var timeSinceEpoch = dateTime.ToUniversalTime() - unixEpoch;
System.Collections.Concurrent (13)
System\Collections\Concurrent\BlockingCollection.cs (13)
311/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of milliseconds 312/// to wait, or a <see cref="System.TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 325public bool TryAdd(T item, TimeSpan timeout) 564/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of milliseconds 565/// to wait, or a <see cref="System.TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 577public bool TryTake([MaybeNullWhen(false)] out T item, TimeSpan timeout) 844/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of milliseconds 845/// to wait, or a <see cref="System.TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 862public static int TryAddToAny(BlockingCollection<T>[] collections, T item, TimeSpan timeout) 1204/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of milliseconds 1205/// to wait, or a <see cref="System.TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 1224public static int TryTakeFromAny(BlockingCollection<T>[] collections, out T? item, TimeSpan timeout) 1696private static void ValidateTimeout(TimeSpan timeout)
System.Collections.Immutable (1)
System\Collections\Frozen\Constants.cs (1)
60typeof(T) == typeof(TimeSpan) ||
System.ComponentModel.Annotations (3)
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (3)
37public TimeSpan MatchTimeout => TimeSpan.FromMilliseconds(MatchTimeoutInMilliseconds); 114: new Regex(Pattern, default(RegexOptions), TimeSpan.FromMilliseconds(MatchTimeoutInMilliseconds));
System.ComponentModel.TypeConverter (11)
System\ComponentModel\DateTimeOffsetConverter.cs (1)
144typeof(DateTimeOffset).GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(TimeSpan) }),
System\ComponentModel\ReflectTypeDescriptionProvider.cs (1)
177[typeof(TimeSpan)] = new IntrinsicTypeConverterData((type) => new TimeSpanConverter()),
System\ComponentModel\TimeSpanConverter.cs (8)
12/// Provides a type converter to convert <see cref='System.TimeSpan'/> objects to and from 19/// convert an object in the given source type to a <see cref='System.TimeSpan'/> object using the 37/// Converts the given object to a <see cref='System.TimeSpan'/> 47return TimeSpan.Parse(text, culture); 51throw new FormatException(SR.Format(SR.ConvertInvalidPrimitive, (string)value, nameof(TimeSpan)), e); 67if (destinationType == typeof(InstanceDescriptor) && value is TimeSpan) 70typeof(TimeSpan).GetMethod(nameof(TimeSpan.Parse), new Type[] { typeof(string) }),
System\Timers\Timer.cs (1)
71public Timer(TimeSpan interval) : this(interval.TotalMilliseconds)
System.Configuration.ConfigurationManager (46)
System\Configuration\InfiniteTimeSpanConverter.cs (5)
11private static readonly TypeConverter s_timeSpanConverter = TypeDescriptor.GetConverter(typeof(TimeSpan)); 15ValidateType(value, typeof(TimeSpan)); 17return (TimeSpan)value == TimeSpan.MaxValue 25? TimeSpan.MaxValue
System\Configuration\PositiveTimeSpanValidator.cs (3)
10return type == typeof(TimeSpan); 17if ((TimeSpan)value <= TimeSpan.Zero)
System\Configuration\TimeSpanMinutesConverter.cs (3)
13ValidateType(value, typeof(TimeSpan)); 15long data = (long)((TimeSpan)value).TotalMinutes; 22return TimeSpan.FromMinutes(min);
System\Configuration\TimeSpanMinutesOrInfiniteConverter.cs (4)
13ValidateType(value, typeof(TimeSpan)); 15return (TimeSpan)value == TimeSpan.MaxValue ? "Infinite" : base.ConvertTo(ctx, ci, value, type); 20return (string)data == "Infinite" ? TimeSpan.MaxValue : base.ConvertFrom(ctx, ci, data);
System\Configuration\TimeSpanSecondsConverter.cs (3)
13ValidateType(value, typeof(TimeSpan)); 15long data = (long)((TimeSpan)value).TotalSeconds; 31return TimeSpan.FromSeconds(min);
System\Configuration\TimeSpanSecondsOrInfiniteConverter.cs (4)
13ValidateType(value, typeof(TimeSpan)); 15return (TimeSpan)value == TimeSpan.MaxValue ? "Infinite" : base.ConvertTo(ctx, ci, value, type); 20return (string)data == "Infinite" ? TimeSpan.MaxValue : base.ConvertFrom(ctx, ci, data);
System\Configuration\TimeSpanValidator.cs (11)
9private readonly TimeSpan _maxValue; 10private readonly TimeSpan _minValue; 13public TimeSpanValidator(TimeSpan minValue, TimeSpan maxValue) 17public TimeSpanValidator(TimeSpan minValue, TimeSpan maxValue, bool rangeIsExclusive) 21public TimeSpanValidator(TimeSpan minValue, TimeSpan maxValue, bool rangeIsExclusive, long resolutionInSeconds) 37return type == typeof(TimeSpan); 42ValidatorUtils.HelperParamValidation(value, typeof(TimeSpan)); 44ValidatorUtils.ValidateScalar((TimeSpan)value,
System\Configuration\TimeSpanValidatorAttribute.cs (8)
17public TimeSpan MinValue { get; private set; } = TimeSpan.MinValue; 19public TimeSpan MaxValue { get; private set; } = TimeSpan.MaxValue; 26TimeSpan timeValue = TimeSpan.Parse(value, CultureInfo.InvariantCulture); 40TimeSpan timeValue = TimeSpan.Parse(value, CultureInfo.InvariantCulture);
System\Configuration\ValidatorUtils.cs (5)
75public static void ValidateScalar(TimeSpan value, TimeSpan min, TimeSpan max, long resolutionInSeconds, 83ValidateResolution(TimeSpan.FromSeconds(resolutionInSeconds).ToString(), value.Ticks, 84resolutionInSeconds * TimeSpan.TicksPerSecond);
System.Data.Common (70)
System\Data\ColumnTypeConverter.cs (1)
34typeof(TimeSpan),
System\Data\Common\DataStorage.cs (1)
84typeof(TimeSpan),
System\Data\Common\ObjectStorage.cs (1)
213if (typeof(TimeSpan) == dataType)
System\Data\Common\SQLConvert.cs (4)
465return XmlConvert.ToString((TimeSpan)value); 499_ => (TimeSpan)value, 645_ => (TimeSpan)value, 715return XmlConvert.ToString((TimeSpan)value);
System\Data\Common\TimeSpanStorage.cs (28)
12private static readonly TimeSpan s_defaultValue = TimeSpan.Zero; 14private TimeSpan[] _values = default!; // Late-initialized 17: base(column, typeof(TimeSpan), s_defaultValue, StorageType.TimeSpan) 29TimeSpan min = TimeSpan.MaxValue; 35min = (TimeSpan.Compare(_values[record], min) < 0) ? _values[record] : min; 45TimeSpan max = TimeSpan.MinValue; 51max = (TimeSpan.Compare(_values[record], max) >= 0) ? _values[record] : max; 82return TimeSpan.FromTicks((long)Math.Round(sum)); 100return TimeSpan.FromTicks((long)Math.Round(meanSum / meanCount)); 134return TimeSpan.FromTicks((long)stDev); 142throw ExprException.Overflow(typeof(TimeSpan)); 149TimeSpan valueNo1 = _values[recordNo1]; 150TimeSpan valueNo2 = _values[recordNo2]; 158return TimeSpan.Compare(valueNo1, valueNo2); 175TimeSpan valueNo1 = _values[recordNo]; 180return valueNo1.CompareTo((TimeSpan)value); 183private static TimeSpan ConvertToTimeSpan(object value) 190return TimeSpan.Parse((string)value); 202return (TimeSpan)value; 231TimeSpan value = _values[record]; 271return XmlConvert.ToString((TimeSpan)value); 276return new TimeSpan[recordCount]; 281TimeSpan[] typedStore = (TimeSpan[])store; 288_values = (TimeSpan[])store;
System\Data\Filter\BinaryNode.cs (17)
419if (vLeft is TimeSpan && vRight is DateTime) 421value = (DateTime)vRight + (TimeSpan)vLeft; 423else if (vLeft is DateTime && vRight is TimeSpan) 425value = (DateTime)vLeft + (TimeSpan)vRight; 435value = (TimeSpan)vLeft + (TimeSpan)vRight; 485if (vLeft is TimeSpan && vRight is SqlDateTime) 488value = SqlConvert.ConvertToSqlDateTime((DateTime)rValue.Value + (TimeSpan)vLeft); 490else if (vLeft is SqlDateTime && vRight is TimeSpan) 493value = SqlConvert.ConvertToSqlDateTime((DateTime)lValue.Value + (TimeSpan)vRight); 609value = (DateTime)vLeft - (TimeSpan)vRight; 619value = (TimeSpan)vLeft - (TimeSpan)vRight; 624if (vLeft is TimeSpan && vRight is SqlDateTime) 627value = SqlConvert.ConvertToSqlDateTime((DateTime)rValue.Value - (TimeSpan)vLeft); 629else if (vLeft is SqlDateTime && vRight is TimeSpan) 632value = SqlConvert.ConvertToSqlDateTime((DateTime)lValue.Value - (TimeSpan)vRight);
System\Data\SQLTypes\SQLDateTime.cs (15)
55private static readonly TimeSpan s_minTimeSpan = new DateTime(1753, 1, 1).Subtract(s_SQLBaseDate); 56private static readonly TimeSpan s_maxTimeSpan = DateTime.MaxValue.Subtract(s_SQLBaseDate); 196private static TimeSpan ToTimeSpan(SqlDateTime value) 199return new TimeSpan(value.m_day * TimeSpan.TicksPerDay + 200millisecond * TimeSpan.TicksPerMillisecond); 215long dayticks = daypart * TimeSpan.TicksPerDay; 216long timeticks = ((long)(timepart / s_SQLTicksPerMillisecond + 0.5)) * TimeSpan.TicksPerMillisecond; 223private static SqlDateTime FromTimeSpan(TimeSpan value) 230long ticks = value.Ticks - day * TimeSpan.TicksPerDay; 235ticks += TimeSpan.TicksPerDay; 238int time = (int)((double)ticks / TimeSpan.TicksPerMillisecond * s_SQLTicksPerMillisecond + 0.5); 367public static SqlDateTime operator +(SqlDateTime x, TimeSpan t) 373public static SqlDateTime operator -(SqlDateTime x, TimeSpan t) 383public static SqlDateTime Add(SqlDateTime x, TimeSpan t) 389public static SqlDateTime Subtract(SqlDateTime x, TimeSpan t)
System\Data\TypeLimiter.cs (1)
148typeof(TimeSpan),
System\Data\xmlsaver.cs (1)
237if (type == typeof(TimeSpan))
System\Data\XMLSchema.cs (1)
1824new NameType("duration", typeof(TimeSpan) ), /* XSD Apr */
System.Data.Odbc (13)
Common\System\Data\Common\AdapterUtil.Odbc.cs (2)
602long result = checked((long)seconds * TimeSpan.TicksPerSecond); 627long result = timerValue / TimeSpan.TicksPerMillisecond;
Common\System\Data\ProviderBase\DbBuffer.cs (2)
694internal TimeSpan ReadTime(int offset) 703internal void WriteTime(int offset, TimeSpan value)
Common\System\Data\ProviderBase\DbConnectionPool.cs (1)
194internal TimeSpan LoadBalanceTimeout
Common\System\Data\ProviderBase\DbConnectionPoolOptions.cs (2)
12private readonly TimeSpan _loadBalanceTimeout; 39public TimeSpan LoadBalanceTimeout
src\libraries\Common\src\System\Data\ProviderBase\TimeoutTimer.cs (1)
63timeout._timerExpire = checked(ADP.TimerCurrent() + (milliseconds * TimeSpan.TicksPerMillisecond));
System\Data\Odbc\Odbc32.cs (2)
772private static readonly TypeMap s_time = new TypeMap(OdbcType.Time, DbType.Time, typeof(TimeSpan), ODBC32.SQL_TYPE.TYPE_TIME, ODBC32.SQL_C.TYPE_TIME, ODBC32.SQL_C.TYPE_TIME, 6, 12, false); 900else if (dataType == typeof(System.TimeSpan))
System\Data\Odbc\OdbcDataReader.cs (2)
1038public TimeSpan GetTime(int i) 1040return (TimeSpan)internalGetTime(i);
System\Data\Odbc\OdbcUtils.cs (1)
304WriteTime(offset, (TimeSpan)value);
System.Data.OleDb (1)
artifacts\obj\System.Data.OleDb\Debug\net10.0\System.Data.OleDb.notsupported.cs (1)
237public System.TimeSpan GetTimeSpan(int ordinal) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); }
System.Diagnostics.DiagnosticSource (13)
System\Diagnostics\Activity.cs (3)
208/// <see cref="TimeSpan.Zero"/>. 210public TimeSpan Duration { get; private set; } 857if (Duration == TimeSpan.Zero)
System\Diagnostics\DiagnosticSourceActivity.cs (1)
57if (activity.Duration == TimeSpan.Zero)
System\Diagnostics\DsesActivitySourceListener.cs (2)
169[DynamicDependency(nameof(TimeSpan.Ticks), typeof(TimeSpan))]
System\Diagnostics\Metrics\AggregationManager.cs (6)
23public TimeSpan CollectionPeriod { get; private set; } 134public AggregationManager SetCollectionPeriod(TimeSpan collectionPeriod) 183TimeSpan delayTime = CalculateDelayTime(CollectionPeriod.TotalSeconds); 219private TimeSpan CalculateDelayTime(double collectionIntervalSecs) 266TimeSpan delayTime = CalculateDelayTime(collectionIntervalSecs); 304TimeSpan delayTime = CalculateDelayTime(collectionIntervalSecs);
System\Diagnostics\Metrics\MetricsEventSource.cs (1)
506_aggregationManager.SetCollectionPeriod(TimeSpan.FromSeconds(refreshIntervalSecs));
System.Diagnostics.EventLog (1)
artifacts\obj\System.Diagnostics.EventLog\Debug\net10.0\System.Diagnostics.EventLog.notsupported.cs (1)
334public System.Diagnostics.Eventing.Reader.EventRecord ReadEvent(System.TimeSpan timeout) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); }
System.Diagnostics.Process (13)
System\Diagnostics\Process.cs (4)
851/// Use <see cref="WaitForInputIdle(TimeSpan)"/> to force the processing of your application 860public bool WaitForInputIdle(TimeSpan timeout) => WaitForInputIdle(ToTimeoutMilliseconds(timeout)); 1445public bool WaitForExit(TimeSpan timeout) => WaitForExit(ToTimeoutMilliseconds(timeout)); 1447private static int ToTimeoutMilliseconds(TimeSpan timeout)
System\Diagnostics\Process.Linux.cs (4)
54public TimeSpan PrivilegedProcessorTime 71internal static DateTime BootTimeToDateTime(TimeSpan timespanAfterBoot) 128public TimeSpan TotalProcessorTime 149public TimeSpan UserProcessorTime
System\Diagnostics\Process.Unix.cs (2)
823internal static TimeSpan TicksToTimeSpan(double ticks) 839return TimeSpan.FromSeconds(ticks / (double)ticksPerSecond);
System\Diagnostics\ProcessThread.Linux.cs (3)
39public TimeSpan PrivilegedProcessorTime 58public TimeSpan TotalProcessorTime 74public TimeSpan UserProcessorTime
System.DirectoryServices (4)
artifacts\obj\System.DirectoryServices\Debug\net10.0\System.DirectoryServices.notsupported.cs (4)
218public System.TimeSpan ClientTimeout { get { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } } 241public System.TimeSpan ServerPageTimeLimit { get { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } } 242public System.TimeSpan ServerTimeLimit { get { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } } 819public System.TimeSpan ReplicationInterval { get { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } }
System.DirectoryServices.Protocols (28)
System\DirectoryServices\Protocols\common\DirectoryConnection.cs (3)
14internal TimeSpan _connectionTimeOut = new TimeSpan(0, 0, 30); 23public virtual TimeSpan Timeout 28if (value < TimeSpan.Zero)
System\DirectoryServices\Protocols\common\DirectoryRequest.cs (3)
292public TimeSpan TimeLimit 297if (value < TimeSpan.Zero) 318private TimeSpan _directoryTimeLimit = new TimeSpan(0);
System\DirectoryServices\Protocols\ldap\LdapAsyncResult.cs (2)
80internal TimeSpan _requestTimeout; 86public LdapPartialAsyncResult(int messageID, AsyncCallback callbackRoutine, object state, bool partialResults, LdapConnection con, bool partialCallback, TimeSpan requestTimeout) : base(callbackRoutine, state, partialResults)
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (8)
17internal delegate DirectoryResponse GetLdapResponseCallback(int messageId, LdapOperation operation, ResultAll resultType, TimeSpan requestTimeout, bool exceptionOnTimeOut); 102public override TimeSpan Timeout 107if (value < TimeSpan.Zero) 196public DirectoryResponse SendRequest(DirectoryRequest request, TimeSpan requestTimeout) 266public IAsyncResult BeginSendRequest(DirectoryRequest request, TimeSpan requestTimeout, PartialResultProcessing partialMode, AsyncCallback callback, object state) 730int searchTimeLimit = (int)(searchRequest.TimeLimit.Ticks / TimeSpan.TicksPerSecond); 1350internal async ValueTask<DirectoryResponse> ConstructResponseAsync(int messageId, LdapOperation operation, ResultAll resultType, TimeSpan requestTimeOut, bool exceptionOnTimeOut, bool sync) 1354tv_sec = (int)(requestTimeOut.Ticks / TimeSpan.TicksPerSecond)
System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs (12)
211public TimeSpan PingKeepAliveTimeout 216return new TimeSpan(result * TimeSpan.TicksPerSecond); 220if (value < TimeSpan.Zero) 231int seconds = (int)(value.Ticks / TimeSpan.TicksPerSecond); 250public TimeSpan PingWaitTimeout 255return new TimeSpan(result * TimeSpan.TicksPerMillisecond); 259if (value < TimeSpan.Zero) 270int milliseconds = (int)(value.Ticks / TimeSpan.TicksPerMillisecond); 392public TimeSpan SendTimeout 397return new TimeSpan(result * TimeSpan.TicksPerSecond); 401if (value < TimeSpan.Zero) 412int seconds = (int)(value.Ticks / TimeSpan.TicksPerSecond);
System.Formats.Asn1 (11)
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (8)
139TimeSpan? timeOffset = null; 274timeOffset = TimeSpan.Zero; 316TimeSpan tmp = new TimeSpan(offsetHour, offsetMinute, 0); 348TimeSpan fractionSpan = TimeSpan.Zero; 358fractionSpan = new TimeSpan((long)(frac * TimeSpan.TicksPerHour)); 368fractionSpan = new TimeSpan((long)(frac * TimeSpan.TicksPerMinute)); 374fractionSpan = new TimeSpan((long)(frac * TimeSpan.TicksPerSecond));
System\Formats\Asn1\AsnDecoder.UtcTime.cs (1)
204TimeSpan offset = new TimeSpan(offsetHour, offsetMinute, 0);
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (2)
74long floatingTicks = normalized.Ticks % TimeSpan.TicksPerSecond; 84decimalTicks /= TimeSpan.TicksPerSecond;
System.Formats.Cbor (2)
System\Formats\Cbor\Reader\CborReader.Tag.cs (2)
127TimeSpan timespan = TimeSpan.FromSeconds(seconds);
System.Formats.Nrbf (13)
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (4)
81int sizeOfT = typeof(T) == typeof(DateTime) || typeof(T) == typeof(TimeSpan) 108else if (typeof(T) == typeof(TimeSpan) || typeof(T) == typeof(DateTime)) 237else if (typeof(T) == typeof(TimeSpan)) 311else if (typeof(T) == typeof(TimeSpan))
System\Formats\Nrbf\ClassRecord.cs (2)
91public TimeSpan GetTimeSpan(string memberName) => GetMember<TimeSpan>(memberName);
System\Formats\Nrbf\ClassWithIdRecord.cs (1)
69MemberPrimitiveTypedRecord<TimeSpan> => Create(new TimeSpan(reader.ReadInt64())),
System\Formats\Nrbf\NrbfDecoder.cs (3)
259PrimitiveType.TimeSpan => new MemberPrimitiveTypedRecord<TimeSpan>(new TimeSpan(reader.ReadInt64())), 290PrimitiveType.TimeSpan => Decode<TimeSpan>(info, reader), 316PrimitiveType.TimeSpan => Decode<TimeSpan>(info, lengths, reader),
System\Formats\Nrbf\PrimitiveTypeRecord.cs (1)
18/// <see cref="DateTime"/>, and <see cref="TimeSpan"/>.
System\Formats\Nrbf\PrimitiveTypeRecordOfT.cs (1)
21/// <see cref="DateTime"/>, and <see cref="TimeSpan"/>.
System\Formats\Nrbf\Utils\TypeNameHelpers.cs (1)
98else if (typeof(T) == typeof(TimeSpan))
System.Formats.Tar (5)
System\Formats\Tar\TarHelpers.cs (5)
138new DateTimeOffset((secondsSinceUnixEpoch * TimeSpan.TicksPerSecond) + DateTime.UnixEpoch.Ticks, TimeSpan.Zero); 142new DateTimeOffset((long)(secondsSinceUnixEpoch * TimeSpan.TicksPerSecond) + DateTime.UnixEpoch.Ticks, TimeSpan.Zero); 146((decimal)(dateTimeOffset.UtcDateTime - DateTime.UnixEpoch).Ticks) / TimeSpan.TicksPerSecond;
System.IO.FileSystem.Watcher (2)
System\IO\FileSystemWatcher.cs (2)
609public WaitForChangedResult WaitForChanged(WatcherChangeTypes changeType, TimeSpan timeout) => 612private static int ToTimeoutMilliseconds(TimeSpan timeout)
System.IO.IsolatedStorage (3)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (3)
247return new DateTimeOffset(1601, 1, 1, 0, 0, 0, TimeSpan.Zero).ToLocalTime(); 263return new DateTimeOffset(1601, 1, 1, 0, 0, 0, TimeSpan.Zero).ToLocalTime(); 279return new DateTimeOffset(1601, 1, 1, 0, 0, 0, TimeSpan.Zero).ToLocalTime();
System.IO.Pipes (3)
System\IO\Pipes\NamedPipeClientStream.cs (3)
129public void Connect(TimeSpan timeout) => Connect(ToTimeoutMilliseconds(timeout)); 201public Task ConnectAsync(TimeSpan timeout, CancellationToken cancellationToken = default) => 204private static int ToTimeoutMilliseconds(TimeSpan timeout)
System.Linq.Expressions (2)
System\Dynamic\Utils\TypeUtils.cs (2)
85else if (type == typeof(TimeSpan)) 87return typeof(TimeSpan?);
System.Management (20)
artifacts\obj\System.Management\Debug\net10.0\System.Management.notsupported.cs (20)
69public ConnectionOptions(string locale, string username, System.Security.SecureString password, string authority, System.Management.ImpersonationLevel impersonation, System.Management.AuthenticationLevel authentication, bool enablePrivileges, System.Management.ManagementNamedValueCollection context, System.TimeSpan timeout) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 70public ConnectionOptions(string locale, string username, string password, string authority, System.Management.ImpersonationLevel impersonation, System.Management.AuthenticationLevel authentication, bool enablePrivileges, System.Management.ManagementNamedValueCollection context, System.TimeSpan timeout) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 84public DeleteOptions(System.Management.ManagementNamedValueCollection context, System.TimeSpan timeout) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 90public EnumerationOptions(System.Management.ManagementNamedValueCollection context, System.TimeSpan timeout, int blockSize, bool rewindable, bool returnImmediatley, bool useAmendedQualifiers, bool ensureLocatable, bool prototypeOnly, bool directRead, bool enumerateDeep) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 117public EventWatcherOptions(System.Management.ManagementNamedValueCollection context, System.TimeSpan timeout, int blockSize) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 132public InvokeMethodOptions(System.Management.ManagementNamedValueCollection context, System.TimeSpan timeout) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 214public static string ToDmtfTimeInterval(System.TimeSpan timespan) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 215public static System.TimeSpan ToTimeSpan(string dmtfTimespan) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 384public static readonly System.TimeSpan InfiniteTimeout; 386public System.TimeSpan Timeout { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } } 582public ObjectGetOptions(System.Management.ManagementNamedValueCollection context, System.TimeSpan timeout, bool useAmendedQualifiers) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 652public PutOptions(System.Management.ManagementNamedValueCollection context, System.TimeSpan timeout, bool useAmendedQualifiers, System.Management.PutType putType) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 768public WqlEventQuery(string eventClassName, string condition, System.TimeSpan groupWithinInterval) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 769public WqlEventQuery(string eventClassName, string condition, System.TimeSpan groupWithinInterval, string[] groupByPropertyList) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 770public WqlEventQuery(string eventClassName, System.TimeSpan withinInterval) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 771public WqlEventQuery(string eventClassName, System.TimeSpan withinInterval, string condition) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 772public WqlEventQuery(string eventClassName, System.TimeSpan withinInterval, string condition, System.TimeSpan groupWithinInterval, string[] groupByPropertyList, string havingCondition) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 776public System.TimeSpan GroupWithinInterval { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } } 780public System.TimeSpan WithinInterval { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } }
System.Net.Http (118)
src\libraries\Common\src\System\Net\Http\HttpHandlerDefaults.cs (8)
17public static readonly TimeSpan DefaultResponseDrainTimeout = TimeSpan.FromSeconds(2); 28public static readonly TimeSpan DefaultPooledConnectionLifetime = Timeout.InfiniteTimeSpan; 29public static readonly TimeSpan DefaultPooledConnectionIdleTimeout = TimeSpan.FromMinutes(1); 30public static readonly TimeSpan DefaultExpect100ContinueTimeout = TimeSpan.FromSeconds(1); 31public static readonly TimeSpan DefaultConnectTimeout = Timeout.InfiniteTimeSpan;
System\Net\Http\Headers\AltSvcHeaderParser.cs (4)
15internal const long DefaultMaxAgeTicks = 24 * TimeSpan.TicksPerHour; 176TimeSpan maxAgeTimeSpan = TimeSpan.FromTicks(maxAge * TimeSpan.TicksPerSecond ?? DefaultMaxAgeTicks);
System\Net\Http\Headers\AltSvcHeaderValue.cs (5)
18public static AltSvcHeaderValue Clear { get; } = new AltSvcHeaderValue(ClearString, host: null, port: 0, maxAge: TimeSpan.Zero, persist: false); 20public AltSvcHeaderValue(string alpnProtocolName, string? host, int port, TimeSpan maxAge, bool persist) 44public TimeSpan MaxAge { get; } 72if (MaxAge != TimeSpan.FromTicks(AltSvcHeaderParser.DefaultMaxAgeTicks)) 75sb.AppendSpanFormattable(MaxAge.Ticks / TimeSpan.TicksPerSecond, provider: CultureInfo.InvariantCulture);
System\Net\Http\Headers\CacheControlHeaderValue.cs (11)
52private TimeSpan _maxAge; 53private TimeSpan _sharedMaxAge; 54private TimeSpan _maxStaleLimit; 55private TimeSpan _minFresh; 59private void SetTimeSpan(ref TimeSpan fieldRef, Flags flag, TimeSpan? value) 95public TimeSpan? MaxAge 101public TimeSpan? SharedMaxAge 113public TimeSpan? MaxStaleLimit 119public TimeSpan? MinFresh 544private static bool TrySetTimeSpan(string? value, ref TimeSpan timeSpan)
System\Net\Http\Headers\HeaderUtilities.cs (2)
290internal static TimeSpan? GetTimeSpanValue(HeaderDescriptor descriptor, HttpHeaders store) 297return (TimeSpan)storedValue;
System\Net\Http\Headers\HttpResponseHeaders.cs (1)
35public TimeSpan? Age
System\Net\Http\Headers\RetryConditionHeaderValue.cs (3)
16private readonly TimeSpan _delta; 20public TimeSpan? Delta => _delta.Ticks == DeltaNotSetTicksSentinel ? null : _delta; 28public RetryConditionHeaderValue(TimeSpan delta)
System\Net\Http\Headers\TimeSpanHeaderParser.cs (2)
20Debug.Assert(value is TimeSpan); 22return ((int)((TimeSpan)value).TotalSeconds).ToString(NumberFormatInfo.InvariantInfo);
System\Net\Http\HttpClient.cs (8)
19private static readonly TimeSpan s_defaultTimeout = TimeSpan.FromSeconds(100); 20private static readonly TimeSpan s_maxTimeout = TimeSpan.FromMilliseconds(int.MaxValue); 21private static readonly TimeSpan s_infiniteTimeout = Threading.Timeout.InfiniteTimeSpan; 33private TimeSpan _timeout; 100public TimeSpan Timeout 107ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(value, TimeSpan.Zero);
System\Net\Http\HttpHandlerDefaults.cs (3)
15public static readonly TimeSpan DefaultKeepAlivePingTimeout = TimeSpan.FromSeconds(20); 16public static readonly TimeSpan DefaultKeepAlivePingDelay = Timeout.InfiniteTimeSpan;
System\Net\Http\HttpTelemetry.AnyOS.cs (3)
25public void RequestLeftQueue(int versionMajor, TimeSpan duration) 60DisplayRateTimeScale = TimeSpan.FromSeconds(1) 76DisplayRateTimeScale = TimeSpan.FromSeconds(1)
System\Net\Http\Metrics\HttpMetricsEnrichmentContext.cs (1)
104TimeSpan durationTime,
System\Net\Http\Metrics\MetricsHandler.cs (1)
129TimeSpan durationTime = Stopwatch.GetElapsedTime(startTimestamp, Stopwatch.GetTimestamp());
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (2)
502TimeSpan drainTime = _connection._pool.Settings._maxResponseDrainTime; 504if (drainTime == TimeSpan.Zero)
System\Net\Http\SocketsHttpHandler\ConnectHelper.cs (1)
115public static async ValueTask<QuicConnection> ConnectQuicAsync(HttpRequestMessage request, DnsEndPoint endPoint, TimeSpan idleTimeout, SslClientAuthenticationOptions clientAuthenticationOptions, Action<QuicConnection, QuicStreamCapacityChangedArgs> streamCapacityCallback, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (5)
873TimeSpan pooledConnectionLifetime = _poolManager.Settings._pooledConnectionLifetime; 884TimeSpan lifetime = _poolManager.Settings._pooledConnectionLifetime; 887return lifetime == TimeSpan.Zero || connection.GetLifetimeTicks(Environment.TickCount64) > lifetime.TotalMilliseconds; 963TimeSpan pooledConnectionLifetime = _poolManager.Settings._pooledConnectionLifetime; 964TimeSpan pooledConnectionIdleTimeout = _poolManager.Settings._pooledConnectionIdleTimeout;
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (2)
425private static void ScavengeHttp11ConnectionStack(HttpConnectionPool pool, ConcurrentStack<HttpConnection> connections, ref List<HttpConnectionBase>? toDispose, long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (2)
584private static int ScavengeHttp2ConnectionList(List<Http2Connection> list, ref List<HttpConnectionBase>? toDispose, long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (9)
560private static int ScavengeHttp3ConnectionList(List<Http3Connection> list, ref List<HttpConnectionBase>? toDispose, long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout) 648internal void HandleAltSvc(IEnumerable<string> altSvcHeaderValues, TimeSpan? responseAge) 651TimeSpan nextAuthorityMaxAge = default; 691TimeSpan authorityMaxAge = value.MaxAge; 699if (authorityMaxAge <= TimeSpan.Zero) 716if (nextAuthorityMaxAge.Ticks > (30 * TimeSpan.TicksPerDay)) 718nextAuthorityMaxAge = TimeSpan.FromTicks(30 * TimeSpan.TicksPerDay);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionWaiter.cs (1)
51TimeSpan duration = Stopwatch.GetElapsedTime(startingTimestamp);
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (2)
214TimeSpan drainTime = _connection._pool.Settings._maxResponseDrainTime; 216if (drainTime == TimeSpan.Zero)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (1)
175static long TimeSpanToMs(TimeSpan value)
System\Net\Http\SocketsHttpHandler\Http2StreamWindowManager.cs (5)
98TimeSpan rtt = connection._rttEstimator.MinRtt; 99if (rtt > TimeSpan.Zero && _streamWindowSize < MaxStreamWindowSize) 101TimeSpan dt = Stopwatch.GetElapsedTime(_lastWindowUpdate, currentTime); 179public TimeSpan MinRtt => new TimeSpan(_minRtt); 272TimeSpan currentRtt = Stopwatch.GetElapsedTime(_pingSentTimestamp);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (1)
981TimeSpan duration = Stopwatch.GetElapsedTime(_startTimestamp);
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (4)
224public bool IsUsable(long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout) 232if (NetEventSource.Log.IsEnabled()) Trace($"Scavenging connection. Idle {TimeSpan.FromMilliseconds(idleTicks)} > {pooledConnectionIdleTimeout}."); 243if (NetEventSource.Log.IsEnabled()) Trace($"Scavenging connection. Lifetime {TimeSpan.FromMilliseconds(lifetimeTicks)} > {pooledConnectionLifetime}.");
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (7)
35private readonly TimeSpan _cleanPoolTimeout; 76(settings._pooledConnectionIdleTimeout == TimeSpan.Zero || 77settings._pooledConnectionLifetime == TimeSpan.Zero) && 87_cleanPoolTimeout = TimeSpan.FromSeconds(DefaultScavengeSeconds); 93TimeSpan timerPeriod = settings._pooledConnectionIdleTimeout / ScavengesPerIdle; 94_cleanPoolTimeout = timerPeriod.TotalSeconds >= MinScavengeSeconds ? timerPeriod : TimeSpan.FromSeconds(MinScavengeSeconds); 466private void SetCleaningTimer(TimeSpan timeout)
System\Net\Http\SocketsHttpHandler\HttpConnectionSettings.cs (7)
40internal TimeSpan _maxResponseDrainTime = HttpHandlerDefaults.DefaultResponseDrainTimeout; 45internal TimeSpan _pooledConnectionLifetime = HttpHandlerDefaults.DefaultPooledConnectionLifetime; 46internal TimeSpan _pooledConnectionIdleTimeout = HttpHandlerDefaults.DefaultPooledConnectionIdleTimeout; 47internal TimeSpan _expect100ContinueTimeout = HttpHandlerDefaults.DefaultExpect100ContinueTimeout; 48internal TimeSpan _keepAlivePingTimeout = HttpHandlerDefaults.DefaultKeepAlivePingTimeout; 49internal TimeSpan _keepAlivePingDelay = HttpHandlerDefaults.DefaultKeepAlivePingDelay; 51internal TimeSpan _connectTimeout = HttpHandlerDefaults.DefaultConnectTimeout;
System\Net\Http\SocketsHttpHandler\Metrics\SocketsHttpHandlerMetrics.cs (1)
32public void RequestLeftQueue(HttpRequestMessage request, HttpConnectionPool pool, TimeSpan duration, int versionMajor)
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (16)
174public TimeSpan ResponseDrainTimeout 179if ((value < TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) || 213public TimeSpan PooledConnectionLifetime 218if (value < TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) 228public TimeSpan PooledConnectionIdleTimeout 233if (value < TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) 243public TimeSpan ConnectTimeout 248if ((value <= TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) || 259public TimeSpan Expect100ContinueTimeout 264if ((value < TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) || 311public TimeSpan KeepAlivePingDelay 316if (value.Ticks < TimeSpan.TicksPerSecond && value != Timeout.InfiniteTimeSpan) 318throw new ArgumentOutOfRangeException(nameof(value), value, SR.Format(SR.net_http_value_must_be_greater_than_or_equal, value, TimeSpan.FromSeconds(1))); 336public TimeSpan KeepAlivePingTimeout 341if (value.Ticks < TimeSpan.TicksPerSecond && value != Timeout.InfiniteTimeSpan) 343throw new ArgumentOutOfRangeException(nameof(value), value, SR.Format(SR.net_http_value_must_be_greater_than_or_equal, value, TimeSpan.FromSeconds(1)));
System.Net.Http.Json (1)
System\Net\Http\Json\HttpClientJsonExtensions.cs (1)
43TimeSpan timeout = client.Timeout;
System.Net.Http.WinHttpHandler (5)
artifacts\obj\System.Net.Http.WinHttpHandler\Debug\net10.0\System.Net.Http.WinHttpHandler.notsupported.cs (5)
41public System.TimeSpan ReceiveDataTimeout { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_WinHttpHandler); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_WinHttpHandler); } } 42public System.TimeSpan ReceiveHeadersTimeout { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_WinHttpHandler); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_WinHttpHandler); } } 43public System.TimeSpan SendTimeout { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_WinHttpHandler); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_WinHttpHandler); } } 48public System.TimeSpan TcpKeepAliveTime { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_WinHttpHandler); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_WinHttpHandler); } } 49public System.TimeSpan TcpKeepAliveInterval { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_WinHttpHandler); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_WinHttpHandler); } }
System.Net.HttpListener (18)
System\Net\HttpListenerContext.cs (1)
30public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync(string? subProtocol, TimeSpan keepAliveInterval)
System\Net\Managed\HttpListenerContext.Managed.cs (2)
89public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync(string? subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval) 94public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync(string? subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval, ArraySegment<byte> internalBuffer)
System\Net\Managed\HttpListenerTimeoutManager.Managed.cs (13)
10private TimeSpan _drainEntityBody = TimeSpan.Zero; 11private TimeSpan _idleConnection = TimeSpan.Zero; 15public TimeSpan DrainEntityBody 27public TimeSpan IdleConnection 39public TimeSpan EntityBody 41get => TimeSpan.Zero; 50public TimeSpan HeaderWait 52get => TimeSpan.Zero; 73public TimeSpan RequestQueue 75get => TimeSpan.Zero; 84private static void ValidateTimeout(TimeSpan value)
System\Net\Managed\WebSockets\HttpWebSocket.Managed.cs (1)
16TimeSpan keepAliveInterval)
System\Net\WebSockets\HttpWebSocket.cs (1)
79internal static void ValidateOptions(string? subProtocol, int receiveBufferSize, int sendBufferSize, TimeSpan keepAliveInterval)
System.Net.Mail (15)
System\Net\Mime\SmtpDateTime.cs (15)
62internal static readonly Dictionary<string, TimeSpan> s_timeZoneOffsetLookup = new Dictionary<string, TimeSpan>() 65{ "UT", TimeSpan.Zero }, // +0000 66{ "GMT", TimeSpan.Zero }, // +0000 79internal const long TimeSpanMaxTicks = TimeSpan.TicksPerHour * 99 + TimeSpan.TicksPerMinute * 59; 89private readonly TimeSpan _timeZone; 107TimeSpan localTimeZone = TimeZoneInfo.Local.GetUtcOffset(value); 116_timeZone = TimeSpan.Zero; 162TimeSpan timeZone = _timeZone; 294internal static bool TryParseTimeZoneString(string timeZoneString, out TimeSpan timeZone) 300timeZone = TimeSpan.Zero; 337internal static TimeSpan ValidateAndGetSanitizedTimeSpan(TimeSpan span) 340TimeSpan sanitizedTimeSpan = new TimeSpan(span.Days, span.Hours, span.Minutes, 0, 0);
System.Net.NameResolution (3)
System\Net\NameResolutionMetrics.cs (1)
29public static void AfterResolution(TimeSpan duration, string hostName, Exception? exception)
System\Net\NameResolutionTelemetry.cs (2)
96if (!activity.Stop(answer, exception, out TimeSpan duration)) 187public bool Stop(object? answer, Exception? exception, out TimeSpan duration)
System.Net.Ping (5)
System\Net\NetworkInformation\Ping.cs (5)
447public PingReply Send(IPAddress address, TimeSpan timeout, byte[]? buffer = null, PingOptions? options = null) => 479public PingReply Send(string hostNameOrAddress, TimeSpan timeout, byte[]? buffer = null, 583public Task<PingReply> SendPingAsync(IPAddress address, TimeSpan timeout, byte[]? buffer = null, PingOptions? options = null, CancellationToken cancellationToken = default) 626public Task<PingReply> SendPingAsync(string hostNameOrAddress, TimeSpan timeout, byte[]? buffer = null, PingOptions? options = null, CancellationToken cancellationToken = default) 655private static int ToTimeoutMilliseconds(TimeSpan timeout)
System.Net.Quic (22)
System\Net\Quic\Internal\MsQuicConfiguration.cs (3)
147if (options.IdleTimeout != TimeSpan.Zero) 155if (options.KeepAliveInterval != TimeSpan.Zero) 175if (options.HandshakeTimeout != TimeSpan.Zero)
System\Net\Quic\Internal\ThrowHelper.cs (2)
203public static void ValidateTimeSpan(string argumentName, TimeSpan value, [CallerArgumentExpression(nameof(value))] string? propertyName = null) 205if (value < TimeSpan.Zero && value != Timeout.InfiniteTimeSpan)
System\Net\Quic\QuicConnection.cs (1)
79if (options.HandshakeTimeout != Timeout.InfiniteTimeSpan && options.HandshakeTimeout != TimeSpan.Zero)
System\Net\Quic\QuicConnectionOptions.cs (7)
93/// Default <see cref="TimeSpan.Zero"/> means underlying implementation default idle timeout. 95public TimeSpan IdleTimeout { get; set; } = TimeSpan.Zero; 129/// Value <see cref="TimeSpan.Zero"/> means underlying implementation default timeout. 132public TimeSpan KeepAliveInterval { get; set; } = Timeout.InfiniteTimeSpan; 137/// Value <see cref="TimeSpan.Zero"/> means underlying implementation default timeout. 140public TimeSpan HandshakeTimeout { get; set; } = QuicDefaults.HandshakeTimeout;
System\Net\Quic\QuicDefaults.cs (2)
39public static readonly TimeSpan HandshakeTimeout = TimeSpan.FromSeconds(10);
System\Net\Quic\QuicListener.cs (1)
229TimeSpan handshakeTimeout = QuicDefaults.HandshakeTimeout;
System\Net\Quic\QuicStream.Stream.cs (6)
45private TimeSpan _readTimeout = Timeout.InfiniteTimeSpan; 46private TimeSpan _writeTimeout = Timeout.InfiniteTimeSpan; 63_readTimeout = TimeSpan.FromMilliseconds(value); 82_writeTimeout = TimeSpan.FromMilliseconds(value); 122if (_readTimeout > TimeSpan.Zero) 181if (_writeTimeout > TimeSpan.Zero)
System.Net.Requests (35)
src\libraries\Common\src\System\Net\Http\HttpHandlerDefaults.cs (8)
17public static readonly TimeSpan DefaultResponseDrainTimeout = TimeSpan.FromSeconds(2); 28public static readonly TimeSpan DefaultPooledConnectionLifetime = Timeout.InfiniteTimeSpan; 29public static readonly TimeSpan DefaultPooledConnectionIdleTimeout = TimeSpan.FromMinutes(1); 30public static readonly TimeSpan DefaultExpect100ContinueTimeout = TimeSpan.FromSeconds(1); 31public static readonly TimeSpan DefaultConnectTimeout = Timeout.InfiniteTimeSpan;
System\Net\Cache\HttpRequestCachePolicy.cs (17)
11private readonly TimeSpan _maxAge = TimeSpan.MaxValue; 12private readonly TimeSpan _minFresh = TimeSpan.MinValue; 13private readonly TimeSpan _maxStale = TimeSpan.MinValue; 24public HttpRequestCachePolicy(HttpCacheAgeControl cacheAgeControl, TimeSpan ageOrFreshOrStale) : this(HttpRequestCacheLevel.Default) 42public HttpRequestCachePolicy(HttpCacheAgeControl cacheAgeControl, TimeSpan maxAge, TimeSpan freshOrStale) : this(HttpRequestCacheLevel.Default) 74public HttpRequestCachePolicy(HttpCacheAgeControl cacheAgeControl, TimeSpan maxAge, TimeSpan freshOrStale, DateTime cacheSyncDate) : 87public TimeSpan MaxAge => _maxAge; 89public TimeSpan MinFresh => _minFresh; 91public TimeSpan MaxStale => _maxStale; 96(_maxAge == TimeSpan.MaxValue ? string.Empty : " MaxAge:" + _maxAge.ToString()) + 97(_minFresh == TimeSpan.MinValue ? string.Empty : " MinFresh:" + _minFresh.ToString()) + 98(_maxStale == TimeSpan.MinValue ? string.Empty : " MaxStale:" + _maxStale.ToString()) +
System\Net\HttpWebRequest.cs (10)
119public readonly TimeSpan Timeout; 128public readonly TimeSpan ContinueTimeout; 142: TimeSpan.FromMilliseconds(webRequest.Timeout); 151ContinueTimeout = TimeSpan.FromMilliseconds(webRequest.ContinueTimeout); 1350if (httpRequestCachePolicy.MinFresh > TimeSpan.Zero) 1355if (httpRequestCachePolicy.MaxAge != TimeSpan.MaxValue) 1360if (httpRequestCachePolicy.MaxStale > TimeSpan.Zero) 1370MaxAge = TimeSpan.Zero 1731handler.PooledConnectionIdleTimeout = TimeSpan.FromMilliseconds(servicePoint.MaxIdleTime); 1732handler.PooledConnectionLifetime = TimeSpan.FromMilliseconds(servicePoint.ConnectionLeaseTimeout);
System.Net.Security (15)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (7)
29internal static byte[]? DownloadAsset(string uri, TimeSpan downloadTimeout) 36internal static Task<byte[]?> DownloadAssetAsync(string uri, TimeSpan downloadTimeout) 41private static async Task<byte[]?> DownloadAssetCore(string uri, TimeSpan downloadTimeout, bool async) 50if (downloadTimeout <= TimeSpan.Zero) 98private static extern TimeSpan GetPooledConnectionIdleTimeout([UnsafeAccessorType(SocketsHttpHandlerTypeName)] object handler); 106private static extern void SetPooledConnectionIdleTimeout([UnsafeAccessorType(SocketsHttpHandlerTypeName)] object handler, TimeSpan value); 177SetPooledConnectionIdleTimeout(socketsHttpHandler, TimeSpan.FromSeconds(PooledConnectionIdleTimeoutSeconds));
System\Net\Security\NetSecurityTelemetry.cs (1)
56DisplayRateTimeScale = TimeSpan.FromSeconds(1)
System\Net\Security\SslStreamCertificateContext.Linux.cs (7)
22internal static TimeSpan DefaultOcspRefreshInterval => TimeSpan.FromHours(24); 23internal static TimeSpan MinRefreshBeforeExpirationInterval => TimeSpan.FromMinutes(5); 24internal static TimeSpan RefreshAfterFailureBackOffInterval => TimeSpan.FromSeconds(5); 320ret = await System.Net.Http.X509ResourceClient.DownloadAssetAsync(url, TimeSpan.MaxValue).ConfigureAwait(false);
System.Net.ServerSentEvents (12)
System\Net\ServerSentEvents\SseFormatter.cs (2)
99TimeSpan? reconnectionInterval) 126Debug.Assert(retry >= TimeSpan.Zero);
System\Net\ServerSentEvents\SseItem.cs (3)
15private readonly TimeSpan? _reconnectionInterval; 58public TimeSpan? ReconnectionInterval 63if (value < TimeSpan.Zero)
System\Net\ServerSentEvents\SseParser_1.cs (7)
31/// <summary>The maximum number of milliseconds representible by <see cref="System.TimeSpan"/>.</summary> 32private readonly long TimeSpan_MaxValueMilliseconds = (long)TimeSpan.MaxValue.TotalMilliseconds; 83private TimeSpan? _nextReconnectionInterval; 433TimeSpan timeSpan = milliseconds == TimeSpan_MaxValueMilliseconds ? TimeSpan.MaxValue : TimeSpan.FromMilliseconds(milliseconds); 460public TimeSpan ReconnectionInterval { get; private set; } = Timeout.InfiniteTimeSpan;
System.Net.Sockets (6)
System\Net\Sockets\NetworkStream.cs (2)
376public void Close(TimeSpan timeout) => Close(ToTimeoutMilliseconds(timeout)); 378private static int ToTimeoutMilliseconds(TimeSpan timeout)
System\Net\Sockets\Socket.cs (4)
2376public bool Poll(TimeSpan timeout, SelectMode mode) => 2431public static void Select(IList? checkRead, IList? checkWrite, IList? checkError, TimeSpan timeout) => 2434private static int ToTimeoutMicroseconds(TimeSpan timeout) 2441ArgumentOutOfRangeException.ThrowIfLessThan(timeout, TimeSpan.Zero);
System.Net.WebSockets (34)
src\libraries\Common\src\System\Net\WebSockets\WebSocketDefaults.cs (5)
14public static readonly TimeSpan DefaultKeepAliveInterval = TimeSpan.Zero; 15public static readonly TimeSpan DefaultClientKeepAliveInterval = TimeSpan.FromSeconds(30); 17public static readonly TimeSpan DefaultKeepAliveTimeout = Timeout.InfiniteTimeSpan;
System\Net\WebSockets\ManagedWebSocket.cs (7)
140internal ManagedWebSocket(Stream stream, bool isServer, string? subprotocol, TimeSpan keepAliveInterval, TimeSpan keepAliveTimeout) 146Debug.Assert(keepAliveInterval == Timeout.InfiniteTimeSpan || keepAliveInterval >= TimeSpan.Zero, $"Invalid {nameof(keepAliveInterval)}: {keepAliveInterval}"); 147Debug.Assert(keepAliveTimeout == Timeout.InfiniteTimeSpan || keepAliveTimeout >= TimeSpan.Zero, $"Invalid {nameof(keepAliveTimeout)}: {keepAliveTimeout}"); 169if (keepAliveInterval > TimeSpan.Zero) 172if (keepAliveTimeout > TimeSpan.Zero) 1148await task.WaitAsync(TimeSpan.FromMilliseconds(WaitForCloseTimeoutMs)).ConfigureAwait(false);
System\Net\WebSockets\ManagedWebSocket.KeepAlive.cs (3)
143public KeepAlivePingState(TimeSpan keepAliveInterval, TimeSpan keepAliveTimeout, ManagedWebSocket parent) 151static int TimeSpanToMs(TimeSpan value) => (int)Math.Clamp((long)value.TotalMilliseconds, MinIntervalMs, int.MaxValue);
System\Net\WebSockets\WebSocket.cs (5)
84public static TimeSpan DefaultKeepAliveInterval 132public static WebSocket CreateFromStream(Stream stream, bool isServer, string? subProtocol, TimeSpan keepAliveInterval) 146if (keepAliveInterval != Timeout.InfiniteTimeSpan && keepAliveInterval < TimeSpan.Zero) 186TimeSpan keepAliveInterval, bool useZeroMaskingKey, ArraySegment<byte> internalBuffer) 200if (keepAliveInterval != Timeout.InfiniteTimeSpan && keepAliveInterval < TimeSpan.Zero)
System\Net\WebSockets\WebSocketCreationOptions.cs (9)
14private TimeSpan _keepAliveInterval = WebSocketDefaults.DefaultKeepAliveInterval; 15private TimeSpan _keepAliveTimeout = WebSocketDefaults.DefaultKeepAliveTimeout; 39/// The keep-alive interval to use, or <see cref="TimeSpan.Zero"/> or <see cref="Timeout.InfiniteTimeSpan"/> to disable keep-alives. 42/// The default is <see cref="TimeSpan.Zero"/>. 44public TimeSpan KeepAliveInterval 49if (value != Timeout.InfiniteTimeSpan && value < TimeSpan.Zero) 59/// The timeout to use when waiting for the peer's PONG in response to us sending a PING; or <see cref="TimeSpan.Zero"/> or 63public TimeSpan KeepAliveTimeout 68if (value != Timeout.InfiniteTimeSpan && value < TimeSpan.Zero)
System\Net\WebSockets\WebSocketStream.cs (5)
43closeTimeout: ownsWebSocket ? TimeSpan.FromSeconds(DefaultCloseTimeoutSeconds) : null); 51public static WebSocketStream Create(WebSocket webSocket, WebSocketMessageType writeMessageType, TimeSpan closeTimeout) 55if (closeTimeout < TimeSpan.Zero && closeTimeout != Timeout.InfiniteTimeSpan) 189private sealed class ReadWriteStream(WebSocket webSocket, WebSocketMessageType writeMessageType, TimeSpan? closeTimeout) : WebSocketStream(webSocket) 192private readonly TimeSpan? _closeTimeout = closeTimeout;
System.Net.WebSockets.Client (15)
src\libraries\Common\src\System\Net\WebSockets\WebSocketDefaults.cs (5)
14public static readonly TimeSpan DefaultKeepAliveInterval = TimeSpan.Zero; 15public static readonly TimeSpan DefaultClientKeepAliveInterval = TimeSpan.FromSeconds(30); 17public static readonly TimeSpan DefaultKeepAliveTimeout = Timeout.InfiniteTimeSpan;
System\Net\WebSockets\ClientWebSocketOptions.cs (8)
17private TimeSpan _keepAliveInterval = WebSocketDefaults.DefaultClientKeepAliveInterval; 18private TimeSpan _keepAliveTimeout = WebSocketDefaults.DefaultKeepAliveTimeout; 176/// The keep-alive interval to use, or <see cref="TimeSpan.Zero"/> or <see cref="Timeout.InfiniteTimeSpan"/> to disable keep-alives. 182public TimeSpan KeepAliveInterval 188if (value != Timeout.InfiniteTimeSpan && value < TimeSpan.Zero) 199/// The timeout to use when waiting for the peer's PONG in response to us sending a PING; or <see cref="TimeSpan.Zero"/> or 204public TimeSpan KeepAliveTimeout 210if (value != Timeout.InfiniteTimeSpan && value < TimeSpan.Zero)
System\Net\WebSockets\WebSocketHandle.Managed.cs (2)
264PooledConnectionLifetime = TimeSpan.Zero, 281handler.PooledConnectionLifetime = TimeSpan.Zero;
System.Private.CoreLib (798)
src\libraries\Common\src\System\Threading\ITimer.cs (5)
13/// <summary>Changes the start time and the interval between method invocations for a timer, using <see cref="TimeSpan"/> values to measure time intervals.</summary> 15/// A <see cref="TimeSpan"/> representing the amount of time to delay before invoking the callback method specified when the <see cref="ITimer"/> was constructed. 16/// Specify <see cref="Timeout.InfiniteTimeSpan"/> to prevent the timer from restarting. Specify <see cref="TimeSpan.Zero"/> to restart the timer immediately. 27bool Change(TimeSpan dueTime, TimeSpan period);
src\libraries\Common\src\System\TimeProvider.cs (14)
59TimeSpan offset = zoneInfo.GetUtcOffset(utcDateTime); 104/// <returns>A <see cref="TimeSpan"/> for the elapsed time between the starting and ending timestamps.</returns> 105public TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 117return new TimeSpan((long)((endingTimestamp - startingTimestamp) * ((double)TimeSpan.TicksPerSecond / timestampFrequency))); 124/// <returns>A <see cref="TimeSpan"/> for the elapsed time between the starting timestamp and the time of this call.</returns> 125public TimeSpan GetElapsedTime(long startingTimestamp) => GetElapsedTime(startingTimestamp, GetTimestamp()); 127/// <summary>Creates a new <see cref="ITimer"/> instance, using <see cref="TimeSpan"/> values to measure time intervals.</summary> 133/// <param name="dueTime">The amount of time to delay before <paramref name="callback"/> is invoked. Specify <see cref="Timeout.InfiniteTimeSpan"/> to prevent the timer from starting. Specify <see cref="TimeSpan.Zero"/> to start the timer immediately.</param> 160public virtual ITimer CreateTimer(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period) 185public SystemTimeProviderTimer(TimeSpan dueTime, TimeSpan period, TimerCallback callback, object? state) 211public bool Change(TimeSpan dueTime, TimeSpan period)
src\libraries\System.Private.CoreLib\src\System\AppDomain.Unix.cs (1)
8public TimeSpan MonitoringTotalProcessorTime
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (1)
116private static TimeSpan NullOffset => new TimeSpan(DateTimeFormat.NullOffset);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.TimeSpan.cs (1)
30public static bool TryFormat(TimeSpan value, Span<byte> destination, out int bytesWritten, StandardFormat format = default)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.Helpers.cs (3)
34long offsetTicks = (((long)offsetHours) * 3600 + ((long)offsetMinutes) * 60) * TimeSpan.TicksPerSecond; 151long ticks = totalDays * TimeSpan.TicksPerDay; 153ticks += totalSeconds * TimeSpan.TicksPerSecond;
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpan.BigG.cs (1)
8private static bool TryParseTimeSpanBigG(ReadOnlySpan<byte> source, out TimeSpan value, out int bytesConsumed)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpan.C.cs (1)
8private static bool TryParseTimeSpanC(ReadOnlySpan<byte> source, out TimeSpan value, out int bytesConsumed)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpan.cs (6)
30public static bool TryParse(ReadOnlySpan<byte> source, out TimeSpan value, out int bytesConsumed, char standardFormat = default) => 122private static bool TryCreateTimeSpan(bool isNegative, uint days, uint hours, uint minutes, uint seconds, uint fraction, out TimeSpan timeSpan) 124const long MaxMilliSeconds = long.MaxValue / TimeSpan.TicksPerMillisecond; 125const long MinMilliSeconds = long.MinValue / TimeSpan.TicksPerMillisecond; 147long ticksWithoutFraction = millisecondsWithoutFraction * TimeSpan.TicksPerMillisecond; 164long ticksWithoutFraction = millisecondsWithoutFraction * TimeSpan.TicksPerMillisecond;
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpan.LittleG.cs (1)
8private static bool TryParseTimeSpanLittleG(ReadOnlySpan<byte> source, out TimeSpan value, out int bytesConsumed)
src\libraries\System.Private.CoreLib\src\System\ComponentModel\DefaultValueAttribute.cs (2)
63else if (type == typeof(TimeSpan) && value != null) 65_value = TimeSpan.Parse(value);
src\libraries\System.Private.CoreLib\src\System\CurrentSystemTimeZone.cs (6)
39TimeSpan offset = new TimeSpan(m_ticksOffset); 128TimeSpan delta = TimeSpan.Zero; 134if (rule.DateStart.Year <= year && rule.DateEnd.Year >= year && rule.DaylightDelta != TimeSpan.Zero) 147public override TimeSpan GetUtcOffset(DateTime time) 151return TimeSpan.Zero;
src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (3)
32private static uint DayNumberFromDateTime(DateTime dt) => (uint)((ulong)dt.Ticks / TimeSpan.TicksPerDay); 34internal DateTime GetEquivalentDateTime() => DateTime.CreateUnchecked(_dayNumber * TimeSpan.TicksPerDay); 217public DateTime ToDateTime(TimeOnly time) => DateTime.CreateUnchecked(_dayNumber * TimeSpan.TicksPerDay + time.Ticks);
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (77)
78internal const long MaxTicks = DaysTo10000 * TimeSpan.TicksPerDay - 1; 79private const long MaxMicroseconds = MaxTicks / TimeSpan.TicksPerMicrosecond; 80private const long MaxMillis = MaxTicks / TimeSpan.TicksPerMillisecond; 81private const long MaxSeconds = MaxTicks / TimeSpan.TicksPerSecond; 82private const long MaxMinutes = MaxTicks / TimeSpan.TicksPerMinute; 83private const long MaxHours = MaxTicks / TimeSpan.TicksPerHour; 86internal const long UnixEpochTicks = DaysTo1970 * TimeSpan.TicksPerDay; 87private const long FileTimeOffset = DaysTo1601 * TimeSpan.TicksPerDay; 88private const long DoubleDateOffset = DaysTo1899 * TimeSpan.TicksPerDay; 91private const long OADateMinAsTicks = (DaysPer100Years - DaysPerYear) * TimeSpan.TicksPerDay; 105private const ulong TicksPer6Hours = TimeSpan.TicksPerHour * 6; 176_dateData = (ulong)(date.DayNumber * TimeSpan.TicksPerDay + time.Ticks); 195_dateData = (ulong)(date.DayNumber * TimeSpan.TicksPerDay + time.Ticks) | ((ulong)(uint)kind << KindShift); 207internal static void ThrowMillisecondOutOfRange() => throw new ArgumentOutOfRangeException("millisecond", SR.Format(SR.ArgumentOutOfRange_Range, 0, TimeSpan.MillisecondsPerSecond - 1)); 208internal static void ThrowMicrosecondOutOfRange() => throw new ArgumentOutOfRangeException("microsecond", SR.Format(SR.ArgumentOutOfRange_Range, 0, TimeSpan.MicrosecondsPerMillisecond - 1)); 290if ((uint)millisecond >= TimeSpan.MillisecondsPerSecond) ThrowMillisecondOutOfRange(); 425if ((uint)millisecond >= TimeSpan.MillisecondsPerSecond) ThrowMillisecondOutOfRange(); 426_dateData += (uint)millisecond * (uint)TimeSpan.TicksPerMillisecond; 485if ((uint)millisecond >= TimeSpan.MillisecondsPerSecond) ThrowMillisecondOutOfRange(); 486_dateData += (uint)millisecond * (uint)TimeSpan.TicksPerMillisecond; 679if ((uint)microsecond >= TimeSpan.MicrosecondsPerMillisecond) ThrowMicrosecondOutOfRange(); 680_dateData += (uint)microsecond * (uint)TimeSpan.TicksPerMicrosecond; 808if ((uint)microsecond >= TimeSpan.MicrosecondsPerMillisecond) ThrowMicrosecondOutOfRange(); 809_dateData += (uint)microsecond * (uint)TimeSpan.TicksPerMicrosecond; 860public DateTime Add(TimeSpan value) 888public DateTime AddDays(double value) => AddUnits(value, MaxDays, TimeSpan.TicksPerDay); 897public DateTime AddHours(double value) => AddUnits(value, MaxHours, TimeSpan.TicksPerHour); 906public DateTime AddMilliseconds(double value) => AddUnits(value, MaxMillis, TimeSpan.TicksPerMillisecond); 932public DateTime AddMicroseconds(double value) => AddUnits(value, MaxMicroseconds, TimeSpan.TicksPerMicrosecond); 941public DateTime AddMinutes(double value) => AddUnits(value, MaxMinutes, TimeSpan.TicksPerMinute); 976return new DateTime(n * (ulong)TimeSpan.TicksPerDay + date.UTicks % TimeSpan.TicksPerDay | date.InternalKind); 986public DateTime AddSeconds(double value) => AddUnits(value, MaxSeconds, TimeSpan.TicksPerSecond); 1043return new DateTime(n * (ulong)TimeSpan.TicksPerDay + date.UTicks % TimeSpan.TicksPerDay | date.InternalKind); 1097return n * (ulong)TimeSpan.TicksPerDay; 1119return (uint)totalSeconds * (ulong)TimeSpan.TicksPerSecond; 1126if ((uint)millisecond >= TimeSpan.MillisecondsPerSecond) ThrowMillisecondOutOfRange(); 1128ticks += (uint)millisecond * (uint)TimeSpan.TicksPerMillisecond; 1139if ((uint)microsecond >= TimeSpan.MicrosecondsPerMillisecond) ThrowMicrosecondOutOfRange(); 1141ticks += (uint)microsecond * (uint)TimeSpan.TicksPerMicrosecond; 1167long millis = (long)(value * TimeSpan.MillisecondsPerDay + (value >= 0 ? 0.5 : -0.5)); 1173millis -= (millis % TimeSpan.MillisecondsPerDay) * 2; 1176millis += DoubleDateOffset / TimeSpan.TicksPerMillisecond; 1179return millis * TimeSpan.TicksPerMillisecond; 1216if (ticks > TicksCeiling - TimeSpan.TicksPerDay) 1240ticks += TimeSpan.TicksPerDay; 1327TimeSpan offset = TimeZoneInfo.GetLocalUtcOffset(this, TimeZoneInfoOptions.NoThrowOnInvalidTime); 1346public DateTime Date => new((UTicks / TimeSpan.TicksPerDay * TimeSpan.TicksPerDay) | InternalKind); 1379ulong seconds = UTicks / TimeSpan.TicksPerSecond; 1390ulong milliseconds = UTicks / TimeSpan.TicksPerMillisecond; 1404ulong seconds = ticks / TimeSpan.TicksPerSecond; 1405tick = (int)(ticks - (seconds * TimeSpan.TicksPerSecond)); 1435public DayOfWeek DayOfWeek => (DayOfWeek)(((uint)(UTicks / TimeSpan.TicksPerDay) + 1) % 7); 1454public int Hour => (int)((uint)(UTicks / TimeSpan.TicksPerHour) % 24); 1472public int Millisecond => (int)((UTicks / TimeSpan.TicksPerMillisecond) % 1000); 1477public int Microsecond => (int)((UTicks / TimeSpan.TicksPerMicrosecond) % 1000); 1482public int Nanosecond => (int)(UTicks % TimeSpan.TicksPerMicrosecond) * 100; 1487public int Minute => (int)((UTicks / TimeSpan.TicksPerMinute) % 60); 1529public int Second => (int)((UTicks / TimeSpan.TicksPerSecond) % 60); 1540public TimeSpan TimeOfDay => new TimeSpan((long)(UTicks % TimeSpan.TicksPerDay)); 1650public TimeSpan Subtract(DateTime value) 1655public DateTime Subtract(TimeSpan value) 1667if (value < TimeSpan.TicksPerDay) // This is a fix for VB. They want the default day to be 1/1/0001 rather than 12/30/1899. 1673long millis = (value - DoubleDateOffset) / TimeSpan.TicksPerMillisecond; 1676long frac = millis % TimeSpan.MillisecondsPerDay; 1677if (frac != 0) millis -= (TimeSpan.MillisecondsPerDay + frac) * 2; 1679return (double)millis / TimeSpan.MillisecondsPerDay; 1855public static DateTime operator +(DateTime d, TimeSpan t) 1862public static DateTime operator -(DateTime d, TimeSpan t) 1869public static TimeSpan operator -(DateTime d1, DateTime d2) => new TimeSpan(d1.Ticks - d2.Ticks); 1989if ((uint)hour >= 24 || (uint)minute >= 60 || (uint)millisecond >= TimeSpan.MillisecondsPerSecond) 1999ulong ticks = (DaysToYear((uint)year) + days[month - 1] + (uint)day - 1) * (ulong)TimeSpan.TicksPerDay; 2003ticks += TimeToTicks(hour, minute, second) + (uint)millisecond * (uint)TimeSpan.TicksPerMillisecond; 2012ticks += TimeToTicks(hour, minute, 59) + 999 * TimeSpan.TicksPerMillisecond;
src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (65)
51internal const long MaxOffset = MaxOffsetMinutes * TimeSpan.TicksPerMinute; 54private const long UnixEpochSeconds = DateTime.UnixEpochTicks / TimeSpan.TicksPerSecond; // 62,135,596,800 55private const long UnixEpochMilliseconds = DateTime.UnixEpochTicks / TimeSpan.TicksPerMillisecond; // 62,135,596,800,000 57internal const long UnixMinSeconds = DateTime.MinTicks / TimeSpan.TicksPerSecond - UnixEpochSeconds; 58internal const long UnixMaxSeconds = DateTime.MaxTicks / TimeSpan.TicksPerSecond - UnixEpochSeconds; 75Debug.Assert((ulong)(validDateTime.Ticks + validOffsetMinutes * TimeSpan.TicksPerMinute) <= DateTime.MaxTicks); 81public DateTimeOffset(long ticks, TimeSpan offset) : this(ValidateOffset(offset), ValidateDate(new DateTime(ticks), offset)) 85private static DateTimeOffset CreateValidateOffset(DateTime dateTime, TimeSpan offset) => new DateTimeOffset(ValidateOffset(offset), ValidateDate(dateTime, offset)); 94TimeSpan offset = TimeZoneInfo.GetLocalUtcOffset(dateTime, TimeZoneInfoOptions.NoThrowOnInvalidTime); 108public DateTimeOffset(DateTime dateTime, TimeSpan offset) 134public DateTimeOffset(DateOnly date, TimeOnly time, TimeSpan offset) 141public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, TimeSpan offset) 156private static DateTime WithLeapSecond(int year, int month, int day, int hour, int minute, TimeSpan offset) 166public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, TimeSpan offset) 169if ((uint)millisecond >= TimeSpan.MillisecondsPerSecond) DateTime.ThrowMillisecondOutOfRange(); 170_dateTime = DateTime.CreateUnchecked(UtcTicks + (uint)millisecond * (uint)TimeSpan.TicksPerMillisecond); 175public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar, TimeSpan offset) 191private static DateTime WithLeapSecond(Calendar calendar, int year, int month, int day, int hour, int minute, int millisecond, TimeSpan offset) 219/// the <see cref="DateTimeOffset(int, int, int, int, int, int, int, int, Calendar, TimeSpan)"/> constructor. 251public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond, TimeSpan offset) 254if ((uint)microsecond >= TimeSpan.MicrosecondsPerMillisecond) DateTime.ThrowMicrosecondOutOfRange(); 255_dateTime = DateTime.CreateUnchecked(UtcTicks + (uint)microsecond * (uint)TimeSpan.TicksPerMicrosecond); 276/// the <see cref="DateTimeOffset(int, int, int, int, int, int, int, int, Calendar, TimeSpan)"/> constructor. 325public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond, Calendar calendar, TimeSpan offset) 328if ((uint)microsecond >= TimeSpan.MicrosecondsPerMillisecond) DateTime.ThrowMicrosecondOutOfRange(); 329_dateTime = DateTime.CreateUnchecked(UtcTicks + (uint)microsecond * (uint)TimeSpan.TicksPerMicrosecond); 342public DateTimeOffset ToOffset(TimeSpan offset) => CreateValidateOffset(_dateTime + offset, offset); 349private DateTime ClockDateTime => DateTime.CreateUnchecked(UtcTicks + _offsetMinutes * TimeSpan.TicksPerMinute); 414public TimeSpan Offset => new TimeSpan(_offsetMinutes * TimeSpan.TicksPerMinute); 437public TimeSpan TimeOfDay => ClockDateTime.TimeOfDay; 447public DateTimeOffset Add(TimeSpan timeSpan) => Add(ClockDateTime.Add(timeSpan)); 593long ticks = seconds * TimeSpan.TicksPerSecond + DateTime.UnixEpochTicks; 599const long MinMilliseconds = DateTime.MinTicks / TimeSpan.TicksPerMillisecond - UnixEpochMilliseconds; 600const long MaxMilliseconds = DateTime.MaxTicks / TimeSpan.TicksPerMillisecond - UnixEpochMilliseconds; 607long ticks = milliseconds * TimeSpan.TicksPerMillisecond + DateTime.UnixEpochTicks; 657out TimeSpan offset); 676out TimeSpan offset); 683DateTime dateResult = DateTimeParse.Parse(input, DateTimeFormatInfo.GetInstance(formatProvider), styles, out TimeSpan offset); 708out TimeSpan offset); 715DateTime dateResult = DateTimeParse.ParseExact(input, format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out TimeSpan offset); 728out TimeSpan offset); 735DateTime dateResult = DateTimeParse.ParseExactMultiple(input, formats, DateTimeFormatInfo.GetInstance(formatProvider), styles, out TimeSpan offset); 739public TimeSpan Subtract(DateTimeOffset value) => new TimeSpan(UtcTicks - value.UtcTicks); 741public DateTimeOffset Subtract(TimeSpan value) => Add(ClockDateTime.Subtract(value)); 763long seconds = (long)((ulong)UtcTicks / TimeSpan.TicksPerSecond); 771long milliseconds = (long)((ulong)UtcTicks / TimeSpan.TicksPerMillisecond); 779TimeSpan offset = TimeZoneInfo.GetLocalUtcOffset(utcDateTime, TimeZoneInfoOptions.NoThrowOnInvalidTime); 819out TimeSpan offset); 826bool parsed = DateTimeParse.TryParse(input, DateTimeFormatInfo.CurrentInfo, DateTimeStyles.None, out DateTime dateResult, out TimeSpan offset); 844out TimeSpan offset); 852bool parsed = DateTimeParse.TryParse(input, DateTimeFormatInfo.GetInstance(formatProvider), styles, out DateTime dateResult, out TimeSpan offset); 872out TimeSpan offset); 881bool parsed = DateTimeParse.TryParseExact(input, format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out DateTime dateResult, out TimeSpan offset); 901out TimeSpan offset); 910bool parsed = DateTimeParse.TryParseExactMultiple(input, formats, DateTimeFormatInfo.GetInstance(formatProvider), styles, out DateTime dateResult, out TimeSpan offset); 916private static int ValidateOffset(TimeSpan offset) 918long minutes = offset.Ticks / TimeSpan.TicksPerMinute; 919if (offset.Ticks != minutes * TimeSpan.TicksPerMinute) 933private static DateTime ValidateDate(DateTime dateTime, TimeSpan offset) 979public static DateTimeOffset operator +(DateTimeOffset dateTimeOffset, TimeSpan timeSpan) => 982public static DateTimeOffset operator -(DateTimeOffset dateTimeOffset, TimeSpan timeSpan) => 985public static TimeSpan operator -(DateTimeOffset left, DateTimeOffset right) => 1011/// Deconstructs <see cref="DateTimeOffset"/> into <see cref="DateOnly"/>, <see cref="TimeOnly"/> and <see cref="TimeSpan"/>. 1023public void Deconstruct(out DateOnly date, out TimeOnly time, out TimeSpan offset)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\CodeAnalysis\StringSyntaxAttribute.cs (1)
65/// <summary>The syntax identifier for strings containing <see cref="TimeSpan"/> format specifiers.</summary>
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Stopwatch.cs (8)
18private static readonly double s_tickFrequency = (double)TimeSpan.TicksPerSecond / Frequency; 70/// Elapsed time string in the same format used by <see cref="TimeSpan.ToString()"/>. 76public TimeSpan Elapsed => new(ElapsedTimeSpanTicks); 78public long ElapsedMilliseconds => ElapsedTimeSpanTicks / TimeSpan.TicksPerMillisecond; 98/// <returns>A <see cref="TimeSpan"/> for the elapsed time between the starting timestamp and the time of this call.</returns> 99public static TimeSpan GetElapsedTime(long startingTimestamp) => 105/// <returns>A <see cref="TimeSpan"/> for the elapsed time between the starting and ending timestamps.</returns> 106public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) =>
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (4)
229TimeSpan elapsed; 262TimeSpan delta = now - _nextPollingTimeStamp; 263delta = _pollingIntervalInMilliseconds > delta.TotalMilliseconds ? TimeSpan.FromMilliseconds(_pollingIntervalInMilliseconds) : delta; 265_nextPollingTimeStamp += TimeSpan.FromMilliseconds(_pollingIntervalInMilliseconds * Math.Ceiling(delta.TotalMilliseconds / _pollingIntervalInMilliseconds));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\IncrementingEventCounter.cs (2)
45public TimeSpan DisplayRateTimeScale { get; set; } 62payload.DisplayRateTimeScale = (DisplayRateTimeScale == TimeSpan.Zero) ? "" : DisplayRateTimeScale.ToString("c");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\IncrementingPollingCounter.cs (2)
40public TimeSpan DisplayRateTimeScale { get; set; } 75payload.DisplayRateTimeScale = (DisplayRateTimeScale == TimeSpan.Zero) ? "" : DisplayRateTimeScale.ToString("c");
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (7)
59public TimeSpan AsTimeSpan; 100private PropertyValue(TimeSpan value) : this(new Scalar() { AsTimeSpan = value }, sizeof(TimeSpan)) { } 122if (type == typeof(TimeSpan)) return value => new PropertyValue((TimeSpan)value!); 247if (type == typeof(TimeSpan)) { var f = GetGetMethod<TimeSpan>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (1)
264public TimeSpanTypeInfo() : base(typeof(TimeSpan)) { }
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\Statics.cs (1)
560else if (dataType == typeof(TimeSpan))
src\libraries\System.Private.CoreLib\src\System\Environment.cs (3)
25public TimeSpan UserTime { get; internal init; } 30public TimeSpan PrivilegedTime { get; internal init; } 35public TimeSpan TotalTime => UserTime + PrivilegedTime;
src\libraries\System.Private.CoreLib\src\System\GC.cs (2)
16public static GCNotificationStatus WaitForFullGCApproach(TimeSpan timeout) 25public static GCNotificationStatus WaitForFullGCComplete(TimeSpan timeout)
src\libraries\System.Private.CoreLib\src\System\GCMemoryInfo.cs (4)
82private TimeSpan _pauseDuration0; 83private TimeSpan _pauseDuration1; 85internal ReadOnlySpan<TimeSpan> PauseDurationsAsSpan => MemoryMarshal.CreateReadOnlySpan(ref _pauseDuration0, 2); 191public ReadOnlySpan<TimeSpan> PauseDurations => _data.PauseDurationsAsSpan;
src\libraries\System.Private.CoreLib\src\System\Globalization\Calendar.cs (10)
31internal const long MaxMillis = (long)DateTime.DaysTo10000 * TimeSpan.MillisecondsPerDay; 134long ticks = time.Ticks + millis * TimeSpan.TicksPerMillisecond; 160return Add(time, days, (int)TimeSpan.MillisecondsPerDay); 172return Add(time, hours, (int)TimeSpan.MillisecondsPerHour); 184return Add(time, minutes, (int)TimeSpan.MillisecondsPerMinute); 216return Add(time, seconds, (int)TimeSpan.MillisecondsPerSecond); 673if ((uint)millisecond >= TimeSpan.MillisecondsPerSecond) 678SR.Format(SR.ArgumentOutOfRange_Range, 0, TimeSpan.MillisecondsPerSecond - 1)); 682return totalSeconds * TimeSpan.TicksPerSecond + millisecond * TimeSpan.TicksPerMillisecond;
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendricalCalculationsHelper.cs (6)
61return date.Ticks / TimeSpan.TicksPerDay; 66return new DateTime(Math.Min((long)(Math.Floor(numberOfDays) * TimeSpan.TicksPerDay), DateTime.MaxValue.Ticks)).Year; 150return ((Math.Pow(x, 2) / 41048480) - 15) / TimeSpan.SecondsPerDay; 156return (double)(gregorianYear - 1933) / TimeSpan.SecondsPerDay; 177return PolynomialSum(Coefficients1700to1799, yearsSince1700) / TimeSpan.SecondsPerDay; 184return PolynomialSum(Coefficients1620to1699, yearsSince1600) / TimeSpan.SecondsPerDay;
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (15)
429DateTime dateTime, scoped ReadOnlySpan<char> format, DateTimeFormatInfo dtfi, TimeSpan offset, ref ValueListBuilder<TChar> result) where TChar : unmanaged, IUtfChar<TChar> 487int fraction = (int)(dateTime.Ticks % TimeSpan.TicksPerSecond); 787private static unsafe void FormatCustomizedTimeZone<TChar>(DateTime dateTime, TimeSpan offset, int tokenLen, bool timeOnly, ref ValueListBuilder<TChar> result) where TChar : unmanaged, IUtfChar<TChar> 795if (timeOnly && dateTime.Ticks < TimeSpan.TicksPerDay) 852private static unsafe void FormatCustomizedRoundripTimeZone<TChar>(DateTime dateTime, TimeSpan offset, ref ValueListBuilder<TChar> result) where TChar : unmanaged, IUtfChar<TChar> 920internal static string Format(DateTime dateTime, string? format, IFormatProvider? provider, TimeSpan offset) 1032internal static bool TryFormat<TChar>(DateTime dateTime, Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider, TimeSpan offset) where TChar : unmanaged, IUtfChar<TChar> 1147dateTime.Ticks < TimeSpan.TicksPerDay && 1158private static void PrepareFormatU(ref DateTime dateTime, ref DateTimeFormatInfo dtfi, TimeSpan offset) 1442internal static unsafe bool TryFormatO<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1493int offsetTotalMinutes = (int)(offset.Ticks / TimeSpan.TicksPerMinute); 1557internal static unsafe bool TryFormatu<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1598internal static unsafe bool TryFormatR<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1663internal static unsafe bool TryFormatInvariantG<TChar>(DateTime value, TimeSpan offset, Span<TChar> destination, out int bytesWritten) where TChar : unmanaged, IUtfChar<TChar> 1699int offsetMinutes = (int)(offset.Ticks / TimeSpan.TicksPerMinute);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (30)
34internal static DateTime ParseExact(ReadOnlySpan<char> s, ReadOnlySpan<char> format, DateTimeFormatInfo dtfi, DateTimeStyles style, out TimeSpan offset) 65internal static bool TryParseExact(ReadOnlySpan<char> s, ReadOnlySpan<char> format, DateTimeFormatInfo dtfi, DateTimeStyles style, out DateTime result, out TimeSpan offset) 79offset = TimeSpan.Zero; 118DateTimeFormatInfo dtfi, DateTimeStyles style, out TimeSpan offset) 135DateTimeFormatInfo dtfi, DateTimeStyles style, out DateTime result, out TimeSpan offset) 149offset = TimeSpan.Zero; 495private static bool ParseTimeZone(ref __DTString str, scoped ref TimeSpan result) 2437internal static DateTime Parse(ReadOnlySpan<char> s, DateTimeFormatInfo dtfi, DateTimeStyles styles, out TimeSpan offset) 2468internal static bool TryParse(ReadOnlySpan<char> s, DateTimeFormatInfo dtfi, DateTimeStyles styles, out DateTime result, out TimeSpan offset) 2482offset = TimeSpan.Zero; 2697if (!time.TryAddTicks((long)Math.Round(raw.fraction * TimeSpan.TicksPerSecond), out time)) 2787result.timeZoneOffset = TimeSpan.Zero; 2821result.timeZoneOffset = TimeSpan.Zero; 2859result.timeZoneOffset = TimeSpan.Zero; 2866result.timeZoneOffset = TimeSpan.Zero; 2884resultTicks += TimeSpan.TicksPerDay; 2909if (resultTicks < TimeSpan.TicksPerDay) 2922resultTicks += TimeSpan.TicksPerDay; 3017result.timeZoneOffset = TimeSpan.Zero; 3058if (!time.TryAddTicks((long)Math.Round(partSecond * TimeSpan.TicksPerSecond), out time)) 3229private static bool ParseTimeZoneOffset(ref __DTString str, int len, scoped ref TimeSpan result) 4287TimeSpan tempTimeZoneOffset = new TimeSpan(0); 4303if ((result.flags & ParseFlags.TimeZoneUsed) != 0 && result.timeZoneOffset != TimeSpan.Zero) 4329if ((result.flags & ParseFlags.TimeZoneUsed) != 0 && result.timeZoneOffset != TimeSpan.Zero) 4342TimeSpan tempTimeZoneOffset = new TimeSpan(0); 4422result.timeZoneOffset = TimeSpan.Zero; 4486result.timeZoneOffset = TimeSpan.Zero; 4761if (!result.parsedDate.TryAddTicks((long)Math.Round(result.fraction * TimeSpan.TicksPerSecond), out result.parsedDate)) 5106if (!dateTime.TryAddTicks((long)Math.Round(fraction * TimeSpan.TicksPerSecond), out result.parsedDate)) 6104internal TimeSpan timeZoneOffset;
src\libraries\System.Private.CoreLib\src\System\Globalization\DaylightTime.cs (5)
11private readonly TimeSpan _delta; 13public DaylightTime(DateTime start, DateTime end, TimeSpan delta) 27public TimeSpan Delta => _delta; 33public DaylightTimeStruct(DateTime start, DateTime end, TimeSpan delta) 42public readonly TimeSpan Delta;
src\libraries\System.Private.CoreLib\src\System\Globalization\GregorianCalendar.cs (2)
116return GetAbsoluteDate(year, month, day) * TimeSpan.TicksPerDay; 167long ticks = DateToTicks(y, m, d) + time.Ticks % TimeSpan.TicksPerDay;
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewCalendar.cs (4)
569return new DateTime(ToDateTime(y, i, d, 0, 0, 0, 0).Ticks + (time.Ticks % TimeSpan.TicksPerDay)); 600long ticks = ToDateTime(y, m, d, 0, 0, 0, 0).Ticks + (time.Ticks % TimeSpan.TicksPerDay); 650return (int)((time.Ticks - beginOfYearDate.Ticks) / TimeSpan.TicksPerDay) + 1; 828return new DateTime(gregorianNewYear.Ticks + days * TimeSpan.TicksPerDay + TimeToTicks(hour, minute, second, millisecond));
src\libraries\System.Private.CoreLib\src\System\Globalization\HijriCalendar.cs (4)
201long numDays = ticks / TimeSpan.TicksPerDay + 1; 299long ticks = GetAbsoluteDateHijri(y, m, d) * TimeSpan.TicksPerDay + (time.Ticks % TimeSpan.TicksPerDay); 416return new DateTime(lDate * TimeSpan.TicksPerDay + TimeToTicks(hour, minute, second, millisecond));
src\libraries\System.Private.CoreLib\src\System\Globalization\ISOWeek.cs (1)
158return jan4.AddTicks((ordinal - 4) * TimeSpan.TicksPerDay);
src\libraries\System.Private.CoreLib\src\System\Globalization\JulianCalendar.cs (6)
118long julianTicks = ticks + TimeSpan.TicksPerDay * 2; 120int n = (int)(julianTicks / TimeSpan.TicksPerDay); 177return (n - 2) * TimeSpan.TicksPerDay; 212long ticks = DateToTicks(y, m, d) + time.Ticks % TimeSpan.TicksPerDay; 306if (millisecond < 0 || millisecond >= TimeSpan.MillisecondsPerSecond) 311SR.Format(SR.ArgumentOutOfRange_Range, 0, TimeSpan.MillisecondsPerSecond - 1));
src\libraries\System.Private.CoreLib\src\System\Globalization\PersianCalendar.cs (6)
24private static readonly long s_persianEpoch = new DateTime(622, 3, 22).Ticks / TimeSpan.TicksPerDay; 150long numDays = ticks / TimeSpan.TicksPerDay + 1; 200long numDays = ticks / TimeSpan.TicksPerDay + 1; 248long ticks = GetAbsoluteDatePersian(y, m, d) * TimeSpan.TicksPerDay + time.Ticks % TimeSpan.TicksPerDay; 387return new DateTime(lDate * TimeSpan.TicksPerDay + TimeToTicks(hour, minute, second, millisecond));
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (13)
19internal static string Format(TimeSpan value, string? format, IFormatProvider? formatProvider) 51internal static bool TryFormat<TChar>(TimeSpan value, Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? formatProvider) where TChar : unmanaged, IUtfChar<TChar> 84internal static string FormatC(TimeSpan value) 91private static string FormatG(TimeSpan value, DateTimeFormatInfo dtfi, StandardFormat format) 109internal static unsafe bool TryFormatStandard<TChar>(TimeSpan value, StandardFormat format, ReadOnlySpan<TChar> decimalSeparator, Span<TChar> destination, out int written) where TChar : unmanaged, IUtfChar<TChar> 137(totalSecondsRemaining, fraction64) = Math.DivRem((ulong)ticks, TimeSpan.TicksPerSecond); 297private static void FormatCustomized<TChar>(TimeSpan value, scoped ReadOnlySpan<char> format, DateTimeFormatInfo dtfi, ref ValueListBuilder<TChar> result) where TChar : unmanaged, IUtfChar<TChar> 301int day = (int)(value.Ticks / TimeSpan.TicksPerDay); 302long time = value.Ticks % TimeSpan.TicksPerDay; 309int hours = (int)(time / TimeSpan.TicksPerHour % 24); 310int minutes = (int)(time / TimeSpan.TicksPerMinute % 60); 311int seconds = (int)(time / TimeSpan.TicksPerSecond % 60); 312int fraction = (int)(time % TimeSpan.TicksPerSecond);
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (16)
495internal TimeSpan parsedTimeSpan; 607const long MaxMilliSeconds = long.MaxValue / TimeSpan.TicksPerMillisecond; 608const long MinMilliSeconds = long.MinValue / TimeSpan.TicksPerMillisecond; 617result = ticks * TimeSpan.TicksPerMillisecond + fraction._num; 627internal static TimeSpan Parse(ReadOnlySpan<char> input, IFormatProvider? formatProvider) 635internal static bool TryParse(ReadOnlySpan<char> input, IFormatProvider? formatProvider, out TimeSpan result) 649internal static TimeSpan ParseExact(ReadOnlySpan<char> input, ReadOnlySpan<char> format, IFormatProvider? formatProvider, TimeSpanStyles styles) 657internal static bool TryParseExact(ReadOnlySpan<char> input, ReadOnlySpan<char> format, IFormatProvider? formatProvider, TimeSpanStyles styles, out TimeSpan result) 671internal static TimeSpan ParseExactMultiple(ReadOnlySpan<char> input, string?[]? formats, IFormatProvider? formatProvider, TimeSpanStyles styles) 679internal static bool TryParseExactMultiple(ReadOnlySpan<char> input, string?[]? formats, IFormatProvider? formatProvider, TimeSpanStyles styles, out TimeSpan result) 1522if (!ParseInt((int)(0x7FFFFFFFFFFFFFFFL / TimeSpan.TicksPerDay), out int days, ref result)) 1527time = days * TimeSpan.TicksPerDay; 1610time = unit * TimeSpan.TicksPerHour; 1623time += unit * TimeSpan.TicksPerMinute; 1636time += unit * TimeSpan.TicksPerSecond; 1642int f = (int)TimeSpan.TicksPerSecond;
src\libraries\System.Private.CoreLib\src\System\Globalization\UmAlQuraCalendar.cs (5)
344int index = (int)((time.Ticks - s_minDate.Ticks) / TimeSpan.TicksPerDay) / 355; 354TimeSpan ts = time.Subtract(s_hijriYearInfo[index].GregorianDate); 447DateTime dt = new DateTime(GetAbsoluteDateUmAlQura(y, m, d) * TimeSpan.TicksPerDay + time.Ticks % TimeSpan.TicksPerDay); 594return new DateTime(lDate * TimeSpan.TicksPerDay + TimeToTicks(hour, minute, second, millisecond));
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (1)
585return (time.UtcDateTime.Ticks - DateTimeOffset.UnixEpoch.Ticks - seconds * TimeSpan.TicksPerSecond) * NanosecondsPerTick;
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (1)
598else if (type == typeof(TimeSpan))
src\libraries\System.Private.CoreLib\src\System\Runtime\JitInfo.cs (2)
17public static TimeSpan GetCompilationTime(bool currentThread = false) 20return TimeSpan.FromTicks(GetCompilationTimeInTicks(currentThread));
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (9)
144public CancellationTokenSource(TimeSpan delay) : this(delay, TimeProvider.System) 148/// <summary>Initializes a new instance of the <see cref="CancellationTokenSource"/> class that will be canceled after the specified <see cref="TimeSpan"/>.</summary> 151/// <exception cref="ArgumentOutOfRangeException"><paramref name="delay"/>'s <see cref="TimeSpan.TotalMilliseconds"/> is less than -1 or greater than <see cref="uint.MaxValue"/> - 1.</exception> 159public CancellationTokenSource(TimeSpan delay, TimeProvider timeProvider) 197InitializeWithTimer(TimeSpan.FromMilliseconds(millisecondsDelay), TimeProvider.System); 204private void InitializeWithTimer(TimeSpan millisecondsDelay, TimeProvider timeProvider) 206if (millisecondsDelay == TimeSpan.Zero) 377public void CancelAfter(TimeSpan delay) 458millisecondsDelay == Timeout.UnsignedInfinite ? Timeout.InfiniteTimeSpan : TimeSpan.FromMilliseconds(millisecondsDelay),
src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (2)
204/// of milliseconds by casting <see cref="TimeSpan.TotalMilliseconds"/> of the timeout to an integer value. A value 226public bool TryEnter(TimeSpan timeout) => TryEnter_Outlined(WaitHandle.ToTimeoutMilliseconds(timeout));
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (8)
386/// <see cref="TimeSpan"/> to measure the time interval. 388/// <param name="timeout">A <see cref="TimeSpan"/> that represents the number of milliseconds 389/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 402public bool Wait(TimeSpan timeout) 414/// <see cref="TimeSpan"/> to measure the time interval, while observing a <see 417/// <param name="timeout">A <see cref="TimeSpan"/> that represents the number of milliseconds 418/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 435public bool Wait(TimeSpan timeout, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\Threading\Monitor.cs (4)
10public static bool TryEnter(object obj, TimeSpan timeout) 13public static void TryEnter(object obj, TimeSpan timeout, ref bool lockTaken) 19public static bool Wait(object obj, TimeSpan timeout) => Wait(obj, WaitHandle.ToTimeoutMilliseconds(timeout)); 37public static bool Wait(object obj, TimeSpan timeout, bool exitContext)
src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (5)
25private TimeSpan _period; 30public PeriodicTimer(TimeSpan period) 49public PeriodicTimer(TimeSpan period, TimeProvider timeProvider) 87public TimeSpan Period 110private static bool TryGetMilliseconds(TimeSpan value, out uint milliseconds)
src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (4)
238public TimeoutTracker(TimeSpan timeout) 280public bool TryEnterReadLock(TimeSpan timeout) 426public bool TryEnterWriteLock(TimeSpan timeout) 633public bool TryEnterUpgradeableReadLock(TimeSpan timeout)
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (17)
206/// cref="TimeSpan"/> to measure the time interval. 208/// <param name="timeout">A <see cref="TimeSpan"/> that represents the number of milliseconds 209/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 216public bool Wait(TimeSpan timeout) 235/// cref="TimeSpan"/> to measure the time interval, while observing a <see 238/// <param name="timeout">A <see cref="TimeSpan"/> that represents the number of milliseconds 239/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 249public bool Wait(TimeSpan timeout, CancellationToken cancellationToken) 574/// cref="TimeSpan"/> to measure the time interval, while observing a 578/// A <see cref="TimeSpan"/> that represents the number of milliseconds 579/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 592public Task<bool> WaitAsync(TimeSpan timeout) 608/// cref="TimeSpan"/> to measure the time interval. 611/// A <see cref="TimeSpan"/> that represents the number of milliseconds 612/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 625public Task<bool> WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) 783TimeSpan.FromMilliseconds(millisecondsTimeout),
src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (3)
207/// <param name="timeout">A <see cref="TimeSpan"/> that represents the number of milliseconds 208/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 222public void TryEnter(TimeSpan timeout, ref bool lockTaken)
src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (2)
276/// A <see cref="TimeSpan"/> that represents the number of milliseconds to wait, 283public static bool SpinUntil(Func<bool> condition, TimeSpan timeout)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (4)
551public new Task<TResult> WaitAsync(TimeSpan timeout) => 560public new Task<TResult> WaitAsync(TimeSpan timeout, TimeProvider timeProvider) 570public new Task<TResult> WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) => 580public new Task<TResult> WaitAsync(TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (25)
2639/// A <see cref="TimeSpan"/> that represents the number of milliseconds to wait, or a <see 2640/// cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 2654public bool Wait(TimeSpan timeout) => Wait(timeout, default); 2678public bool Wait(TimeSpan timeout, CancellationToken cancellationToken) 2800public Task WaitAsync(TimeSpan timeout) => WaitAsync(ValidateTimeout(timeout, ExceptionArgument.timeout), TimeProvider.System, default); 2807public Task WaitAsync(TimeSpan timeout, TimeProvider timeProvider) 2817public Task WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) => 2826public Task WaitAsync(TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken) 2891_timer = timeProvider.CreateTimer(callback, this, TimeSpan.FromMilliseconds(millisecondsDelay), Timeout.InfiniteTimeSpan); 4751/// A <see cref="TimeSpan"/> that represents the number of milliseconds to wait, or a <see 4752/// cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 4771public static bool WaitAll(Task[] tasks, TimeSpan timeout) 5196/// A <see cref="TimeSpan"/> that represents the number of milliseconds to wait, or a <see 5197/// cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 5215public static int WaitAny(Task[] tasks, TimeSpan timeout) 5685public static Task Delay(TimeSpan delay) => Delay(delay, TimeProvider.System, default); 5688/// <param name="delay">The <see cref="TimeSpan"/> to wait before completing the returned task, or <see cref="Timeout.InfiniteTimeSpan"/> to wait indefinitely.</param> 5692/// <exception cref="ArgumentOutOfRangeException"><paramref name="delay"/>'s <see cref="TimeSpan.TotalMilliseconds"/> property is greater than 4294967294.</exception> 5694public static Task Delay(TimeSpan delay, TimeProvider timeProvider) => Delay(delay, timeProvider, default); 5714public static Task Delay(TimeSpan delay, CancellationToken cancellationToken) => 5718/// <param name="delay">The <see cref="TimeSpan"/> to wait before completing the returned task, or <see cref="Timeout.InfiniteTimeSpan"/> to wait indefinitely.</param> 5723/// <exception cref="ArgumentOutOfRangeException"><paramref name="delay"/>'s <see cref="TimeSpan.TotalMilliseconds"/> property is greater than 4294967294.</exception> 5725public static Task Delay(TimeSpan delay, TimeProvider timeProvider, CancellationToken cancellationToken) 5779internal static uint ValidateTimeout(TimeSpan timeout, ExceptionArgument argument) 5816_timer = timeProvider.CreateTimer(s_timerCallback, this, TimeSpan.FromMilliseconds(millisecondsDelay), Timeout.InfiniteTimeSpan);
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (2)
569public bool Join(TimeSpan timeout) => Join(WaitHandle.ToTimeoutMilliseconds(timeout)); 571public static void Sleep(TimeSpan timeout) => Sleep(WaitHandle.ToTimeoutMilliseconds(timeout));
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (2)
1794TimeSpan timeout, 1816TimeSpan timeout,
src\libraries\System.Private.CoreLib\src\System\Threading\Timeout.cs (1)
11public static readonly TimeSpan InfiniteTimeSpan = new TimeSpan(0, 0, 0, 0, Infinite);
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (16)
491internal TimerQueueTimer(TimerCallback timerCallback, object? state, TimeSpan dueTime, TimeSpan period, bool flowExecutionContext) : 496private static uint GetMilliseconds(TimeSpan time, [CallerArgumentExpression(nameof(time))] string? parameter = null) 533"DueTime = " + (_dueTime == Timeout.UnsignedInfinite ? "(not set)" : TimeSpan.FromMilliseconds(_dueTime)) + ", " + 534"Period = " + (_period == Timeout.UnsignedInfinite ? "(not set)" : TimeSpan.FromMilliseconds(_period)) + ", " + 539public bool Change(TimeSpan dueTime, TimeSpan period) => 763return (TimerQueue.s_tickCountToTimeMap.Time + TimeSpan.FromMilliseconds(msOffset)); 770public TimeSpan? DueTime => _timer._dueTime == Timeout.UnsignedInfinite ? null : TimeSpan.FromMilliseconds(_timer._dueTime); 772public TimeSpan? Period => _timer._period == Timeout.UnsignedInfinite ? null : TimeSpan.FromMilliseconds(_timer._period); 853TimeSpan dueTime, 854TimeSpan period) 919public bool Change(TimeSpan dueTime, TimeSpan period) =>
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (8)
79internal static int ToTimeoutMilliseconds(TimeSpan timeout) 502public virtual bool WaitOne(TimeSpan timeout) => WaitOneNoCheck(ToTimeoutMilliseconds(timeout)); 505public virtual bool WaitOne(TimeSpan timeout, bool exitContext) => WaitOneNoCheck(ToTimeoutMilliseconds(timeout)); 509public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout) => 515public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext) => 524public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout) => 530public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext) => 535public static bool SignalAndWait(WaitHandle toSignal, WaitHandle toWaitOn, TimeSpan timeout, bool exitContext) =>
src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (29)
30private const long MaxTimeTicks = TimeSpan.TicksPerDay - 1; 96public int Hour => (int)(_ticks / TimeSpan.TicksPerHour); 101public int Minute => (int)((uint)(_ticks / TimeSpan.TicksPerMinute) % (uint)TimeSpan.MinutesPerHour); 106public int Second => (int)((uint)(_ticks / TimeSpan.TicksPerSecond) % (uint)TimeSpan.SecondsPerMinute); 111public int Millisecond => (int)((uint)(_ticks / TimeSpan.TicksPerMillisecond) % (uint)TimeSpan.MillisecondsPerSecond); 116public int Microsecond => (int)(_ticks / TimeSpan.TicksPerMicrosecond % (uint)TimeSpan.MicrosecondsPerMillisecond); 121public int Nanosecond => (int)(_ticks % TimeSpan.TicksPerMicrosecond * TimeSpan.NanosecondsPerTick); 128private TimeOnly AddTicks(long ticks) => new TimeOnly((_ticks + TimeSpan.TicksPerDay + (ulong)(ticks % TimeSpan.TicksPerDay)) % TimeSpan.TicksPerDay); 132(long days, long newTicks) = Math.DivRem(ticks, TimeSpan.TicksPerDay); 137newTicks += TimeSpan.TicksPerDay; 139else if (newTicks >= TimeSpan.TicksPerDay) 142newTicks -= TimeSpan.TicksPerDay; 154public TimeOnly Add(TimeSpan value) => AddTicks(value.Ticks); 163public TimeOnly Add(TimeSpan value, out int wrappedDays) => AddTicks(value.Ticks, out wrappedDays); 170public TimeOnly AddHours(double value) => AddTicks((long)(value * TimeSpan.TicksPerHour)); 179public TimeOnly AddHours(double value, out int wrappedDays) => AddTicks((long)(value * TimeSpan.TicksPerHour), out wrappedDays); 186public TimeOnly AddMinutes(double value) => AddTicks((long)(value * TimeSpan.TicksPerMinute)); 195public TimeOnly AddMinutes(double value, out int wrappedDays) => AddTicks((long)(value * TimeSpan.TicksPerMinute), out wrappedDays); 279public static TimeSpan operator -(TimeOnly t1, TimeOnly t2) 283return new TimeSpan(diff + ((diff >> 63) & TimeSpan.TicksPerDay)); 371public static TimeOnly FromTimeSpan(TimeSpan timeSpan) => new TimeOnly(timeSpan._ticks); 384public TimeSpan ToTimeSpan() => new TimeSpan((long)_ticks);
src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (140)
25IComparable<TimeSpan>, 26IEquatable<TimeSpan>, 28ISpanParsable<TimeSpan>, 230public static readonly TimeSpan Zero = new TimeSpan(0); 232public static readonly TimeSpan MaxValue = new TimeSpan(MaxTicks); 233public static readonly TimeSpan MinValue = new TimeSpan(MinTicks); 255/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 268/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 276/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 290/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 317/// Gets the microseconds component of the time interval represented by the current <see cref="TimeSpan"/> structure. 326/// Gets the nanoseconds component of the time interval represented by the current <see cref="TimeSpan"/> structure. 362/// Gets the value of the current <see cref="TimeSpan"/> structure expressed in whole and fractional microseconds. 374/// Gets the value of the current <see cref="TimeSpan"/> structure expressed in whole and fractional nanoseconds. 389public TimeSpan Add(TimeSpan ts) => this + ts; 394public static int Compare(TimeSpan t1, TimeSpan t2) => t1._ticks.CompareTo(t2._ticks); 404if (value is TimeSpan other) 412public int CompareTo(TimeSpan value) => Compare(this, value); 414public static TimeSpan FromDays(double value) => Interval(value, TicksPerDay); 416public TimeSpan Duration() 425public override bool Equals([NotNullWhen(true)] object? value) => (value is TimeSpan other) && Equals(other); 427public bool Equals(TimeSpan obj) => Equals(this, obj); 429public static bool Equals(TimeSpan t1, TimeSpan t2) => t1 == t2; 434private static TimeSpan FromUnits(long units, long ticksPerUnit, long minUnits, long maxUnits) 443return TimeSpan.FromTicks(units * ticksPerUnit); 447/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 451/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of days.</returns> 453/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 455public static TimeSpan FromDays(int days) => FromUnits(days, TicksPerDay, MinDays, MaxDays); 458/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 467/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of days, hours, minutes, seconds, milliseconds, and microseconds.</returns> 469/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 471public static TimeSpan FromDays(int days, int hours = 0, long minutes = 0, long seconds = 0, long milliseconds = 0, long microseconds = 0) 484/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 488/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of hours.</returns> 490/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 492public static TimeSpan FromHours(int hours) => FromUnits(hours, TicksPerHour, MinHours, MaxHours); 495/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 503/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of hours, minutes, seconds, milliseconds, and microseconds.</returns> 505/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 507public static TimeSpan FromHours(int hours, long minutes = 0, long seconds = 0, long milliseconds = 0, long microseconds = 0) 519/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 523/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of minutes.</returns> 525/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 527public static TimeSpan FromMinutes(long minutes) => FromUnits(minutes, TicksPerMinute, MinMinutes, MaxMinutes); 530/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 537/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of minutes, seconds, milliseconds, and microseconds.</returns> 539/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 541public static TimeSpan FromMinutes(long minutes, long seconds = 0, long milliseconds = 0, long microseconds = 0) 552/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 556/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of seconds.</returns> 558/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 560public static TimeSpan FromSeconds(long seconds) => FromUnits(seconds, TicksPerSecond, MinSeconds, MaxSeconds); 563/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 569/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of seconds, milliseconds, and microseconds.</returns> 571/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 573public static TimeSpan FromSeconds(long seconds, long milliseconds = 0, long microseconds = 0) 583/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 587/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of milliseconds.</returns> 589/// The parameter specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 591public static TimeSpan FromMilliseconds(long milliseconds) 595/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 600/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of milliseconds, and microseconds.</returns> 602/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 604public static TimeSpan FromMilliseconds(long milliseconds, long microseconds) 613private static TimeSpan FromMicroseconds(Int128 microseconds) 620return TimeSpan.FromTicks(ticks); 624/// Initializes a new instance of the <see cref="TimeSpan"/> structure to a specified number of 628/// <returns>Returns a <see cref="TimeSpan"/> that represents a specified number of microseconds.</returns> 630/// The parameters specify a <see cref="TimeSpan"/> value less than <see cref="MinValue"/> or greater than <see cref="MaxValue"/> 632public static TimeSpan FromMicroseconds(long microseconds) => FromUnits(microseconds, TicksPerMicrosecond, MinMicroseconds, MaxMicroseconds); 634public static TimeSpan FromHours(double value) => Interval(value, TicksPerHour); 636private static TimeSpan Interval(double value, double scale) 645private static TimeSpan IntervalFromDoubleTicks(double ticks) 658public static TimeSpan FromMilliseconds(double value) => Interval(value, TicksPerMillisecond); 661/// Returns a <see cref="TimeSpan"/> that represents a specified number of microseconds. 679public static TimeSpan FromMicroseconds(double value) => Interval(value, TicksPerMicrosecond); 681public static TimeSpan FromMinutes(double value) => Interval(value, TicksPerMinute); 683public TimeSpan Negate() => -this; 685public static TimeSpan FromSeconds(double value) => Interval(value, TicksPerSecond); 687public TimeSpan Subtract(TimeSpan ts) => this - ts; 689public TimeSpan Multiply(double factor) => this * factor; 691public TimeSpan Divide(double divisor) => this / divisor; 693public double Divide(TimeSpan ts) => this / ts; 695public static TimeSpan FromTicks(long value) => new TimeSpan(value); 722public static TimeSpan Parse(string s) 728public static TimeSpan Parse(string input, IFormatProvider? formatProvider) 736public static TimeSpan Parse(ReadOnlySpan<char> input, IFormatProvider? formatProvider = null) => TimeSpanParse.Parse(input, formatProvider); 737public static TimeSpan ParseExact(string input, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string format, IFormatProvider? formatProvider) 743public static TimeSpan ParseExact(string input, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string[] formats, IFormatProvider? formatProvider) 751public static TimeSpan ParseExact(string input, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string format, IFormatProvider? formatProvider, TimeSpanStyles styles) 759public static TimeSpan ParseExact(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] ReadOnlySpan<char> format, IFormatProvider? formatProvider, TimeSpanStyles styles = TimeSpanStyles.None) 764public static TimeSpan ParseExact(string input, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string[] formats, IFormatProvider? formatProvider, TimeSpanStyles styles) 770public static TimeSpan ParseExact(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string[] formats, IFormatProvider? formatProvider, TimeSpanStyles styles = TimeSpanStyles.None) 775public static bool TryParse([NotNullWhen(true)] string? s, out TimeSpan result) 784public static bool TryParse(ReadOnlySpan<char> s, out TimeSpan result) => TimeSpanParse.TryParse(s, null, out result); 786public static bool TryParse([NotNullWhen(true)] string? input, IFormatProvider? formatProvider, out TimeSpan result) 795public static bool TryParse(ReadOnlySpan<char> input, IFormatProvider? formatProvider, out TimeSpan result) => TimeSpanParse.TryParse(input, formatProvider, out result); 796public static bool TryParseExact([NotNullWhen(true)] string? input, [NotNullWhen(true), StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string? format, IFormatProvider? formatProvider, out TimeSpan result) 806public static bool TryParseExact(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] ReadOnlySpan<char> format, IFormatProvider? formatProvider, out TimeSpan result) 809public static bool TryParseExact([NotNullWhen(true)] string? input, [NotNullWhen(true), StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string?[]? formats, IFormatProvider? formatProvider, out TimeSpan result) 818public static bool TryParseExact(ReadOnlySpan<char> input, [NotNullWhen(true), StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string?[]? formats, IFormatProvider? formatProvider, out TimeSpan result) 821public static bool TryParseExact([NotNullWhen(true)] string? input, [NotNullWhen(true), StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string? format, IFormatProvider? formatProvider, TimeSpanStyles styles, out TimeSpan result) 833public static bool TryParseExact(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] ReadOnlySpan<char> format, IFormatProvider? formatProvider, TimeSpanStyles styles, out TimeSpan result) 838public static bool TryParseExact([NotNullWhen(true)] string? input, [NotNullWhen(true), StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string?[]? formats, IFormatProvider? formatProvider, TimeSpanStyles styles, out TimeSpan result) 850public static bool TryParseExact(ReadOnlySpan<char> input, [NotNullWhen(true), StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] string?[]? formats, IFormatProvider? formatProvider, TimeSpanStyles styles, out TimeSpan result) 868public static TimeSpan operator -(TimeSpan t) 877public static TimeSpan operator -(TimeSpan t1, TimeSpan t2) 891public static TimeSpan operator +(TimeSpan t) => t; 893public static TimeSpan operator +(TimeSpan t1, TimeSpan t2) 908public static TimeSpan operator *(TimeSpan timeSpan, double factor) 922public static TimeSpan operator *(double factor, TimeSpan timeSpan) => timeSpan * factor; 925public static TimeSpan operator /(TimeSpan timeSpan, double divisor) 941public static double operator /(TimeSpan t1, TimeSpan t2) => t1.Ticks / (double)t2.Ticks; 944public static bool operator ==(TimeSpan t1, TimeSpan t2) => t1._ticks == t2._ticks; 947public static bool operator !=(TimeSpan t1, TimeSpan t2) => t1._ticks != t2._ticks; 950public static bool operator <(TimeSpan t1, TimeSpan t2) => t1._ticks < t2._ticks; 953public static bool operator <=(TimeSpan t1, TimeSpan t2) => t1._ticks <= t2._ticks; 956public static bool operator >(TimeSpan t1, TimeSpan t2) => t1._ticks > t2._ticks; 959public static bool operator >=(TimeSpan t1, TimeSpan t2) => t1._ticks >= t2._ticks;
src\libraries\System.Private.CoreLib\src\System\TimeZone.cs (6)
69public abstract TimeSpan GetUtcOffset(DateTime time); 120return CalculateUtcOffset(time, daylightTimes) != TimeSpan.Zero; 183internal static TimeSpan CalculateUtcOffset(DateTime time, DaylightTime daylightTimes) 187return TimeSpan.Zero; 192return TimeSpan.Zero; 246return TimeSpan.Zero;
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.AdjustmentRule.cs (29)
14private static readonly TimeSpan DaylightDeltaAdjustment = TimeSpan.FromHours(24.0); 15private static readonly TimeSpan MaxDaylightDelta = TimeSpan.FromHours(12.0); 18private readonly TimeSpan _daylightDelta; 21private readonly TimeSpan _baseUtcOffsetDelta; // delta from the default Utc offset (utcOffset = defaultUtcOffset + _baseUtcOffsetDelta) 28public TimeSpan DaylightDelta => _daylightDelta; 37public TimeSpan BaseUtcOffsetDelta => _baseUtcOffsetDelta; 46DaylightDelta != TimeSpan.Zero || 70TimeSpan daylightDelta, 73TimeSpan baseUtcOffsetDelta, 101TimeSpan daylightDelta, 104TimeSpan baseUtcOffsetDelta) 119TimeSpan daylightDelta, 129baseUtcOffsetDelta: TimeSpan.Zero, 136TimeSpan daylightDelta, 139TimeSpan baseUtcOffsetDelta, 160DaylightTransitionStart.TimeOfDay.TimeOfDay.Ticks < TimeSpan.TicksPerSecond; // < 12:00:01 AM 169DaylightTransitionEnd.TimeOfDay.TimeOfDay.Ticks < TimeSpan.TicksPerSecond; // < 12:00:01 AM 177TimeSpan daylightDelta, 211if (daylightDelta.Ticks % TimeSpan.TicksPerMinute != 0) 216if (dateStart != DateTime.MinValue && dateStart.Kind == DateTimeKind.Unspecified && dateStart.TimeOfDay != TimeSpan.Zero) 221if (dateEnd != DateTime.MaxValue && dateEnd.Kind == DateTimeKind.Unspecified && dateEnd.TimeOfDay != TimeSpan.Zero) 230private static void AdjustDaylightDeltaToExpectedRange(ref TimeSpan daylightDelta, ref TimeSpan baseUtcOffsetDelta) 282_daylightDelta = (TimeSpan)info.GetValue("DaylightDelta", typeof(TimeSpan))!; // Do not rename (binary serialization) 286object? o = info.GetValueNoThrow("BaseUtcOffsetDelta", typeof(TimeSpan)); // Do not rename (binary serialization) 289_baseUtcOffsetDelta = (TimeSpan)o;
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (73)
50private readonly TimeSpan _baseUtcOffset; 186public TimeSpan BaseUtcOffset => _baseUtcOffset; 194public TimeSpan[] GetAmbiguousTimeOffsets(DateTimeOffset dateTimeOffset) 217TimeSpan[] timeSpans = new TimeSpan[2]; 219TimeSpan actualUtcOffset = _baseUtcOffset + rule!.BaseUtcOffsetDelta; 222if (rule.DaylightDelta > TimeSpan.Zero) 239public TimeSpan[] GetAmbiguousTimeOffsets(DateTime dateTime) 276TimeSpan[] timeSpans = new TimeSpan[2]; 277TimeSpan actualUtcOffset = _baseUtcOffset + rule!.BaseUtcOffsetDelta; 280if (rule.DaylightDelta > TimeSpan.Zero) 342public TimeSpan GetUtcOffset(DateTimeOffset dateTimeOffset) => 348public TimeSpan GetUtcOffset(DateTime dateTime) => 352internal static TimeSpan GetLocalUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags) 361internal TimeSpan GetUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags) => 364private TimeSpan GetUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags, CachedData cachedData) 711TimeSpan destinationOffset = GetUtcOffsetFromUtc(utcDateTime, destinationTimeZone); 771TimeSpan sourceOffset = sourceTimeZone.BaseUtcOffset; 789sourceOffset += (sourceIsDaylightSavings ? sourceRule.DaylightDelta : TimeSpan.Zero /*FUTURE: sourceRule.StandardDelta*/); 1002TimeSpan baseUtcOffset, 1028TimeSpan baseUtcOffset, 1052TimeSpan baseUtcOffset, 1073TimeSpan baseUtcOffset, 1165_baseUtcOffset = (TimeSpan)info.GetValue("BaseUtcOffset", typeof(TimeSpan))!; // Do not rename (binary serialization) 1278private DateTime ConvertToUtc(DateTime dateTime, TimeSpan daylightDelta, TimeSpan baseUtcOffsetDelta) => 1284private DateTime ConvertFromUtc(DateTime dateTime, TimeSpan daylightDelta, TimeSpan baseUtcOffsetDelta) => 1290private DateTime ConvertToFromUtc(DateTime dateTime, TimeSpan daylightDelta, TimeSpan baseUtcOffsetDelta, bool convertToUtc) 1292TimeSpan offset = BaseUtcOffset + daylightDelta + baseUtcOffsetDelta; 1320TimeSpan offset = GetUtcOffsetFromUtc(utcConverted, destinationTimeZone, out isAmbiguousLocalDst); 1334TimeSpan delta = rule.DaylightDelta; 1402bool invalidAtStart = rule.DaylightDelta > TimeSpan.Zero; 1406daylightTime.Start + (invalidAtStart ? rule.DaylightDelta : TimeSpan.Zero); /* FUTURE: - rule.StandardDelta; */ 1410daylightTime.End + (invalidAtStart ? -rule.DaylightDelta : TimeSpan.Zero); 1434private TimeSpan GetDaylightSavingsStartOffsetFromUtc(TimeSpan baseUtcOffset, AdjustmentRule rule, int? ruleIndex) 1451private static TimeSpan GetDaylightSavingsEndOffsetFromUtc(TimeSpan baseUtcOffset, AdjustmentRule rule) 1461private static bool GetIsDaylightSavingsFromUtc(DateTime time, int year, TimeSpan utc, AdjustmentRule rule, int? ruleIndex, out bool isAmbiguousLocalDst, TimeZoneInfo zone) 1485TimeSpan dstStartOffset = zone.GetDaylightSavingsStartOffsetFromUtc(utc, rule, ruleIndex); 1503TimeSpan dstEndOffset = GetDaylightSavingsEndOffsetFromUtc(utc, rule); 1575private static bool TryGetEndOfDstIfYearStartWithDst(int nextYear, TimeSpan utc, TimeZoneInfo zone, out DateTime dstEnd) 1625private static bool TryGetStartOfDstIfYearEndWithDst(int previousYear, TimeSpan utc, TimeZoneInfo zone, out DateTime dstStart) 1703if (rule == null || rule.DaylightDelta == TimeSpan.Zero) 1712if (rule.DaylightDelta > TimeSpan.Zero) 1773if (rule == null || rule.DaylightDelta == TimeSpan.Zero) 1782if (rule.DaylightDelta < TimeSpan.Zero) 1836private static TimeSpan GetUtcOffset(DateTime time, TimeZoneInfo zone) 1838TimeSpan baseOffset = zone.BaseUtcOffset; 1848baseOffset += (isDaylightSavings ? rule.DaylightDelta : TimeSpan.Zero /* FUTURE: rule.StandardDelta */); 1859private static TimeSpan GetUtcOffsetFromUtc(DateTime time, TimeZoneInfo zone) => 1866private static TimeSpan GetUtcOffsetFromUtc(DateTime time, TimeZoneInfo zone, out bool isDaylightSavings) => 1873internal static TimeSpan GetUtcOffsetFromUtc(DateTime time, TimeZoneInfo zone, out bool isDaylightSavings, out bool isAmbiguousLocalDst) 1877TimeSpan baseOffset = zone.BaseUtcOffset; 1912baseOffset += (isDaylightSavings ? rule.DaylightDelta : TimeSpan.Zero /* FUTURE: rule.StandardDelta */); 1925TimeSpan timeOfDay = transitionTime.TimeOfDay.TimeOfDay; 2157private static void ValidateTimeZoneInfo(string id, TimeSpan baseUtcOffset, AdjustmentRule[]? adjustmentRules, out bool adjustmentRulesSupportDst) 2166if (baseUtcOffset.Ticks % TimeSpan.TicksPerMinute != 0) 2207private static TimeSpan MaxOffset => TimeSpan.FromHours(14); 2208private static TimeSpan MinOffset => TimeSpan.FromHours(-14); 2213internal static bool UtcOffsetOutOfRange(TimeSpan offset) => 2216private static TimeSpan GetUtcOffset(TimeSpan baseUtcOffset, AdjustmentRule adjustmentRule) 2220+ (adjustmentRule.HasDaylightSaving ? adjustmentRule.DaylightDelta : TimeSpan.Zero); 2226private static bool IsValidAdjustmentRuleOffset(TimeSpan baseUtcOffset, AdjustmentRule adjustmentRule) 2228TimeSpan utcOffset = GetUtcOffset(baseUtcOffset, adjustmentRule); 2237return CreateCustomTimeZone(UtcId, TimeSpan.Zero, displayName, standardDisplayName);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.FullGlobalizationData.Unix.cs (3)
156private static void GetFullValueForDisplayNameField(string timeZoneId, TimeSpan baseUtcOffset, ref string? displayName) 161string baseOffsetText = string.Create(null, stackalloc char[128], $"(UTC{(baseUtcOffset >= TimeSpan.Zero ? '+' : '-')}{baseUtcOffset:hh\\:mm})"); 189if (baseUtcOffset == TimeSpan.Zero)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.StringSerializer.cs (6)
75if (rule.BaseUtcOffsetDelta != TimeSpan.Zero) 102TimeSpan baseUtcOffset = s.GetNextTimeSpanValue(); 344private TimeSpan GetNextTimeSpanValue() 432TimeSpan daylightDelta = GetNextTimeSpanValue(); 435TimeSpan baseUtcOffsetDelta = TimeSpan.Zero;
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.TransitionTime.cs (2)
102if (timeOfDay.Ticks >= TimeSpan.TicksPerDay || (ulong)timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (48)
64_baseUtcOffset = TimeSpan.Zero; 116if (_baseUtcOffset.Ticks % TimeSpan.TicksPerMinute != 0) 139private static DateTime GetTimeOnlyInMillisecondsPrecision(DateTime input) => new DateTime((input.TimeOfDay.Ticks / TimeSpan.TicksPerMillisecond) * TimeSpan.TicksPerMillisecond); 163rule.DaylightDelta == TimeSpan.Zero && rule.BaseUtcOffsetDelta == TimeSpan.Zero) 238string? displayName = string.Create(null, stackalloc char[256], $"(UTC{(_baseUtcOffset >= TimeSpan.Zero ? '+' : '-')}{_baseUtcOffset:hh\\:mm}) {_id}"); 358internal static TimeSpan GetDateTimeNowUtcOffsetFromUtc(DateTime time, out bool isAmbiguousLocalDst) 493private static void TZif_GenerateAdjustmentRules(out AdjustmentRule[]? rules, TimeSpan baseUtcOffset, DateTime[] dts, byte[] typeOfLocalTime, 516private static void TZif_GenerateAdjustmentRule(ref int index, TimeSpan timeZoneBaseUtcOffset, List<AdjustmentRule> rulesList, DateTime[] dts, 546TimeSpan transitionOffset = TZif_CalculateTransitionOffsetFromBase(transitionType.UtcOffset, timeZoneBaseUtcOffset); 547TimeSpan daylightDelta = transitionType.IsDst ? transitionOffset : TimeSpan.Zero; 548TimeSpan baseUtcDelta = transitionType.IsDst ? TimeSpan.Zero : transitionOffset; 573TimeSpan transitionOffset = TZif_CalculateTransitionOffsetFromBase(startTransitionType.UtcOffset, timeZoneBaseUtcOffset); 574TimeSpan daylightDelta = startTransitionType.IsDst ? transitionOffset : TimeSpan.Zero; 575TimeSpan baseUtcDelta = startTransitionType.IsDst ? TimeSpan.Zero : transitionOffset; 625TimeSpan transitionOffset = TZif_CalculateTransitionOffsetFromBase(transitionType.UtcOffset, timeZoneBaseUtcOffset); 626TimeSpan daylightDelta = transitionType.IsDst ? transitionOffset : TimeSpan.Zero; 627TimeSpan baseUtcDelta = transitionType.IsDst ? TimeSpan.Zero : transitionOffset; 650private static TimeSpan TZif_CalculateTransitionOffsetFromBase(TimeSpan transitionOffset, TimeSpan timeZoneBaseUtcOffset) 652TimeSpan result = transitionOffset - timeZoneBaseUtcOffset; 656if (result.Ticks % TimeSpan.TicksPerMinute != 0) 699private static AdjustmentRule? TZif_CreateAdjustmentRuleForPosixFormat(string posixFormat, DateTime startTransitionDate, TimeSpan timeZoneBaseUtcOffset) 713TimeSpan? parsedBaseOffset = TZif_ParseOffsetString(standardOffset); 716TimeSpan baseOffset = parsedBaseOffset.GetValueOrDefault().Negate(); // offsets are backwards in POSIX notation 722TimeSpan? parsedDaylightSavings = TZif_ParseOffsetString(daylightSavingsOffset); 723TimeSpan daylightSavingsTimeSpan; 759TimeSpan.Zero, 771private static TimeSpan? TZif_ParseOffsetString(ReadOnlySpan<char> offset) 773TimeSpan? result = null; 793TimeSpan parsedTimeSpan; 794if (TimeSpan.TryParseExact(offset, "g", CultureInfo.InvariantCulture, out parsedTimeSpan)) 812TimeSpan? timeOffset = TZif_ParseOffsetString(time); 820if (timeOffset.GetValueOrDefault() < TimeSpan.Zero) 1245private static void NormalizeAdjustmentRuleOffset(TimeSpan baseUtcOffset, [NotNull] ref AdjustmentRule adjustmentRule) 1265TimeSpan utcOffset = GetUtcOffset(baseUtcOffset, adjustmentRule); 1268TimeSpan adjustment = TimeSpan.Zero; 1279if (adjustment != TimeSpan.Zero) 1296public readonly TimeSpan UtcOffset;
src\System\GC.CoreCLR.cs (1)
863public static TimeSpan GetTotalPauseDuration()
System.Private.DataContractSerialization (78)
System\Runtime\Serialization\DataContract.cs (2)
659"TimeSpan" => typeof(TimeSpan), 746else if (type == typeof(TimeSpan))
System\Runtime\Serialization\ExtensionDataReader.cs (2)
718_value = XmlConvert.ToString(isTypedNode ? ((DataNode<TimeSpan>)dataNode).GetValue() : (TimeSpan)dataNode.Value);
System\Runtime\Serialization\Globals.cs (1)
36internal static Type TypeOfTimeSpan => field ??= typeof(TimeSpan);
System\Runtime\Serialization\Json\JsonWriterDelegator.cs (1)
211TimeSpan ts = TimeZoneInfo.Local.GetUtcOffset(value.ToLocalTime());
System\Runtime\Serialization\Json\XmlJsonWriter.cs (5)
301public override void WriteArray(string? prefix, string localName, string? namespaceUri, TimeSpan[] array, int offset, int count) 351public override void WriteArray(string? prefix, XmlDictionaryString localName, XmlDictionaryString? namespaceUri, TimeSpan[] array, int offset, int count) 1013public override void WriteValue(TimeSpan value) 1426else if (value is TimeSpan) 1428WriteValue((TimeSpan)value);
System\Runtime\Serialization\PrimitiveDataContract.cs (3)
945internal TimeSpanDataContract(XmlDictionaryString name, XmlDictionaryString ns) : base(typeof(TimeSpan), name, ns) 956writer.WriteTimeSpan((TimeSpan)obj); 971writer.WriteTimeSpan((TimeSpan)obj!, name, ns);
System\Runtime\Serialization\XmlReaderDelegator.cs (3)
323return new DataNode<TimeSpan>(ReadContentAsTimeSpan()); 662internal TimeSpan ReadElementContentAsTimeSpan() 671internal TimeSpan ReadContentAsTimeSpan()
System\Runtime\Serialization\XmlWriterDelegator.cs (4)
343WriteTimeSpan((TimeSpan)value); 422WriteTimeSpan(((DataNode<TimeSpan>)dataNode).GetValue()); 618internal void WriteTimeSpan(TimeSpan value) 623internal void WriteTimeSpan(TimeSpan value, XmlDictionaryString name, XmlDictionaryString? ns)
System\Xml\ArrayHelper.cs (6)
371internal sealed class TimeSpanArrayHelperWithString : ArrayHelper<string, TimeSpan> 375protected override int ReadArray(XmlDictionaryReader reader, string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 380protected override void WriteArray(XmlDictionaryWriter writer, string prefix, string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 386internal sealed class TimeSpanArrayHelperWithDictionaryString : ArrayHelper<XmlDictionaryString, TimeSpan> 390protected override int ReadArray(XmlDictionaryReader reader, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count) 395protected override void WriteArray(XmlDictionaryWriter writer, string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count)
System\Xml\ValueHandle.cs (2)
198return typeof(TimeSpan); 397public TimeSpan ToTimeSpan()
System\Xml\XmlBaseReader.cs (5)
1640public override TimeSpan ReadContentAsTimeSpan() 1645TimeSpan value = node.Value.ToTimeSpan(); 1709else if (type == typeof(TimeSpan)) 1872public override TimeSpan[] ReadTimeSpanArray(string localName, string namespaceUri) 1877public override TimeSpan[] ReadTimeSpanArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
System\Xml\XmlBaseWriter.cs (3)
1221else if (value is TimeSpan) 1223WriteValue((TimeSpan)value); 1420public override void WriteValue(TimeSpan value)
System\Xml\XmlBinaryReader.cs (7)
250public override TimeSpan ReadElementContentAsTimeSpan() 257TimeSpan value = BufferReader.ReadTimeSpan(); 1193type = typeof(TimeSpan); 1464private int ReadArray(TimeSpan[] array, int offset, int count) 1470foreach (ref TimeSpan item in array.AsSpan(offset, actual)) 1478public override int ReadArray(string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 1485public override int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count)
System\Xml\XmlBinaryWriter.cs (5)
819public override void WriteTimeSpanText(TimeSpan value) 1002public void WriteTimeSpanArray(ReadOnlySpan<TimeSpan> items) 1005foreach (ref readonly TimeSpan timespan in items) 1239else if (type == typeof(TimeSpan)) 1450public override void WriteArray(string? prefix, string localName, string? namespaceUri, TimeSpan[] array, int offset, int count)
System\Xml\XmlBufferReader.cs (2)
443public TimeSpan ReadTimeSpan() 449return TimeSpan.FromTicks(value);
System\Xml\XmlConverter.cs (8)
260public static TimeSpan ToTimeSpan(string value) 280public static TimeSpan ToTimeSpan(byte[] buffer, int offset, int count) 390public static string ToString(TimeSpan value) { return XmlConvert.ToString(value); } 414else if (value is TimeSpan) 415return ToString((TimeSpan)value); 947TimeSpan ts = new TimeSpan(hourDelta, minuteDelta, 0); 1054int ms = (int)(value.Ticks % TimeSpan.TicksPerSecond); 1066TimeSpan ts = TimeZoneInfo.Local.GetUtcOffset(value);
System\Xml\XmlDictionaryAsyncCheckWriter.cs (3)
535public override void WriteValue(TimeSpan value) 676public override void WriteArray(string? prefix, string localName, string? namespaceUri, TimeSpan[] array, int offset, int count) 682public override void WriteArray(string? prefix, XmlDictionaryString localName, XmlDictionaryString? namespaceUri, TimeSpan[] array, int offset, int count)
System\Xml\XmlDictionaryReader.cs (7)
669public virtual TimeSpan ReadContentAsTimeSpan() 921public virtual TimeSpan ReadElementContentAsTimeSpan() 924TimeSpan value; 1285public virtual TimeSpan[] ReadTimeSpanArray(string localName, string namespaceUri) 1290public virtual TimeSpan[] ReadTimeSpanArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri) 1295public virtual int ReadArray(string localName, string namespaceUri, TimeSpan[] array, int offset, int count) 1307public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int count)
System\Xml\XmlDictionaryWriter.cs (5)
186public virtual void WriteValue(TimeSpan value) 310else if (type == typeof(TimeSpan)) 339else if (type == typeof(TimeSpan)) 602public virtual void WriteArray(string? prefix, string localName, string? namespaceUri, TimeSpan[] array, int offset, int count) 613public virtual void WriteArray(string? prefix, XmlDictionaryString localName, XmlDictionaryString? namespaceUri, TimeSpan[] array, int offset, int count)
System\Xml\XmlNodeWriter.cs (2)
87public abstract void WriteTimeSpanText(TimeSpan value); 137public override void WriteTimeSpanText(TimeSpan value) { }
System\Xml\XmlSigningNodeWriter.cs (1)
307public override void WriteTimeSpanText(TimeSpan value)
System\Xml\XmlUTF8TextWriter.cs (1)
693public override void WriteTimeSpanText(TimeSpan value)
System.Private.Windows.Core (32)
System\IO\BinaryReaderExtensions.cs (6)
66if (typeof(T) == typeof(decimal) || typeof(T) == typeof(DateTime) || typeof(T) == typeof(TimeSpan)) 174else if (typeof(T) == typeof(TimeSpan)) 196/// <see langword="decimal"/>, <see cref="DateTime"/>, and <see cref="TimeSpan"/>. 209|| typeof(T) == typeof(TimeSpan)) 329else if (typeof(T) == typeof(TimeSpan)) 331writer.Write(((TimeSpan)(object)values[i]).Ticks);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (9)
96/// Writes a <see cref="TimeSpan"/> in binary format. 98public static void WriteTimeSpan(Stream stream, TimeSpan value) 102new ClassInfo(1, typeof(TimeSpan).FullName!, s_ticksName), 326WriteTimeSpan(stream, (TimeSpan)primitive); 451case List<TimeSpan> typedList: 549PrimitiveType.TimeSpan => new ArraySinglePrimitive<TimeSpan>( 5501, new ListConverter<object, TimeSpan>(array, o => (TimeSpan)o!)), 699case TimeSpan timeSpan:
System\Private\Windows\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (2)
116SZArrayRecord<TimeSpan> primitiveArray => primitiveArray.GetArray(), 151|| elementType == typeof(DateTime) || elementType == typeof(TimeSpan);
System\Private\Windows\BinaryFormat\Serializer\Record.cs (1)
58writer.Write(((TimeSpan)value).Ticks);
System\Private\Windows\BinaryFormat\Support\TypeExtensions.cs (1)
34_ => type == typeof(TimeSpan) ? PrimitiveType.TimeSpan : default,
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (6)
51{ TypeName.Parse(Types.TimeSpanType), typeof(TimeSpan) }, 70{ Types.ToTypeName($"{Types.ListName}[[{Types.TimeSpanType}]]"), typeof(List<TimeSpan>) }, 86{ Types.ToTypeName($"{Types.TimeSpanType}[]"), typeof(TimeSpan[]) }, 119|| type == typeof(TimeSpan) 137|| type == typeof(List<TimeSpan>) 153|| type == typeof(TimeSpan[])
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (2)
353SZArrayRecord<TimeSpan> ar => ar.GetArray().CreateTrimmedList(size), 440SZArrayRecord<TimeSpan> ar => ar.GetArray(),
System\Value.cs (3)
487TimeSpan offset = value.Offset; 733DateTimeOffset dto = new(_union.Ticks, TimeSpan.Zero); 895DateTimeOffset? dto = new DateTimeOffset(_union.Ticks, TimeSpan.Zero);
System\Value.PackedDateTimeOffset.cs (2)
41public static bool TryCreate(DateTimeOffset dateTime, TimeSpan offset, out PackedDateTimeOffset packed) 70TimeSpan offset = new(
System.Private.Windows.Core.Tests (15)
System\Private\Windows\Ole\BinaryFormatUtilitiesTests.cs (15)
48TimeSpan.FromHours(1), 81new List<TimeSpan> { TimeSpan.MinValue, TimeSpan.MaxValue }, 101new TimeSpan[] { TimeSpan.MinValue, TimeSpan.MaxValue }, 123(ArrayList)([TimeSpan.MinValue, TimeSpan.MaxValue]), 143new Hashtable { { "TimeSpan", TimeSpan.FromHours(1) } }, 749("System.Collections.Generic.List`1[[System.TimeSpan, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]", typeof(List<TimeSpan>)) 999public TimeSpan[] TimeSpanArray = [TimeSpan.FromHours(1)]; 1025public List<TimeSpan> TimeSpans = [TimeSpan.FromHours(1)];
System.Private.Xml (102)
System\Xml\BinaryXml\SqlUtils.cs (5)
402private static void WriteTimeZone(StringBuilder sb, TimeSpan zone) 588return SQLBaseDate.Add(new TimeSpan(dateticks * TimeSpan.TicksPerDay + 589millisecond * TimeSpan.TicksPerMillisecond)); 735return (data[p] | data[p + 1] << 8 | data[p + 2] << 16) * TimeSpan.TicksPerDay; 770return (short)(data[pos] | data[pos + 1] << 8) * TimeSpan.TicksPerMinute;
System\Xml\Schema\DataTypeImplementation.cs (7)
1849public override Type ValueType { get { return typeof(TimeSpan); } } 1851internal override Type ListValueType { get { return typeof(TimeSpan[]); } } 1871return ((TimeSpan)value1).CompareTo((TimeSpan)value2); 1888TimeSpan timeSpanValue; 1923TimeSpan timeSpanValue; 1962TimeSpan timeSpanValue;
System\Xml\Schema\FacetChecker.cs (17)
822internal virtual Exception? CheckValueFacets(TimeSpan value, XmlSchemaDatatype datatype) 1200TimeSpan timeSpanValue = (TimeSpan)datatype.ValueConverter.ChangeType(value, typeof(TimeSpan)); 1204internal override Exception? CheckValueFacets(TimeSpan value, XmlSchemaDatatype datatype) 1211if (TimeSpan.Compare(value, (TimeSpan)restriction!.MaxInclusive!) > 0) 1219if (TimeSpan.Compare(value, (TimeSpan)restriction!.MaxExclusive!) >= 0) 1227if (TimeSpan.Compare(value, (TimeSpan)restriction!.MinInclusive!) < 0) 1235if (TimeSpan.Compare(value, (TimeSpan)restriction!.MinExclusive!) <= 0) 1251return MatchEnumeration((TimeSpan)value, enumeration); 1254private static bool MatchEnumeration(TimeSpan value, ArrayList enumeration) 1258if (TimeSpan.Compare(value, (TimeSpan)enumeration[i]!) == 0)
System\Xml\Schema\XmlValueConverter.cs (15)
327protected static readonly Type TimeSpanType = typeof(TimeSpan); 537protected static TimeSpan StringToDayTimeDuration(string value) 543protected static TimeSpan StringToDuration(string value) 660protected static TimeSpan StringToYearMonthDuration(string value) 691protected static string DayTimeDurationToString(TimeSpan value) 696protected static string DurationToString(TimeSpan value) 785protected static string YearMonthDurationToString(TimeSpan value) 1739case XmlTypeCode.DayTimeDuration: return DayTimeDurationToString((TimeSpan)value); 1740case XmlTypeCode.Duration: return DurationToString((TimeSpan)value); 1741case XmlTypeCode.YearMonthDuration: return YearMonthDurationToString((TimeSpan)value); 1861case XmlTypeCode.DayTimeDuration: return ((TimeSpan)value); 1862case XmlTypeCode.Duration: return ((TimeSpan)value); 1863case XmlTypeCode.YearMonthDuration: return ((TimeSpan)value); 2252if (sourceType == TimeSpanType) return DurationToString((TimeSpan)value); 2995if (itemTypeDst == TimeSpanType) return ToArray<TimeSpan>(value, nsResolver);
System\Xml\Schema\XsdDateTime.cs (5)
186TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(dateTime); 218TimeSpan zoneOffset = dateTimeOffset.Offset; 395TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day); 455TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day); 568int n = (int)(ticks / TimeSpan.TicksPerDay);
System\Xml\Schema\XsdDuration.cs (17)
75public XsdDuration(TimeSpan timeSpan) : this(timeSpan, DurationType.Duration) 83public XsdDuration(TimeSpan timeSpan, DurationType durationType) 103int years = (int)(ticksPos / ((ulong)TimeSpan.TicksPerDay * 365)); 104int months = (int)((ticksPos % ((ulong)TimeSpan.TicksPerDay * 365)) / ((ulong)TimeSpan.TicksPerDay * 30)); 126_days = (int)(ticksPos / (ulong)TimeSpan.TicksPerDay); 127_hours = (int)((ticksPos / (ulong)TimeSpan.TicksPerHour) % 24); 128_minutes = (int)((ticksPos / (ulong)TimeSpan.TicksPerMinute) % 60); 129_seconds = (int)((ticksPos / (ulong)TimeSpan.TicksPerSecond) % 60); 237public TimeSpan ToTimeSpan() 246public TimeSpan ToTimeSpan(DurationType durationType) 248TimeSpan result; 258internal Exception? TryToTimeSpan(out TimeSpan result) 263internal Exception? TryToTimeSpan(DurationType durationType, out TimeSpan result) 295ticks *= (ulong)TimeSpan.TicksPerSecond; 301ticks *= (ulong)TimeSpan.TicksPerDay; 325result = TimeSpan.MinValue;
System\Xml\Serialization\CodeGenerator.cs (4)
842if (valueType == typeof(TimeSpan)) 844ConstructorInfo TimeSpan_ctor = typeof(TimeSpan).GetConstructor( 850Ldc(((TimeSpan)o).Ticks); // ticks 859new Type[] { typeof(long), typeof(TimeSpan) },
System\Xml\Serialization\PrimitiveXmlSerializers.cs (3)
213TimeSpan timeSpan = (TimeSpan)o; 683o = default(TimeSpan);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (2)
873else if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan) && Reader.IsEmptyElement) 876value = default(TimeSpan);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (1)
1247"TimeSpan" => XmlConvert.ToString((TimeSpan)o),
System\Xml\Serialization\Types.cs (2)
531AddNonXsdPrimitive(typeof(TimeSpan), "TimeSpan", UrtTypes.Namespace, "TimeSpan", new XmlQualifiedName("duration", XmlSchema.Namespace), Array.Empty<XmlSchemaFacet>(), TypeFlags.CanBeAttributeValue | TypeFlags.CanBeElementValue | TypeFlags.XmlEncodingNotRequired); 577else if (type == typeof(TimeSpan))
System\Xml\Serialization\XmlSerializationReader.cs (3)
770value = default(Nullable<TimeSpan>); 4678if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan) || element.Mapping.TypeDesc!.Type == typeof(DateTimeOffset)) 4684if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan))
System\Xml\Serialization\XmlSerializationReaderILGen.cs (1)
3050if ((element.Mapping.TypeDesc!.Type == typeof(TimeSpan)) || element.Mapping.TypeDesc!.Type == typeof(DateTimeOffset))
System\Xml\Serialization\XmlSerializationWriter.cs (5)
235else if (type == typeof(TimeSpan)) 359else if (t == typeof(TimeSpan)) 361tryFormatResult = XmlConvert.TryFormat((TimeSpan)o, _primitivesBuffer, out charsWritten); 4360else if (type == typeof(TimeSpan)) 4365Writer.Write(((TimeSpan)value).Ticks.ToString(CultureInfo.InvariantCulture));
System\Xml\Serialization\XmlSerializer.cs (2)
921else if (_primitiveType == typeof(TimeSpan)) 1003else if (_primitiveType == typeof(TimeSpan))
System\Xml\XmlConvert.cs (6)
686public static string ToString(TimeSpan value) 1109public static TimeSpan ToTimeSpan(string s) 1112TimeSpan timeSpan; 1129internal static Exception? TryToTimeSpan(string s, out TimeSpan result) 1137result = TimeSpan.MinValue; 1749internal static bool TryFormat(TimeSpan value, Span<char> destination, out int charsWritten)
System\Xml\Xsl\IlGen\GenerateHelper.cs (2)
452{ typeof(TimeSpan), new XmlILStorageMethods(typeof(TimeSpan)) },
System\Xml\Xsl\IlGen\XmlIlTypeHelper.cs (4)
102typeof(TimeSpan), // XmlTypeCode.YearMonthDuration 103typeof(TimeSpan), // XmlTypeCode.DayTimeDuration 160typeof(IList<TimeSpan>), // XmlTypeCode.YearMonthDuration 161typeof(IList<TimeSpan>), // XmlTypeCode.DayTimeDuration
System\Xml\Xsl\Runtime\XmlILStorageConverter.cs (1)
74public static XmlAtomicValue TimeSpanToAtomicValue(TimeSpan value, int index, XmlQueryRuntime runtime)
System.Private.Xml.Linq (19)
System\Xml\Linq\XAttribute.cs (8)
612/// Cast the value of this <see cref="XAttribute"/> to a <see cref="TimeSpan"/>. 615/// The <see cref="XAttribute"/> to cast to <see cref="TimeSpan"/>. 618/// The content of this <see cref="XAttribute"/> as a <see cref="TimeSpan"/>. 624public static explicit operator TimeSpan(XAttribute attribute) 632/// Cast the value of this <see cref="XAttribute"/> to a <see cref="TimeSpan"/>?. 635/// The <see cref="XAttribute"/> to cast to <see cref="TimeSpan"/>?. Can be null. 638/// The content of this <see cref="XAttribute"/> as a <see cref="TimeSpan"/>?. 642public static explicit operator TimeSpan?(XAttribute? attribute)
System\Xml\Linq\XContainer.cs (1)
822TimeSpan tsValue => XmlConvert.ToString(tsValue),
System\Xml\Linq\XElement.cs (10)
1778/// Cast the value of this <see cref="XElement"/> to a <see cref="TimeSpan"/>. 1781/// The <see cref="XElement"/> to cast to <see cref="TimeSpan"/>. 1784/// The content of this <see cref="XElement"/> as a <see cref="TimeSpan"/>. 1787/// Thrown if the specified element does not contain a valid <see cref="TimeSpan"/> value. 1793public static explicit operator TimeSpan(XElement element) 1801/// Cast the value of this <see cref="XElement"/> to an <see cref="TimeSpan"/>?. 1804/// The <see cref="XElement"/> to cast to <see cref="TimeSpan"/>?. 1807/// The content of this <see cref="XElement"/> as a <see cref="TimeSpan"/>?. 1810/// Thrown if the specified element does not contain a valid <see cref="TimeSpan"/> value. 1814public static explicit operator TimeSpan?(XElement? element)
System.Resources.Extensions (7)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
456else if (type == typeof(TimeSpan)) 569writer.Write(((TimeSpan)value!).Ticks);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (1)
598else if (type == typeof(TimeSpan))
System\Resources\Extensions\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (2)
119SZArrayRecord<TimeSpan> primitiveArray => primitiveArray.GetArray(), 155|| elementType == typeof(DateTime) || elementType == typeof(TimeSpan);
System\Resources\Extensions\PreserializedResourceWriter.cs (2)
56{ typeof(TimeSpan).FullName!, typeof(TimeSpan) }
System.Resources.Writer (2)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
456else if (type == typeof(TimeSpan)) 569writer.Write(((TimeSpan)value!).Ticks);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
848[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.TimeSpan))]
System.Runtime.Caching (36)
System\Runtime\Caching\CacheExpires.cs (8)
88private static readonly TimeSpan s_COUNT_INTERVAL = new TimeSpan(CacheExpires._tsPerBucket.Ticks / COUNTS_LENGTH); 760internal static readonly TimeSpan MIN_UPDATE_DELTA = new TimeSpan(0, 0, 1); 761internal static readonly TimeSpan MIN_FLUSH_INTERVAL = new TimeSpan(0, 0, 1); 762internal static readonly TimeSpan _tsPerBucket = new TimeSpan(0, 0, 20); 765private static readonly TimeSpan s_tsPerCycle = new TimeSpan(NUMBUCKETS * _tsPerBucket.Ticks); 845TimeSpan due = _tsPerBucket - (new TimeSpan(utcNow.Ticks % _tsPerBucket.Ticks)); 858due.Ticks / TimeSpan.TicksPerMillisecond, _tsPerBucket.Ticks / TimeSpan.TicksPerMillisecond);
System\Runtime\Caching\CacheItemPolicy.cs (2)
12private TimeSpan _sldExpiry; 37public TimeSpan SlidingExpiration
System\Runtime\Caching\CacheUsage.cs (3)
821internal static readonly TimeSpan NEWADD_INTERVAL = new TimeSpan(0, 0, 10); 822internal static readonly TimeSpan CORRELATED_REQUEST_TIMEOUT = new TimeSpan(0, 0, 1); 823internal static readonly TimeSpan MIN_LIFETIME_FOR_USAGE = NEWADD_INTERVAL;
System\Runtime\Caching\Configuration\ConfigUtil.cs (3)
68TimeSpan tValue; 69if (!TimeSpan.TryParse(sValue, out tValue) || tValue <= TimeSpan.Zero)
System\Runtime\Caching\Configuration\MemoryCacheElement.cs (4)
40typeof(TimeSpan), 41TimeSpan.FromMilliseconds(ConfigUtil.DefaultPollingTimeMilliseconds), 115public TimeSpan PollingInterval 119return (TimeSpan)base["pollingInterval"];
System\Runtime\Caching\MemoryCache.cs (5)
28private static readonly TimeSpan s_oneYear = new TimeSpan(365, 0, 0, 0); 307public TimeSpan PollingInterval 374TimeSpan slidingExp = ObjectCache.NoSlidingExpiration; 623TimeSpan slidingExp = ObjectCache.NoSlidingExpiration; 664TimeSpan slidingExpiration,
System\Runtime\Caching\MemoryCacheEntry.cs (5)
21private readonly TimeSpan _slidingExp; 78internal TimeSpan SlidingExp 109TimeSpan slidingExp, 121if (_slidingExp > TimeSpan.Zero) 290if (_slidingExp > TimeSpan.Zero)
System\Runtime\Caching\MemoryCacheStatistics.cs (2)
249internal TimeSpan PollingInterval 253return TimeSpan.FromMilliseconds(_configPollingInterval);
System\Runtime\Caching\MemoryCacheStore.cs (1)
135if (entry.InUsage() || entry.SlidingExp > TimeSpan.Zero)
System\Runtime\Caching\ObjectCache.cs (2)
21public static readonly TimeSpan NoSlidingExpiration = TimeSpan.Zero;
System\Runtime\Caching\PhysicalMemoryMonitor.cs (1)
18private const long TargetTotalMemoryTrimIntervalTicks = 5 * TimeSpan.TicksPerMinute;
System.Runtime.Serialization.Formatters (1)
System\Runtime\Serialization\Formatter.cs (1)
175protected abstract void WriteTimeSpan(TimeSpan val, string name);
System.Security.Cryptography (43)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (7)
29internal static byte[]? DownloadAsset(string uri, TimeSpan downloadTimeout) 36internal static Task<byte[]?> DownloadAssetAsync(string uri, TimeSpan downloadTimeout) 41private static async Task<byte[]?> DownloadAssetCore(string uri, TimeSpan downloadTimeout, bool async) 50if (downloadTimeout <= TimeSpan.Zero) 98private static extern TimeSpan GetPooledConnectionIdleTimeout([UnsafeAccessorType(SocketsHttpHandlerTypeName)] object handler); 106private static extern void SetPooledConnectionIdleTimeout([UnsafeAccessorType(SocketsHttpHandlerTypeName)] object handler, TimeSpan value); 177SetPooledConnectionIdleTimeout(socketsHttpHandler, TimeSpan.FromSeconds(PooledConnectionIdleTimeoutSeconds));
System\Security\Cryptography\X509Certificates\Asn1\TimeAsn.xml.cs (1)
105if (decoded.GeneralTime!.Value.Ticks % TimeSpan.TicksPerSecond != 0)
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
862long fractionalSeconds = notAfterLocalTicks % TimeSpan.TicksPerSecond;
System\Security\Cryptography\X509Certificates\ChainPal.cs (1)
23TimeSpan timeout,
System\Security\Cryptography\X509Certificates\ChainPal.OpenSsl.cs (8)
11private static readonly TimeSpan s_maxUrlRetrievalTimeout = TimeSpan.FromMinutes(1); 41TimeSpan timeout, 85TimeSpan timeout, 88if (timeout == TimeSpan.Zero) 91timeout = TimeSpan.FromSeconds(15); 93else if (timeout > s_maxUrlRetrievalTimeout || timeout < TimeSpan.Zero) 115TimeSpan downloadTimeout = timeout;
System\Security\Cryptography\X509Certificates\OpenSslCachedDirectoryStoreProvider.cs (5)
16private static readonly TimeSpan s_lastWriteRecheckInterval = TimeSpan.FromSeconds(1); 17private static readonly TimeSpan s_assumeInvalidInterval = TimeSpan.FromSeconds(30); 41TimeSpan elapsed = _recheckStopwatch.Elapsed;
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (8)
21private static readonly TimeSpan s_lastWriteRecheckInterval = TimeSpan.FromSeconds(5); 22private static readonly TimeSpan s_assumeInvalidInterval = TimeSpan.FromMinutes(5); 89TimeSpan elapsed = s_recheckStopwatch.Elapsed; 390lastModified = DateTime.UnixEpoch + TimeSpan.FromTicks(status.MTime * TimeSpan.TicksPerSecond + status.MTimeNsec / TimeSpan.NanosecondsPerTick);
System\Security\Cryptography\X509Certificates\OpenSslCertificateAssetDownloader.cs (4)
16internal static X509Certificate2? DownloadCertificate(string uri, TimeSpan downloadTimeout) 58internal static SafeX509CrlHandle? DownloadCrl(string uri, TimeSpan downloadTimeout) 105internal static SafeOcspResponseHandle? DownloadOcspGet(string uri, TimeSpan downloadTimeout) 133private static byte[]? DownloadAsset(string uri, TimeSpan downloadTimeout)
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (2)
33TimeSpan downloadTimeout) 207TimeSpan downloadTimeout)
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (4)
50private readonly TimeSpan _downloadTimeout; 59TimeSpan downloadTimeout) 99TimeSpan remainingDownloadTime) 1201TimeSpan downloadTimeout)
System\Security\Cryptography\X509Certificates\X509ChainPolicy.cs (2)
119public TimeSpan UrlRetrievalTimeout { get; set; } 134UrlRetrievalTimeout = TimeSpan.Zero; // default timeout
System.ServiceModel.Federation (83)
System\IdentityModel\Security\WrapperSecurityCommunicationObject.cs (28)
35protected override TimeSpan DefaultCloseTimeout 40protected override TimeSpan DefaultOpenTimeout 50protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 55protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 60protected override void OnClose(TimeSpan timeout) 93protected override void OnOpen(TimeSpan timeout) 110internal Task OnCloseAsync(TimeSpan timeout) 115internal Task OnOpenAsync(TimeSpan timeout) 208public virtual TimeSpan DefaultOpenTimeout 213public virtual TimeSpan DefaultCloseTimeout 229public void Close(TimeSpan timeout) 239public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 254public void Open(TimeSpan timeout) 264public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 284public virtual Task OnCloseAsync(TimeSpan timeout) 302public virtual Task OnOpenAsync(TimeSpan timeout) 360public virtual TimeSpan DefaultOpenTimeout 365public virtual TimeSpan DefaultCloseTimeout 381public void Close(TimeSpan timeout) 391public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 406public void Open(TimeSpan timeout) 416public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 436public IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 441public IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 446public virtual void OnClose(TimeSpan timeout) 450public Task OnCloseAsync(TimeSpan timeout) 478public virtual void OnOpen(TimeSpan timeout) 482public Task OnOpenAsync(TimeSpan timeout)
System\Runtime\OperationWithTimeoutAsyncResult.cs (3)
18private Action<TimeSpan> _operationWithTimeout; 20public OperationWithTimeoutAsyncResult(Action<TimeSpan> operationWithTimeout, TimeSpan timeout, AsyncCallback callback, object state)
System\Runtime\TaskHelpers.cs (3)
159private static readonly TimeSpan s_maxWait = TimeSpan.FromMilliseconds(int.MaxValue); 161public static bool WaitForCompletionNoSpin(this Task task, TimeSpan timeout)
System\Runtime\TimeoutHelper.cs (13)
11public static readonly TimeSpan MaxWait = TimeSpan.FromMilliseconds(int.MaxValue); 17public TimeoutHelper(TimeSpan timeout) 19Contract.Assert(timeout >= TimeSpan.Zero, "timeout must be non-negative"); 23_deadlineSet = (timeout == TimeSpan.MaxValue); 26public TimeSpan OriginalTimeout { get; } 28public static bool IsTooLarge(TimeSpan timeout) 30return (timeout > MaxWait) && (timeout != TimeSpan.MaxValue); 107public TimeSpan RemainingTime() 116return TimeSpan.MaxValue; 120TimeSpan remaining = _deadline - DateTime.UtcNow; 121if (remaining <= TimeSpan.Zero) 123return TimeSpan.Zero;
System\ServiceModel\Federation\WSTrustChannel.cs (8)
215/// The <see cref="TimeSpan" /> that specifies how long the close operation has to complete before timing out. 226IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 252/// The <see cref="TimeSpan" /> that specifies how long the open operation has to complete before timing out. 263IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 289/// The <see cref="TimeSpan" /> that specifies how long the open operation has to complete before timing out. 291void ICommunicationObject.Close(TimeSpan timeout) 326/// The <see cref="TimeSpan" /> that specifies how long the open operation has to complete before timing out. 328void ICommunicationObject.Open(TimeSpan timeout)
System\ServiceModel\Federation\WSTrustChannelSecurityTokenProvider.cs (11)
213protected override IAsyncResult BeginGetTokenCore(TimeSpan timeout, AsyncCallback callback, object state) 227private async Task<SecurityToken> GetTokenAsyncCore(TimeSpan timeout) 266protected override SecurityToken GetTokenCore(TimeSpan timeout) 448async Task ISecurityCommunicationObject.OnCloseAsync(TimeSpan timeout) 457async Task ISecurityCommunicationObject.OnOpenAsync(TimeSpan timeout) 483TimeSpan ISecurityCommunicationObject.DefaultOpenTimeout => ServiceDefaults.OpenTimeout; 484TimeSpan ISecurityCommunicationObject.DefaultCloseTimeout => ServiceDefaults.CloseTimeout; 533void ICommunicationObject.Close(TimeSpan timeout) 543IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 558void ICommunicationObject.Open(TimeSpan timeout) 568IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Federation\WsTrustTokenParameters.cs (5)
37public static readonly TimeSpan DefaultMaxIssuedTokenCachingTime = TimeSpan.MaxValue; 44private TimeSpan _maxIssuedTokenCachingTime = DefaultMaxIssuedTokenCachingTime; 152public TimeSpan MaxIssuedTokenCachingTime 155set => _maxIssuedTokenCachingTime = value <= TimeSpan.Zero
System\ServiceModel\Security\ISecurityCommunicationObject.cs (4)
12TimeSpan DefaultOpenTimeout { get; } 13TimeSpan DefaultCloseTimeout { get; } 15Task OnCloseAsync(TimeSpan timeout); 19Task OnOpenAsync(TimeSpan timeout);
System\ServiceModel\Security\ServiceDefaults.cs (8)
10public static TimeSpan CloseTimeout { get { return TimeSpan.FromMinutes(1); } } 11public static TimeSpan OpenTimeout { get { return TimeSpan.FromMinutes(1); } } 12public static TimeSpan ReceiveTimeout { get { return TimeSpan.FromMinutes(10); } } 13public static TimeSpan SendTimeout { get { return TimeSpan.FromMinutes(1); } }
System.ServiceModel.Http (101)
System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (4)
42protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 52protected override void OnOpen(TimeSpan timeout) 57protected internal override async Task OnOpenAsync(TimeSpan timeout) 138private async Task ConfigureClientWebSocketAsync(ClientWebSocket clientWebSocket, TimeSpan timeout)
System\ServiceModel\Channels\HttpChannelFactory.cs (17)
247SecurityTokenContainer clientCertificateToken, TimeSpan timeout) 444private async Task<SecurityTokenProviderContainer> CreateAndOpenTokenProviderAsync(TimeSpan timeout, AuthenticationSchemes authenticationScheme, 574protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 584protected override void OnOpen(TimeSpan timeout) 598internal protected override Task OnOpenAsync(TimeSpan timeout) 604protected internal override Task OnCloseAsync(TimeSpan timeout) 742private async Task<(SecurityTokenProviderContainer tokenProvider, SecurityTokenProviderContainer proxyTokenProvider)> CreateAndOpenTokenProvidersCoreAsync(EndpointAddress to, Uri via, ChannelParameterCollection channelParameters, TimeSpan timeout) 759internal Task<(SecurityTokenProviderContainer tokenProvider, SecurityTokenProviderContainer proxyTokenProvider)> CreateAndOpenTokenProvidersAsync(EndpointAddress to, Uri via, ChannelParameterCollection channelParameters, TimeSpan timeout) 827private async Task CreateAndOpenTokenProvidersAsync(TimeSpan timeout) 836private void CloseTokenProviders(TimeSpan timeout) 853protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 863protected override void OnOpen(TimeSpan timeout) 868internal protected override Task OnOpenAsync(TimeSpan timeout) 885protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 895protected override void OnClose(TimeSpan timeout) 900protected internal override async Task OnCloseAsync(TimeSpan timeout) 1383public async Task<IWebProxy> CreateWebProxyAsync(AuthenticationLevel requestAuthenticationLevel, TokenImpersonationLevel requestImpersonationLevel, SecurityTokenProviderContainer tokenProvider, TimeSpan timeout)
System\ServiceModel\Channels\HttpChannelHelpers.cs (2)
60TimeSpan timeout) 73AuthenticationSchemes authenticationScheme, SecurityTokenProviderContainer credentialProvider, TimeSpan timeout)
System\ServiceModel\Channels\HttpsChannelFactory.cs (10)
141protected override void OnOpen(TimeSpan timeout) 147protected internal override async Task OnOpenAsync(TimeSpan timeout) 153internal async Task<SecurityTokenProvider> CreateAndOpenCertificateTokenProviderAsync(EndpointAddress target, Uri via, ChannelParameterCollection channelParameters, TimeSpan timeout) 321private async Task CreateAndOpenTokenProviderAsync(TimeSpan timeout) 329private void CloseTokenProvider(TimeSpan timeout) 345protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 355protected override void OnOpen(TimeSpan timeout) 360internal protected override async Task OnOpenAsync(TimeSpan timeout) 373protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 380protected override void OnClose(TimeSpan timeout)
System\ServiceModel\Channels\HttpTransportDefaults.cs (1)
52public static readonly TimeSpan DefaultKeepAliveInterval = TimeSpanHelper.FromSeconds(0, DefaultKeepAliveIntervalString);
System\ServiceModel\Channels\IMessageSource.cs (2)
12Task<Message> ReceiveAsync(TimeSpan timeout); 13Task<bool> WaitForMessageAsync(TimeSpan timeout);
System\ServiceModel\Channels\SynchronizedMessageSource.cs (2)
23public async Task<bool> WaitForMessageAsync(TimeSpan timeout) 47public async Task<Message> ReceiveAsync(TimeSpan timeout)
System\ServiceModel\Channels\TransportDuplexSessionChannel.cs (30)
62public Message Receive(TimeSpan timeout) 72public async Task<Message> ReceiveAsync(TimeSpan timeout) 108public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) 118public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 143public async Task<(bool, Message)> TryReceiveAsync(TimeSpan timeout) 161public bool TryReceive(TimeSpan timeout, out Message message) 179public async Task<bool> WaitForMessageAsync(TimeSpan timeout) 203public bool WaitForMessage(TimeSpan timeout) 208public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 223protected abstract Task CloseOutputSessionCoreAsync(TimeSpan timeout); 225protected abstract void CloseOutputSessionCore(TimeSpan timeout); 227protected async Task CloseOutputSessionAsync(TimeSpan timeout) 282protected void CloseOutputSession(TimeSpan timeout) 338protected abstract void ReturnConnectionIfNecessary(bool abort, TimeSpan timeout); 342ReturnConnectionIfNecessary(true, TimeSpan.Zero); 348ReturnConnectionIfNecessary(true, TimeSpan.Zero); 351protected internal override async Task OnCloseAsync(TimeSpan timeout) 366protected override void OnClose(TimeSpan timeout) 371protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 431protected abstract AsyncCompletionResult StartWritingBufferedMessage(Message message, ArraySegment<byte> messageData, bool allowOutputBatching, TimeSpan timeout, Action<object> callback, object state); 433protected abstract AsyncCompletionResult BeginCloseOutput(TimeSpan timeout, Action<object> callback, object state); 441protected abstract void OnSendCore(Message message, TimeSpan timeout); 443protected abstract AsyncCompletionResult StartWritingStreamedMessage(Message message, TimeSpan timeout, Action<object> callback, object state); 445protected override async Task OnSendAsync(Message message, TimeSpan timeout) 550protected override void OnSend(Message message, TimeSpan timeout) 601protected abstract void CompleteClose(TimeSpan timeout); 612private async Task EnsureInputClosedAsync(TimeSpan timeout) 706public IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state) 721public void CloseOutputSession(TimeSpan timeout) 731public Task CloseOutputSessionAsync(TimeSpan timeout)
System\ServiceModel\Channels\WebSocketHelper.cs (6)
119internal static void ThrowCorrectException(Exception ex, TimeSpan timeout, string operation) 128TimeSpan.MinValue, // this is a dummy since operation type is null, so the timespan value won't be used 134internal static Exception ConvertAndTraceException(Exception ex, TimeSpan timeout, string operation) 188internal static void ThrowExceptionOnTaskFailure(Task task, TimeSpan timeout, string operation) 201internal static Exception CreateExceptionOnTaskFailure(Task task, TimeSpan timeout, string operation) 214internal static TimeoutException GetTimeoutException(Exception innerException, TimeSpan timeout, string operation)
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (23)
72protected override void CompleteClose(TimeSpan timeout) 91protected override void CloseOutputSessionCore(TimeSpan timeout) 105protected override async Task CloseOutputSessionCoreAsync(TimeSpan timeout) 137protected override void OnClose(TimeSpan timeout) 149protected internal override async Task OnCloseAsync(TimeSpan timeout) 161protected override void ReturnConnectionIfNecessary(bool abort, TimeSpan timeout) 165protected override AsyncCompletionResult StartWritingBufferedMessage(Message message, ArraySegment<byte> messageData, bool allowOutputBatching, TimeSpan timeout, Action<object> callback, object state) 205protected override AsyncCompletionResult StartWritingStreamedMessage(Message message, TimeSpan timeout, Action<object> callback, object state) 227protected override AsyncCompletionResult BeginCloseOutput(TimeSpan timeout, Action<object> callback, object state) 245protected override void OnSendCore(Message message, TimeSpan timeout) 380private async void HandleCloseOutputAsyncCompletion(Task task, TimeSpan timeout, Action<object> callback, object state) 396private async void HandleSendAsyncCompletion(Task task, TimeSpan timeout, Action<object> callback, object state) 458private TimeSpan _asyncReceiveTimeout; 500public async Task<Message> ReceiveAsync(TimeSpan timeout) 522public Message Receive(TimeSpan timeout) 527private async Task<Message> ReceiveAsyncInternal(TimeSpan timeout) 586WebSocketHelper.ThrowCorrectException(ex, TimeSpan.MaxValue, WebSocketHelper.ReceiveOperation); 616_pendingException = WebSocketHelper.ConvertAndTraceException(ex, TimeSpan.MaxValue, WebSocketHelper.ReceiveOperation); 627public bool WaitForMessage(TimeSpan timeout) 646public async Task<bool> WaitForMessageAsync(TimeSpan timeout) 862private readonly TimeSpan _closeTimeout; 882TimeSpan closeTimeout) 898TimeSpan closeTimeout)
System\ServiceModel\Channels\WebSocketTransportSettings.cs (4)
23private TimeSpan _keepAliveInterval; 56[DefaultValue(typeof(TimeSpan), WebSocketDefaults.DefaultKeepAliveIntervalString)] 57public TimeSpan KeepAliveInterval 66if (value < TimeSpan.Zero && value != Timeout.InfiniteTimeSpan)
System.ServiceModel.Http.Tests (64)
ServiceModel\BasicHttpBindingTest.cs (36)
29Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.CloseTimeout); 30Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.OpenTimeout); 31Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(10), binding.ReceiveTimeout); 32Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.SendTimeout); 54Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.CloseTimeout); 55Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.OpenTimeout); 56Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(10), binding.ReceiveTimeout); 57Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.SendTimeout); 78Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.CloseTimeout); 79Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.OpenTimeout); 80Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(10), binding.ReceiveTimeout); 81Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.SendTimeout); 222public static void CloseTimeout_Property_Sets(TimeSpan timeSpan) 226Assert.Equal<TimeSpan>(timeSpan, binding.CloseTimeout); 231public static void CloseTimeout_Property_Set_Invalid_Value_Throws(TimeSpan timeSpan) 239public static void OpenTimeout_Property_Sets(TimeSpan timeSpan) 243Assert.Equal<TimeSpan>(timeSpan, binding.OpenTimeout); 248public static void OpenTimeout_Property_Set_Invalid_Value_Throws(TimeSpan timeSpan) 256public static void SendTimeout_Property_Sets(TimeSpan timeSpan) 260Assert.Equal<TimeSpan>(timeSpan, binding.SendTimeout); 265public static void SendTimeout_Property_Set_Invalid_Value_Throws(TimeSpan timeSpan) 273public static void ReceiveTimeout_Property_Sets(TimeSpan timeSpan) 277Assert.Equal<TimeSpan>(timeSpan, binding.ReceiveTimeout); 282public static void ReceiveTimeout_Property_Set_Invalid_Value_Throws(TimeSpan timeSpan)
ServiceModel\BasicHttpsBindingTest.cs (28)
27Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.CloseTimeout); 28Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.OpenTimeout); 29Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(10), binding.ReceiveTimeout); 30Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.SendTimeout); 52Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.CloseTimeout); 53Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.OpenTimeout); 54Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(10), binding.ReceiveTimeout); 55Assert.Equal<TimeSpan>(TimeSpan.FromMinutes(1), binding.SendTimeout); 212public static void CloseTimeout_Property_Sets(TimeSpan timeSpan) 216Assert.Equal<TimeSpan>(timeSpan, binding.CloseTimeout); 221public static void CloseTimeout_Property_Set_Invalid_Value_Throws(TimeSpan timeSpan) 229public static void OpenTimeout_Property_Sets(TimeSpan timeSpan) 233Assert.Equal<TimeSpan>(timeSpan, binding.OpenTimeout); 238public static void OpenTimeout_Property_Set_Invalid_Value_Throws(TimeSpan timeSpan) 246public static void SendTimeout_Property_Sets(TimeSpan timeSpan) 250Assert.Equal<TimeSpan>(timeSpan, binding.SendTimeout); 255public static void SendTimeout_Property_Set_Invalid_Value_Throws(TimeSpan timeSpan) 263public static void ReceiveTimeout_Property_Sets(TimeSpan timeSpan) 267Assert.Equal<TimeSpan>(timeSpan, binding.ReceiveTimeout); 272public static void ReceiveTimeout_Property_Set_Invalid_Value_Throws(TimeSpan timeSpan)
System.ServiceModel.NetFramingBase (211)
System\ServiceModel\Channels\BufferedConnection.cs (13)
18private TimeSpan _pendingTimeout; 21public BufferedConnection(IConnection connection, TimeSpan flushTimeout, int writeBufferSize) 35_pendingTimeout = TimeSpan.Zero; 39private async ValueTask FlushAsync(TimeSpan timeout) 54private async ValueTask FlushCoreAsync(TimeSpan timeout) 77_pendingTimeout = TimeSpan.Zero; 108public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, bool immediate, TimeSpan timeout) 129private async ValueTask WriteNowAsync(ReadOnlyMemory<byte> buffer, TimeSpan timeout) 161private async ValueTask WriteLaterAsync(ReadOnlyMemory<byte> buffer, TimeSpan timeout) 239private TimeSpan _flushTimeout; 242public BufferedConnectionInitiator(IConnectionInitiator connectionInitiator, TimeSpan flushTimeout, int writeBufferSize) 249protected TimeSpan FlushTimeout => _flushTimeout; 253public async ValueTask<IConnection> ConnectAsync(Uri uri, TimeSpan timeout)
System\ServiceModel\Channels\Connection.cs (18)
17ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout); 18ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, bool immediate, TimeSpan timeout); 20ValueTask CloseAsync(TimeSpan timeout); 25ValueTask<IConnection> ConnectAsync(Uri uri, TimeSpan timeout); 38public virtual ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout) => Connection.ReadAsync(buffer, timeout); 39public virtual ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, bool immediate, TimeSpan timeout) => Connection.WriteAsync(buffer, immediate, timeout); 40public virtual ValueTask CloseAsync(TimeSpan timeout) => Connection.CloseAsync(timeout); 68public override ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout) 118public TimeSpan CloseTimeout { get; set; } 263protected int Read(byte[] buffer, int offset, int count, TimeSpan timeout) 292public async ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout) 305public async ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, bool immediate, TimeSpan timeout) 320public async ValueTask CloseAsync(TimeSpan timeout) 364public void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout) 378public void Write(byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout, BufferManager bufferManager) 384private void SetReadTimeout(TimeSpan timeout) 394private void SetWriteTimeout(TimeSpan timeout) 404public int Read(byte[] buffer, int offset, int size, TimeSpan timeout)
System\ServiceModel\Channels\ConnectionOrientedTransportBindingElement.cs (1)
83internal TimeSpan MaxOutputDelay { get; }
System\ServiceModel\Channels\ConnectionPool.cs (16)
43protected abstract ValueTask CloseItemAsync(TItem item, TimeSpan timeout); 52public async ValueTask<bool> CloseAsync(TimeSpan timeout) 117private EndpointConnectionPool GetEndpointPool(TKey key, TimeSpan timeout) 170private async ValueTask OnCloseAsync(TimeSpan timeout) 194public void AddConnection(TKey key, TItem connection, TimeSpan timeout) 201public TItem TakeConnection(EndpointAddress address, Uri via, TimeSpan timeout, out TKey key) 209public void ReturnConnection(TKey key, TItem connection, bool connectionIsStillGood, TimeSpan timeout) 288protected virtual ValueTask CloseItemAsync(TItem item, TimeSpan timeout) 315public async ValueTask CloseAsync(TimeSpan timeout) 389public void AddConnection(TItem connection, TimeSpan timeout) 422public TItem TakeConnection(TimeSpan timeout) 478public void ReturnConnection(TItem connection, bool connectionIsStillGood, TimeSpan timeout) 516public void CloseIdleConnection(TItem connection, TimeSpan timeout) 609private readonly TimeSpan _maxOutputDelay; 614public ConnectionPool(IConnectionOrientedTransportChannelFactorySettings settings, TimeSpan leaseTimeout) 635protected override async ValueTask CloseItemAsync(IConnection item, TimeSpan timeout)
System\ServiceModel\Channels\ConnectionPoolHelper.cs (9)
44protected abstract TimeoutException CreateNewConnectionTimeoutException(TimeSpan timeout, TimeoutException innerException); 46private IConnection TakeConnection(TimeSpan timeout) 51public async Task<IConnection> EstablishConnectionAsync(TimeSpan timeout) 88_connectionPool.ReturnConnection(_connectionKey, localRawConnection, false, TimeSpan.Zero); 98TimeSpan connectTimeout = timeoutHelper.RemainingTime(); 144_connectionPool.ReturnConnection(_connectionKey, rawConnection, false, TimeSpan.Zero); 162ReleaseConnection(true, TimeSpan.Zero); 165public void Close(TimeSpan timeout) 170private void ReleaseConnection(bool abort, TimeSpan timeout)
System\ServiceModel\Channels\ConnectionPoolRegistry.cs (5)
63TimeSpan leaseTimeout = TimeSpan.MaxValue; 69TimeSpan poolLeaseTimeout = connectionPoolSettings.GetConnectionPoolSetting<TimeSpan>("LeaseTimeout"); 77public async ValueTask ReleaseAsync(ConnectionPool pool, TimeSpan timeout)
System\ServiceModel\Channels\ConnectionUtilities.cs (1)
10internal static async ValueTask CloseNoThrowAsync(IConnection connection, TimeSpan timeout)
System\ServiceModel\Channels\FramingChannels.cs (14)
42protected override ValueTask CloseOutputSessionCoreAsync(TimeSpan timeout) 47protected override void CompleteClose(TimeSpan timeout) 52protected override async ValueTask OnSendCoreAsync(Message message, TimeSpan timeout) 65protected override ValueTask CloseOutputAsync(TimeSpan timeout) 70protected override ValueTask StartWritingBufferedMessage(Message message, ArraySegment<byte> messageData, bool allowOutputBatching, TimeSpan timeout) 75protected override ValueTask StartWritingStreamedMessage(Message message, TimeSpan timeout) 187protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 209private async Task<IConnection> SendPreambleAsync(IConnection connection, Memory<byte> preamble, TimeSpan timeout) 268internal protected override async Task OnOpenAsync(TimeSpan timeout) 299protected override void OnOpen(TimeSpan timeout) 304protected override void ReturnConnectionIfNecessary(bool abort, TimeSpan timeout) 358protected override TimeoutException CreateNewConnectionTimeoutException(TimeSpan timeout, TimeoutException innerException) 375Uri via, string contentType, TimeSpan timeout) 419ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeSpan timeout)
System\ServiceModel\Channels\IdlingCommunicationPool.cs (10)
17private TimeSpan _leaseTimeout; 19protected IdlingCommunicationPool(int maxCount, TimeSpan idleTimeout, TimeSpan leaseTimeout) 26public TimeSpan IdleTimeout { get; } 28protected TimeSpan LeaseTimeout 35if (IdleTimeout != TimeSpan.MaxValue || _leaseTimeout != TimeSpan.MaxValue) 66protected override ValueTask CloseItemAsync(TItem item, TimeSpan timeout) 87private TimeSpan _idleTimeout; 88private TimeSpan _leaseTimeout;
System\ServiceModel\Channels\IMessageSource.cs (2)
12Task<Message> ReceiveAsync(TimeSpan timeout); 13Task<bool> WaitForMessageAsync(TimeSpan timeout);
System\ServiceModel\Channels\ITransportFactorySettings.cs (2)
9TimeSpan MaxOutputDelay { get; } 10TimeSpan IdleTimeout { get; }
System\ServiceModel\Channels\NetFramingTransportChannelFactory.cs (11)
23string connectionPoolGroupName, TimeSpan idleTimeout, 112public TimeSpan IdleTimeout { get; } 122public TimeSpan MaxOutputDelay { get; } 210internal ValueTask ReleaseConnectionPoolAsync(ConnectionPool pool, TimeSpan timeout) 216protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) => OnCloseAsync(timeout).ToApm(callback, state); 273ReleaseConnectionPoolAsync(localConnectionPool, TimeSpan.Zero).GetAwaiter().GetResult(); 283protected override void OnClose(TimeSpan timeout) 312protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 322protected override void OnOpen(TimeSpan timeout) 331internal protected override Task OnOpenAsync(TimeSpan timeout) 341internal protected override async Task OnCloseAsync(TimeSpan timeout)
System\ServiceModel\Channels\OutputChannel.cs (8)
26public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 33if (timeout < TimeSpan.Zero) 66protected abstract void OnSend(Message message, TimeSpan timeout); 68protected abstract Task OnSendAsync(Message message, TimeSpan timeout); 75public void Send(Message message, TimeSpan timeout) 82if (timeout < TimeSpan.Zero) 100public Task SendAsync(Message message, TimeSpan timeout) 107if (timeout < TimeSpan.Zero)
System\ServiceModel\Channels\SessionConnectionReader.cs (5)
34private Message DecodeMessage(TimeSpan timeout) 50protected abstract Message DecodeMessage(byte[] buffer, ref int offset, ref int size, ref bool isAtEof, TimeSpan timeout); 62public async Task<Message> ReceiveAsync(TimeSpan timeout) 147public async Task<bool> WaitForMessageAsync(TimeSpan timeout) 225protected override Message DecodeMessage(byte[] buffer, ref int offset, ref int size, ref bool isAtEOF, TimeSpan timeout)
System\ServiceModel\Channels\SingletonConnectionReader.cs (4)
60private void DoneReceiving(bool atEof, TimeSpan timeout) 74public void Close(TimeSpan timeout) 116protected abstract void OnClose(TimeSpan timeout); 118public void DoneSending(TimeSpan timeout)
System\ServiceModel\Channels\SslStreamSecurityUpgradeProvider.cs (8)
155protected override void OnClose(TimeSpan timeout) 161protected internal override Task OnCloseAsync(TimeSpan timeout) 171protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 203protected override void OnOpen(TimeSpan timeout) 208protected internal override async Task OnOpenAsync(TimeSpan timeout) 223protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 328internal override async ValueTask OpenAsync(TimeSpan timeout) 339internal override async ValueTask CloseAsync(TimeSpan timeout)
System\ServiceModel\Channels\StreamedFramingRequestChannel.cs (9)
36protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) => Task.CompletedTask.ToApm(callback, state); 40protected override void OnOpen(TimeSpan timeout) { } 42protected internal override Task OnOpenAsync(TimeSpan timeout) => Task.CompletedTask; 108protected override void OnClose(TimeSpan timeout) => base.WaitForPendingRequests(timeout); 110protected internal override Task OnCloseAsync(TimeSpan timeout) => Task.CompletedTask; 120protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) => WaitForPendingRequestsAsync(timeout).ToApm(callback, state); 142protected override TimeoutException CreateNewConnectionTimeoutException(TimeSpan timeout, TimeoutException innerException) => new TimeoutException(SR.Format(SR.RequestTimedOutEstablishingTransportSession, 195protected override void OnClose(TimeSpan timeout) => _connectionPoolHelper.Close(timeout); 261_connectionReader.DoneSending(TimeSpan.Zero);
System\ServiceModel\Channels\StreamSecurityUpgradeInitiatorBase.cs (3)
54await OpenAsync(TimeSpan.Zero); 63internal override async ValueTask OpenAsync(TimeSpan timeout) 69internal override async ValueTask CloseAsync(TimeSpan timeout)
System\ServiceModel\Channels\StreamUpgradeInitiator.cs (2)
14internal virtual ValueTask OpenAsync(TimeSpan timeout) => default; 15internal virtual ValueTask CloseAsync(TimeSpan timeout) => default;
System\ServiceModel\Channels\StreamUpgradeProvider.cs (4)
10private TimeSpan _closeTimeout; 11private TimeSpan _openTimeout; 32protected override TimeSpan DefaultCloseTimeout 37protected override TimeSpan DefaultOpenTimeout
System\ServiceModel\Channels\SynchronizedMessageSource.cs (2)
21public async Task<bool> WaitForMessageAsync(TimeSpan timeout) 45public async Task<Message> ReceiveAsync(TimeSpan timeout)
System\ServiceModel\Channels\TransportChannelFactory.cs (2)
112protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 118protected override void OnClose(TimeSpan timeout)
System\ServiceModel\Channels\TransportDefaults.cs (2)
41public static TimeSpan MaxOutputDelay => TimeSpan.FromMilliseconds(200);
System\ServiceModel\Channels\TransportDuplexSessionChannel.cs (28)
65public Message Receive(TimeSpan timeout) 75public async Task<Message> ReceiveAsync(TimeSpan timeout) 111public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) 121public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 145public async Task<(bool, Message)> TryReceiveAsync(TimeSpan timeout) 163public bool TryReceive(TimeSpan timeout, out Message message) 181public async Task<bool> WaitForMessageAsync(TimeSpan timeout) 205public bool WaitForMessage(TimeSpan timeout) 210public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 231protected abstract ValueTask CloseOutputSessionCoreAsync(TimeSpan timeout); 233protected async Task CloseOutputSessionAsync(TimeSpan timeout) 289protected abstract void ReturnConnectionIfNecessary(bool abort, TimeSpan timeout); 293ReturnConnectionIfNecessary(true, TimeSpan.Zero); 299ReturnConnectionIfNecessary(true, TimeSpan.Zero); 302protected internal override async Task OnCloseAsync(TimeSpan timeout) 317protected override void OnClose(TimeSpan timeout) 322protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 382protected abstract ValueTask StartWritingBufferedMessage(Message message, ArraySegment<byte> messageData, bool allowOutputBatching, TimeSpan timeout); 384protected abstract ValueTask CloseOutputAsync(TimeSpan timeout); 388protected abstract ValueTask OnSendCoreAsync(Message message, TimeSpan timeout); 390protected abstract ValueTask StartWritingStreamedMessage(Message message, TimeSpan timeout); 392protected override async Task OnSendAsync(Message message, TimeSpan timeout) 468protected override void OnSend(Message message, TimeSpan timeout) 519protected abstract void CompleteClose(TimeSpan timeout); 530private async Task EnsureInputClosedAsync(TimeSpan timeout) 624public IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state) 639public void CloseOutputSession(TimeSpan timeout) 649public Task CloseOutputSessionAsync(TimeSpan timeout)
System\ServiceModel\Channels\TransportSecurityHelpers.cs (3)
26public static async ValueTask<(NetworkCredential credential, TokenImpersonationLevel impersonationLevel, bool allowNtlm)> GetSspiCredentialAsync(SecurityTokenProvider tokenProvider, TimeSpan timeout) 34SecurityTokenProvider tokenProvider, TimeSpan timeout) 86private static async Task<T> GetTokenAsync<T>(SecurityTokenProvider tokenProvider, TimeSpan timeout)
System\ServiceModel\Channels\WindowsStreamSecurityUpgradeProvider.cs (8)
65protected override void OnClose(TimeSpan timeout) 69protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 79protected internal override Task OnCloseAsync(TimeSpan timeout) 84protected override void OnOpen(TimeSpan timeout) 88protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 98protected internal override Task OnOpenAsync(TimeSpan timeout) 130internal override async ValueTask OpenAsync(TimeSpan timeout) 139internal override async ValueTask CloseAsync(TimeSpan timeout)
System\ServiceModel\Security\SecurityUtilsEx.cs (6)
38internal static Task CloseTokenProviderIfRequiredAsync(SecurityTokenProvider tokenProvider, TimeSpan timeout) 43internal static Task OpenTokenProviderIfRequiredAsync(SecurityTokenProvider tokenProvider, TimeSpan timeout) 53internal static Task CloseTokenAuthenticatorIfRequiredAsync(SecurityTokenAuthenticator tokenAuthenticator, TimeSpan timeout) 58internal static Task OpenTokenAuthenticatorIfRequiredAsync(SecurityTokenAuthenticator tokenAuthenticator, TimeSpan timeout) 85private static Task CloseCommunicationObjectAsync(object obj, TimeSpan timeout) 103private static Task OpenCommunicationObjectAsync(ICommunicationObject obj, TimeSpan timeout)
System\ServiceModel\TimeSpanHelper.cs (15)
11static public TimeSpan FromMinutes(int minutes, string text) 13TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMinute * minutes); 14Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 17static public TimeSpan FromSeconds(int seconds, string text) 19TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerSecond * seconds); 20Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 23static public TimeSpan FromMilliseconds(int ms, string text) 25TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMillisecond * ms); 26Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), "");
System.ServiceModel.NetNamedPipe (56)
System\Runtime\BackoffTimeoutHelper.cs (22)
11private static readonly long s_maxDriftTicks = s_maxSkewMilliseconds * TimeSpan.TicksPerMillisecond * 2; 12private static readonly TimeSpan s_defaultInitialWaitTime = TimeSpan.FromMilliseconds(1); 13private static readonly TimeSpan s_defaultMaxWaitTime = TimeSpan.FromMinutes(1); 15private readonly TimeSpan _maxWaitTime; 16private TimeSpan _waitTime; 19internal BackoffTimeoutHelper(TimeSpan timeout) 24internal BackoffTimeoutHelper(TimeSpan timeout, TimeSpan maxWaitTime) 29internal BackoffTimeoutHelper(TimeSpan timeout, TimeSpan maxWaitTime, TimeSpan initialWaitTime) 37public TimeSpan OriginalTimeout { get; } 39private void Reset(TimeSpan timeout, TimeSpan initialWaitTime) 41if (timeout == TimeSpan.MaxValue) 70private TimeSpan WaitTimeWithDrift() 86_waitTime = TimeSpan.FromTicks(_waitTime.Ticks * 2); 91TimeSpan remainingTime = _deadline - DateTime.UtcNow; 95if (_waitTime < TimeSpan.Zero) 97_waitTime = TimeSpan.Zero;
System\ServiceModel\Channels\IConnectionOrientedConnectionSettings.cs (2)
9TimeSpan MaxOutputDelay { get; } 10TimeSpan IdleTimeout { get; }
System\ServiceModel\Channels\NamedPipeConnectionPoolSettings.cs (3)
13private TimeSpan _idleTimeout; 42public TimeSpan IdleTimeout 47if (value < TimeSpan.Zero)
System\ServiceModel\Channels\PipeConnection.cs (5)
114public async ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout) 160public async ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, bool immediate, TimeSpan timeout) 195public async ValueTask CloseAsync(TimeSpan timeout) 440private async ValueTask WaitForReadZero(ValueTask<int> readTask, TimeSpan timeout, bool traceExceptionsAsErrors) 477private async ValueTask WaitForWriteZero(ValueTask writeTask, TimeSpan timeout, bool traceExceptionsAsErrors)
System\ServiceModel\Channels\PipeConnectionInitiator.cs (7)
37public async ValueTask<IConnection> ConnectAsync(Uri remoteUri, TimeSpan timeout) 144private void PrepareConnect(Uri remoteUri, TimeSpan timeout, out string resolvedAddress, out BackoffTimeoutHelper backoffHelper) 155TimeSpan backoffTimeout; 156if (timeout >= TimeSpan.FromMilliseconds(backoffBufferMilliseconds * 2)) 158backoffTimeout = TimeoutHelper.Add(timeout, TimeSpan.Zero - TimeSpan.FromMilliseconds(backoffBufferMilliseconds)); 165backoffHelper = new BackoffTimeoutHelper(backoffTimeout, TimeSpan.FromMinutes(5));
System\ServiceModel\Channels\TransportDefaults.cs (2)
18public static TimeSpan IdleTimeout => TimeSpan.FromMinutes(2);
System\ServiceModel\TimeSpanHelper.cs (15)
11static public TimeSpan FromMinutes(int minutes, string text) 13TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMinute * minutes); 14Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 17static public TimeSpan FromSeconds(int seconds, string text) 19TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerSecond * seconds); 20Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 23static public TimeSpan FromMilliseconds(int ms, string text) 25TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMillisecond * ms); 26Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), "");
System.ServiceModel.NetTcp (65)
System\ServiceModel\Channels\DnsCache.cs (2)
15private static readonly TimeSpan s_cacheTimeout = TimeSpan.FromSeconds(2);
System\ServiceModel\Channels\SocketConnection.cs (31)
22private TimeSpan _asyncSendTimeout; 23private TimeSpan _readFinTimeout; 24private TimeSpan _asyncReceiveTimeout; 174public ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout) 185private async ValueTask<int> ReadCoreAsync(Memory<byte> buffer, TimeSpan timeout, bool closing) 257public async ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, bool immediate, TimeSpan timeout) 333public async ValueTask CloseAsync(TimeSpan timeout) 394private void Shutdown(TimeSpan timeout) 413ConvertSendException(socketException, TimeSpan.MaxValue, _asyncSendTimeout)); 529private void SetReadTimeout(TimeSpan timeout, bool closing) 531if (timeout <= TimeSpan.Zero) 538if (timeout == TimeSpan.MaxValue) 580private void SetWriteTimeout(TimeSpan timeout) 582if (timeout <= TimeSpan.Zero) 589if (timeout == TimeSpan.MaxValue) 623private bool ShouldUpdateTimeout(DateTime oldTimeoutDeadline, TimeSpan newTimeout) 625var oldTimeout = oldTimeoutDeadline - DateTime.UtcNow; 626if (oldTimeout < TimeSpan.Zero) // Expired already 669private Exception ConvertSendException(SocketException socketException, TimeSpan remainingTime, TimeSpan timeout) 675private Exception ConvertReceiveException(SocketException socketException, TimeSpan remainingTime, TimeSpan timeout) 681private static Exception ConvertTransferException(SocketException socketException, TimeSpan timeout, Exception originalException, 683SocketConnection socketConnection, TimeSpan remainingTime) 697remainingTime <= TimeSpan.Zero) 825public static Exception ConvertConnectException(SocketException socketException, Uri remoteUri, TimeSpan timeSpent, Exception innerException) 840if (timeSpent == TimeSpan.MaxValue) 861if (timeSpent == TimeSpan.MaxValue) 914private static TimeoutException CreateTimeoutException(Uri uri, TimeSpan timeout, IPAddress[] addresses, int invalidAddressCount, 937public async ValueTask<IConnection> ConnectAsync(Uri uri, TimeSpan timeout) 953if (timeoutHelper.RemainingTime() == TimeSpan.Zero)
System\ServiceModel\Channels\TcpChannelFactory.cs (7)
20public TimeSpan LeaseTimeout { get; } 57if (typeof(T) == typeof(TimeSpan)) 59TimeSpan temp; 74return Unsafe.As<TimeSpan, T>(ref temp); 114return (LeaseTimeout == other.GetConnectionPoolSetting<TimeSpan>(nameof(LeaseTimeout))) && 118(IdleTimeout == other.GetConnectionPoolSetting<TimeSpan>(nameof(IdleTimeout))) && 119(MaxOutputDelay == other.GetConnectionPoolSetting<TimeSpan>(nameof(MaxOutputDelay)));
System\ServiceModel\Channels\TcpConnectionPoolSettings.cs (6)
11private TimeSpan _idleTimeout; 12private TimeSpan _leaseTimeout; 40public TimeSpan IdleTimeout 45if (value < TimeSpan.Zero) 61public TimeSpan LeaseTimeout 66if (value < TimeSpan.Zero)
System\ServiceModel\Channels\TransportDefaults.cs (4)
28public static TimeSpan ConnectionLeaseTimeout => TimeSpan.FromMinutes(5); 39public static TimeSpan IdleTimeout => TimeSpan.FromMinutes(2);
System\ServiceModel\TimeSpanHelper.cs (15)
11static public TimeSpan FromMinutes(int minutes, string text) 13TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMinute * minutes); 14Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 17static public TimeSpan FromSeconds(int seconds, string text) 19TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerSecond * seconds); 20Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 23static public TimeSpan FromMilliseconds(int ms, string text) 25TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMillisecond * ms); 26Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), "");
System.ServiceModel.NetTcp.Tests (6)
Channels\TcpConnectionPoolSettingsTest.cs (6)
37public static void IdleTimeout_Property_Sets(TimeSpan timeSpan) 43Assert.Equal<TimeSpan>(timeSpan, settings.IdleTimeout); 48public static void IdleTimeout_Property_Set_Invalid_Value_Throws(TimeSpan timeSpan) 58public static void LeaseTimeout_Property_Sets(TimeSpan timeSpan) 64Assert.Equal<TimeSpan>(timeSpan, settings.LeaseTimeout); 69public static void LeaseTimeout_Property_Set_Invalid_Value_Throws(TimeSpan timeSpan)
System.ServiceModel.Primitives (1143)
Internals\System\Runtime\InputQueue.cs (16)
71public IAsyncResult BeginDequeue(TimeSpan timeout, AsyncCallback callback, object state) 109public IAsyncResult BeginWaitForItem(TimeSpan timeout, AsyncCallback callback, object state) 141public T Dequeue(TimeSpan timeout) 153public async Task<T> DequeueAsync(TimeSpan timeout) 165public async Task<(bool, T)> TryDequeueAsync(TimeSpan timeout) 217public bool Dequeue(TimeSpan timeout, out T value) 446public bool WaitForItem(TimeSpan timeout) 497public Task<bool> WaitForItemAsync(TimeSpan timeout) 900public AsyncQueueReader(InputQueue<T> inputQueue, TimeSpan timeout, AsyncCallback callback, object state) 908if (timeout != TimeSpan.MaxValue) 957public AsyncQueueWaiter(TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state) 959if (timeout != TimeSpan.MaxValue) 1105public bool Wait(TimeSpan timeout, out T value) 1166public async Task<(bool, T)> WaitAsync(TimeSpan timeout) 1204public bool Wait(TimeSpan timeout) 1232public async Task<bool> WaitAsync(TimeSpan timeout)
Internals\System\Runtime\IOThreadTimer.cs (4)
70public void Set(TimeSpan timeFromNow) 72if (timeFromNow != TimeSpan.MaxValue) 102private const long maxTimeToWaitForMoreTimers = 1000 * TimeSpan.TicksPerMillisecond; 647var waitDurationInMillis = (earliestDueTime - DateTime.UtcNow.Ticks) / TimeSpan.TicksPerMillisecond;
Internals\System\Runtime\TaskHelpers.cs (7)
191public static Task CloseHelperAsync(this ICommunicationObject communicationObject, TimeSpan timeout) 203public static Task OpenHelperAsync(this ICommunicationObject communicationObject, TimeSpan timeout) 219public static async Task<bool> AwaitWithTimeout(this Task task, TimeSpan timeout) 226if (timeout == TimeSpan.MaxValue || timeout == Timeout.InfiniteTimeSpan) 297public static bool WaitForCompletionNoSpin(this Task task, TimeSpan timeout) 325public static void Wait(this Task task, TimeSpan timeout, Action<Exception, TimeSpan, string> exceptionConverter, string operationType)
Internals\System\Runtime\Ticks.cs (4)
24return checked((long)milliseconds * TimeSpan.TicksPerMillisecond); 29return checked((int)(ticks / TimeSpan.TicksPerMillisecond)); 32public static long FromTimeSpan(TimeSpan duration) 37public static TimeSpan ToTimeSpan(long ticks)
Internals\System\Runtime\TimeoutHelper.cs (48)
15public static readonly TimeSpan MaxWait = TimeSpan.FromMilliseconds(int.MaxValue); 24public TimeoutHelper(TimeSpan timeout) 26Contract.Assert(timeout >= TimeSpan.Zero, "timeout must be non-negative"); 32_deadlineSet = (timeout == TimeSpan.MaxValue); 44var timeout = RemainingTime(); 49else if (timeout > TimeSpan.Zero) 63public TimeSpan OriginalTimeout { get; } 65public static bool IsTooLarge(TimeSpan timeout) 67return (timeout > MaxWait) && (timeout != TimeSpan.MaxValue); 70public static TimeSpan FromMilliseconds(int milliseconds) 74return TimeSpan.MaxValue; 78return TimeSpan.FromMilliseconds(milliseconds); 82public static int ToMilliseconds(TimeSpan timeout) 84if (timeout == TimeSpan.MaxValue) 91if (ticks / TimeSpan.TicksPerMillisecond > int.MaxValue) 99public static TimeSpan Min(TimeSpan val1, TimeSpan val2) 111public static TimeSpan Add(TimeSpan timeout1, TimeSpan timeout2) 116public static DateTime Add(DateTime time, TimeSpan timeout) 118if (timeout >= TimeSpan.Zero && DateTime.MaxValue - time <= timeout) 122if (timeout <= TimeSpan.Zero && DateTime.MinValue - time >= timeout) 129public static DateTime Subtract(DateTime time, TimeSpan timeout) 131return Add(time, TimeSpan.Zero - timeout); 134public static TimeSpan Divide(TimeSpan timeout, int factor) 136if (timeout == TimeSpan.MaxValue) 138return TimeSpan.MaxValue; 144public TimeSpan RemainingTime() 153return TimeSpan.MaxValue; 157TimeSpan remaining = _deadline - DateTime.UtcNow; 158if (remaining <= TimeSpan.Zero) 160return TimeSpan.Zero; 169public TimeSpan ElapsedTime() 181public static void ThrowIfNegativeArgument(TimeSpan timeout) 186public static void ThrowIfNegativeArgument(TimeSpan timeout, string argumentName) 188if (timeout < TimeSpan.Zero) 194public static void ThrowIfNonPositiveArgument(TimeSpan timeout) 199public static void ThrowIfNonPositiveArgument(TimeSpan timeout, string argumentName) 201if (timeout <= TimeSpan.Zero) 207public static bool WaitOne(WaitHandle waitHandle, TimeSpan timeout) 210if (timeout == TimeSpan.MaxValue) 223public static bool Wait(ManualResetEventSlim mres, TimeSpan timeout) 226if (timeout == TimeSpan.MaxValue) 237internal static TimeoutException CreateEnterTimedOutException(TimeSpan timeout)
System\IdentityModel\SecurityUtils.cs (2)
47return new DateTime(DateTime.MinValue.Ticks + TimeSpan.TicksPerDay, DateTimeKind.Utc); 56return new DateTime(DateTime.MaxValue.Ticks - TimeSpan.TicksPerDay, DateTimeKind.Utc);
System\IdentityModel\Selectors\KerberosSecurityTokenProvider.cs (3)
51internal SecurityToken GetToken(TimeSpan timeout, ChannelBinding channelbinding) 58protected override SecurityToken GetTokenCore(TimeSpan timeout) 63internal override Task<SecurityToken> GetTokenCoreInternalAsync(TimeSpan timeout)
System\IdentityModel\Selectors\SecurityTokenProvider.cs (21)
28public SecurityToken GetToken(TimeSpan timeout) 39public IAsyncResult BeginGetToken(TimeSpan timeout, AsyncCallback callback, object state) 60public async Task<SecurityToken> GetTokenAsync(TimeSpan timeout) 71protected abstract SecurityToken GetTokenCore(TimeSpan timeout); 73protected virtual IAsyncResult BeginGetTokenCore(TimeSpan timeout, AsyncCallback callback, object state) 84protected virtual Task<SecurityToken> GetTokenCoreAsync(TimeSpan timeout) 91internal virtual Task<SecurityToken> GetTokenCoreInternalAsync(TimeSpan timeout) 98public SecurityToken RenewToken(TimeSpan timeout, SecurityToken tokenToBeRenewed) 114public IAsyncResult BeginRenewToken(TimeSpan timeout, SecurityToken tokenToBeRenewed, AsyncCallback callback, object state) 140public async Task<SecurityToken> RenewTokenAsync(TimeSpan timeout, SecurityToken tokenToBeRenewed) 156protected virtual SecurityToken RenewTokenCore(TimeSpan timeout, SecurityToken tokenToBeRenewed) 161protected virtual IAsyncResult BeginRenewTokenCore(TimeSpan timeout, SecurityToken tokenToBeRenewed, AsyncCallback callback, object state) 171protected virtual Task<SecurityToken> RenewTokenCoreAsync(TimeSpan timeout, SecurityToken tokenToBeRenewed) 176internal virtual Task<SecurityToken> RenewTokenCoreInternalAsync(TimeSpan timeout, SecurityToken tokenToBeRenewed) 183public void CancelToken(TimeSpan timeout, SecurityToken token) 193public IAsyncResult BeginCancelToken(TimeSpan timeout, SecurityToken token, AsyncCallback callback, object state) 213public async Task CancelTokenAsync(TimeSpan timeout, SecurityToken token) 223protected virtual void CancelTokenCore(TimeSpan timeout, SecurityToken token) 228protected virtual IAsyncResult BeginCancelTokenCore(TimeSpan timeout, SecurityToken token, AsyncCallback callback, object state) 238protected virtual Task CancelTokenCoreAsync(TimeSpan timeout, SecurityToken token) 243internal virtual Task CancelTokenCoreInternalAsync(TimeSpan timeout, SecurityToken token)
System\IdentityModel\Selectors\UserNameSecurityTokenProvider.cs (2)
26protected override SecurityToken GetTokenCore(TimeSpan timeout) 31internal override Task<SecurityToken> GetTokenCoreInternalAsync(TimeSpan timeout)
System\IdentityModel\Selectors\X509SecurityTokenProvider.cs (2)
38protected override SecurityToken GetTokenCore(TimeSpan timeout) 43internal override Task<SecurityToken> GetTokenCoreInternalAsync(TimeSpan timeout)
System\ServiceModel\ChannelFactory.cs (8)
54protected override TimeSpan DefaultCloseTimeout 69protected override TimeSpan DefaultOpenTimeout 275protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 285internal protected override async Task OnCloseAsync(TimeSpan timeout) 293protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 303protected internal override async Task OnOpenAsync(TimeSpan timeout) 311protected override void OnClose(TimeSpan timeout) 319protected override void OnOpen(TimeSpan timeout)
System\ServiceModel\ChannelFactoryRefCache.cs (1)
40public void Close(TimeSpan timeout)
System\ServiceModel\Channels\Binding.cs (12)
13private TimeSpan _closeTimeout = ServiceDefaults.CloseTimeout; 16private TimeSpan _openTimeout = ServiceDefaults.OpenTimeout; 17private TimeSpan _receiveTimeout = ServiceDefaults.ReceiveTimeout; 18private TimeSpan _sendTimeout = ServiceDefaults.SendTimeout; 47public TimeSpan CloseTimeout 52if (value < TimeSpan.Zero) 105public TimeSpan OpenTimeout 110if (value < TimeSpan.Zero) 123public TimeSpan ReceiveTimeout 128if (value < TimeSpan.Zero) 151public TimeSpan SendTimeout 156if (value < TimeSpan.Zero)
System\ServiceModel\Channels\ChannelBase.cs (8)
16TimeSpan IDefaultCommunicationTimeouts.CloseTimeout 21TimeSpan IDefaultCommunicationTimeouts.OpenTimeout 26TimeSpan IDefaultCommunicationTimeouts.ReceiveTimeout 31TimeSpan IDefaultCommunicationTimeouts.SendTimeout 36protected override TimeSpan DefaultCloseTimeout 41protected override TimeSpan DefaultOpenTimeout 46protected TimeSpan DefaultReceiveTimeout 51protected TimeSpan DefaultSendTimeout
System\ServiceModel\Channels\ChannelDemuxer.cs (5)
10public readonly static TimeSpan UseDefaultReceiveTimeout = TimeSpan.MinValue; 18public TimeSpan PeekTimeout { get; set; } 50public TimeSpan PeekTimeout 58if (value < TimeSpan.Zero && value != ChannelDemuxer.UseDefaultReceiveTimeout)
System\ServiceModel\Channels\ChannelFactoryBase.cs (15)
13private TimeSpan _closeTimeout = ServiceDefaults.CloseTimeout; 14private TimeSpan _openTimeout = ServiceDefaults.OpenTimeout; 15private TimeSpan _receiveTimeout = ServiceDefaults.ReceiveTimeout; 16private TimeSpan _sendTimeout = ServiceDefaults.SendTimeout; 27protected override TimeSpan DefaultCloseTimeout 32protected override TimeSpan DefaultOpenTimeout 37protected override TimeSpan DefaultReceiveTimeout 42protected override TimeSpan DefaultSendTimeout 62protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 67protected internal override Task OnCloseAsync(TimeSpan timeout) 72protected override void OnClose(TimeSpan timeout) 178protected override void OnClose(TimeSpan timeout) 190protected internal override Task OnCloseAsync(TimeSpan timeout) 195protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 205private async Task OnCloseAsyncInternal(TimeSpan timeout)
System\ServiceModel\Channels\ChannelManagerBase.cs (8)
14protected abstract TimeSpan DefaultReceiveTimeout { get; } 15protected abstract TimeSpan DefaultSendTimeout { get; } 17internal TimeSpan InternalReceiveTimeout 22internal TimeSpan InternalSendTimeout 27TimeSpan IDefaultCommunicationTimeouts.CloseTimeout 32TimeSpan IDefaultCommunicationTimeouts.OpenTimeout 37TimeSpan IDefaultCommunicationTimeouts.ReceiveTimeout 42TimeSpan IDefaultCommunicationTimeouts.SendTimeout
System\ServiceModel\Channels\ChannelReliableSession.cs (9)
51public TimeSpan InitiationTime { get; protected set; } 129public abstract Task OpenAsync(TimeSpan timeout); 131public virtual async Task CloseAsync(TimeSpan timeout) 600public override async Task OpenAsync(TimeSpan timeout) 623public override async Task CloseAsync(TimeSpan timeout) 635private TimeSpan GetPollingInterval() 646return TimeSpan.MaxValue; 649TimeSpan keepAliveInterval = WsrmUtilities.CalculateKeepAliveInterval(Settings.InactivityTimeout, Settings.MaxRetryCount); 650TimeSpan fastPollingInterval = Ticks.ToTimeSpan(Ticks.FromTimeSpan(_binder.DefaultSendTimeout) / 2);
System\ServiceModel\Channels\ClientReliableChannelBinder.cs (29)
22TimeSpan defaultCloseTimeout, TimeSpan defaultSendTimeout) 81TimeSpan defaultCloseTimeout, TimeSpan defaultSendTimeout) 120protected override Task OnCloseAsync(TimeSpan timeout) 125protected override Task OnOpenAsync(TimeSpan timeout) 130protected virtual Task<Message> OnRequestAsync(TChannel channel, Message message, TimeSpan timeout, 136public Task<Message> RequestAsync(Message message, TimeSpan timeout) 141public async Task<Message> RequestAsync(Message message, TimeSpan timeout, MaskingMode maskingMode) 200protected override Task<bool> TryGetChannelAsync(TimeSpan timeout) 230TimeSpan defaultCloseTimeout, TimeSpan defaultSendTimeout) 273TimeSpan timeout) 285protected override async Task<(bool, RequestContext)> OnTryReceiveAsync(TDuplexChannel channel, TimeSpan timeout) 295(success, message) = await TaskHelpers.FromAsync<TimeSpan, bool, Message>(channel.BeginTryReceive, channel.EndTryReceive, timeout, null); 314TimeSpan defaultCloseTimeout, TimeSpan defaultSendTimeout) 345TimeSpan defaultCloseTimeout, TimeSpan defaultSendTimeout) 364protected override Task CloseChannelAsync(IDuplexSessionChannel channel, TimeSpan timeout) 389TimeSpan defaultCloseTimeout, TimeSpan defaultSendTimeout) 450TimeSpan timeout, MaskingMode maskingMode) 463TimeSpan timeout) 477public override async Task<(bool, RequestContext)> TryReceiveAsync(TimeSpan timeout) 491TimeSpan defaultCloseTimeout, TimeSpan defaultSendTimeout) 522TimeSpan defaultCloseTimeout, TimeSpan defaultSendTimeout)
System\ServiceModel\Channels\ClientReliableDuplexSessionChannel.cs (21)
82private Task CloseSequenceAsync(TimeSpan timeout) 192private async Task InternalCloseOutputSessionAsync(TimeSpan timeout) 676protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 715protected internal override async Task OnCloseAsync(TimeSpan timeout) 745protected override void OnClose(TimeSpan timeout) 750protected async Task OnCloseOutputSessionAsync(TimeSpan timeout) 824protected override async Task OnSendAsync(Message message, TimeSpan timeout) 830private async Task OnSendAsyncHandler(MessageAttemptInfo attemptInfo, TimeSpan timeout, bool maskUnhandledException) 876private async Task OnSendAckRequestedAsyncHandler(TimeSpan timeout) 935(bool success, RequestContext context) = await Binder.TryReceiveAsync(TimeSpan.MaxValue); 981private async Task TerminateSequenceAsync(TimeSpan timeout) 1104protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 1109protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 1114protected internal override Task OnCloseAsync(TimeSpan timeout) 1121protected override void OnClose(TimeSpan timeout) 1149protected internal override async Task OnOpenAsync(TimeSpan timeout) 1169protected override void OnOpen(TimeSpan timeout) 1231TimeSpan timeout = _closing ? _closeTimeoutHelper.RemainingTime() : DefaultCloseTimeout; 1260TimeSpan timeout; 1287public IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state) 1302public void CloseOutputSession(TimeSpan timeout)
System\ServiceModel\Channels\CloseCollectionAsyncResult.cs (1)
19public CloseCollectionAsyncResult(TimeSpan timeout, AsyncCallback otherCallback, object state, IList<ICommunicationObject> collection)
System\ServiceModel\Channels\CommunicationObject.cs (31)
136protected abstract TimeSpan DefaultCloseTimeout { get; } 137protected abstract TimeSpan DefaultOpenTimeout { get; } 139internal TimeSpan InternalCloseTimeout 144internal TimeSpan InternalOpenTimeout 197public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 207public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 217public void Close(TimeSpan timeout) 223private async Task CloseAsyncInternal(TimeSpan timeout) 229async Task IAsyncCommunicationObject.CloseAsync(TimeSpan timeout) 231if (timeout < TimeSpan.Zero) 306private async Task OnCloseAsyncInternal(TimeSpan timeout) 495public void Open(TimeSpan timeout) 501private Task OpenAsyncInternal(TimeSpan timeout) 506async Task IAsyncCommunicationObject.OpenAsync(TimeSpan timeout) 508if (timeout < TimeSpan.Zero) 556private async Task OnOpenAsyncInternal(TimeSpan timeout) 985protected abstract void OnClose(TimeSpan timeout); 987protected abstract IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state); 991protected abstract void OnOpen(TimeSpan timeout); 993protected abstract IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state); 997internal protected virtual Task OnCloseAsync(TimeSpan timeout) 1006internal protected virtual Task OnOpenAsync(TimeSpan timeout) 1017internal Task OpenOtherAsync(ICommunicationObject other, TimeSpan timeout) 1047internal Task CloseOtherAsync(ICommunicationObject other, TimeSpan timeout) 1141public static TimeSpan GetInternalCloseTimeout(this CommunicationObject communicationObject) 1146public static void OnClose(CommunicationObject communicationObject, TimeSpan timeout) 1151public static IAsyncResult OnBeginClose(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, object state) 1161public static void OnOpen(CommunicationObject communicationObject, TimeSpan timeout) 1166public static IAsyncResult OnBeginOpen(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, object state) 1171public static async Task OnCloseAsyncInternal(CommunicationObject communicationObject, TimeSpan timeout) 1177public static async Task OnOpenAsyncInternal(CommunicationObject communicationObject, TimeSpan timeout)
System\ServiceModel\Channels\CreateSequenceResponse.cs (1)
30public TimeSpan? Expires { get; set; }
System\ServiceModel\Channels\DuplexChannel.cs (17)
26public Task SendAsync(Message message, TimeSpan timeout) 31if (timeout < TimeSpan.Zero) 46public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 72protected abstract Task OnSendAsync(Message message, TimeSpan timeout); 79public void Send(Message message, TimeSpan timeout) 93public Task<Message> ReceiveAsync(TimeSpan timeout) 95if (timeout < TimeSpan.Zero) 108public Message Receive(TimeSpan timeout) 118public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) 128public Task<(bool, Message)> TryReceiveAsync(TimeSpan timeout) 130if (timeout < TimeSpan.Zero) 138public bool TryReceive(TimeSpan timeout, out Message message) 145public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 157public Task<bool> WaitForMessageAsync(TimeSpan timeout) 159if (timeout < TimeSpan.Zero) 167public bool WaitForMessage(TimeSpan timeout) 172public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Channels\IChannelAcceptor.cs (4)
11TChannel AcceptChannel(TimeSpan timeout); 12IAsyncResult BeginAcceptChannel(TimeSpan timeout, AsyncCallback callback, object state); 15bool WaitForChannel(TimeSpan timeout); 16IAsyncResult BeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state);
System\ServiceModel\Channels\IChannelListener.cs (4)
14bool WaitForChannel(TimeSpan timeout); 15IAsyncResult BeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state); 23TChannel AcceptChannel(TimeSpan timeout); 25IAsyncResult BeginAcceptChannel(TimeSpan timeout, AsyncCallback callback, object state);
System\ServiceModel\Channels\IDuplexSession.cs (3)
13void CloseOutputSession(TimeSpan timeout); 15IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state); 22Task CloseOutputSessionAsync(TimeSpan timeout);
System\ServiceModel\Channels\IInputChannel.cs (9)
15Message Receive(TimeSpan timeout); 17IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state); 20bool TryReceive(TimeSpan timeout, out Message message); 21IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state); 24bool WaitForMessage(TimeSpan timeout); 25IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state); 32Task<Message> ReceiveAsync(TimeSpan timeout); 33Task<(bool, Message)> TryReceiveAsync(TimeSpan timeout); 34Task<bool> WaitForMessageAsync(TimeSpan timeout);
System\ServiceModel\Channels\InputChannel.cs (2)
11internal static async Task<Message> HelpReceiveAsync(IAsyncInputChannel channel, TimeSpan timeout) 25private static Exception CreateReceiveTimedOutException(IInputChannel channel, TimeSpan timeout)
System\ServiceModel\Channels\InputQueueChannel.cs (5)
94protected async Task<(bool dequeued, TDisposable item)> DequeueAsync(TimeSpan timeout) 108protected async Task<bool> WaitForItemAsync(TimeSpan timeout) 130protected override void OnClose(TimeSpan timeout) 135protected internal override Task OnCloseAsync(TimeSpan timeout) 141protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Channels\IOutputChannel.cs (3)
15void Send(Message message, TimeSpan timeout); 17IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state); 24Task SendAsync(Message message, TimeSpan timeout);
System\ServiceModel\Channels\IReceiveContextSettings.cs (1)
11TimeSpan ValidityDuration { get; }
System\ServiceModel\Channels\IReliableChannelBinder.cs (10)
15TimeSpan DefaultSendTimeout { get; } 26Task CloseAsync(TimeSpan timeout); 27Task CloseAsync(TimeSpan timeout, MaskingMode maskingMode); 28Task OpenAsync(TimeSpan timeout); 29Task SendAsync(Message message, TimeSpan timeout); 30Task SendAsync(Message message, TimeSpan timeout, MaskingMode maskingMode); 32Task<(bool success, RequestContext requestContext)> TryReceiveAsync(TimeSpan timeout); 33Task<(bool success, RequestContext requestContext)> TryReceiveAsync(TimeSpan timeout, MaskingMode maskingMode); 49Task<Message> RequestAsync(Message message, TimeSpan timeout); 50Task<Message> RequestAsync(Message message, TimeSpan timeout, MaskingMode maskingMode);
System\ServiceModel\Channels\IReliableFactorySettings.cs (3)
9TimeSpan AcknowledgementInterval { get; } 13TimeSpan InactivityTimeout { get; } 27TimeSpan SendTimeout { get; }
System\ServiceModel\Channels\IReplyChannel.cs (6)
13RequestContext ReceiveRequest(TimeSpan timeout); 15IAsyncResult BeginReceiveRequest(TimeSpan timeout, AsyncCallback callback, object state); 18bool TryReceiveRequest(TimeSpan timeout, out RequestContext context); 19IAsyncResult BeginTryReceiveRequest(TimeSpan timeout, AsyncCallback callback, object state); 22bool WaitForRequest(TimeSpan timeout); 23IAsyncResult BeginWaitForRequest(TimeSpan timeout, AsyncCallback callback, object state);
System\ServiceModel\Channels\IRequestChannel.cs (3)
16Message Request(Message message, TimeSpan timeout); 18IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state); 27Task<Message> RequestAsync(Message message, TimeSpan timeout);
System\ServiceModel\Channels\LayeredChannel.cs (6)
51protected internal override Task OnCloseAsync(TimeSpan timeout) 56protected override void OnClose(TimeSpan timeout) => throw ExceptionHelper.PlatformNotSupported(); 58protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) => throw ExceptionHelper.PlatformNotSupported(); 62protected internal override Task OnOpenAsync(TimeSpan timeout) 67protected override void OnOpen(TimeSpan timeout) => throw ExceptionHelper.PlatformNotSupported(); 69protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) => throw ExceptionHelper.PlatformNotSupported();
System\ServiceModel\Channels\LayeredChannelFactory.cs (25)
37protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 47protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 57protected internal override async Task OnCloseAsync(TimeSpan timeout) 64protected override void OnClose(TimeSpan timeout) 71protected internal override Task OnOpenAsync(TimeSpan timeout) 76protected override void OnOpen(TimeSpan timeout) 120public async Task<Message> ReceiveAsync(TimeSpan timeout) 152public Message Receive(TimeSpan timeout) 162public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) 172public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 184public async Task<(bool, Message)> TryReceiveAsync(TimeSpan timeout) 194(retVal, message) = await TaskHelpers.FromAsync<TimeSpan, bool, Message>(InnerChannel.BeginTryReceive, InnerChannel.EndTryReceive, timeout, null); 201public bool TryReceive(TimeSpan timeout, out Message message) 208public Task<bool> WaitForMessageAsync(TimeSpan timeout) 220public bool WaitForMessage(TimeSpan timeout) 225public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 278protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) => throw ExceptionHelper.PlatformNotSupported(); 282protected internal override async Task OnCloseAsync(TimeSpan timeout) 289protected override void OnClose(TimeSpan timeout) => throw ExceptionHelper.PlatformNotSupported(); 291protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) => throw ExceptionHelper.PlatformNotSupported(); 295protected internal override async Task OnOpenAsync(TimeSpan timeout) 302protected override void OnOpen(TimeSpan timeout) 314public Task SendAsync(Message message, TimeSpan timeout) 331public void Send(Message message, TimeSpan timeout) 341public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Channels\LifetimeManager.cs (14)
66public async Task CloseAsync(TimeSpan timeout) 78public void Close(TimeSpan timeout) 90private async Task<CommunicationWaitResult> CloseCoreAsync(TimeSpan timeout, bool aborting) 130private CommunicationWaitResult CloseCore(TimeSpan timeout, bool aborting) 226CloseCore(TimeSpan.FromSeconds(1), true); 229protected virtual IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 234protected virtual void OnClose(TimeSpan timeout) 245protected virtual async Task OnCloseAsync(TimeSpan timeout) 277Task<CommunicationWaitResult> WaitAsync(TimeSpan timeout, bool aborting); 278CommunicationWaitResult Wait(TimeSpan timeout, bool aborting); 323public async Task<CommunicationWaitResult> WaitAsync(TimeSpan timeout, bool aborting) 329if (timeout < TimeSpan.Zero) 360public CommunicationWaitResult Wait(TimeSpan timeout, bool aborting) 366if (timeout < TimeSpan.Zero)
System\ServiceModel\Channels\LocalClientSecuritySettings.cs (18)
13private TimeSpan _replayWindow; 14private TimeSpan _maxClockSkew; 15private TimeSpan _maxCookieCachingTime; 16private TimeSpan _sessionKeyRenewalInterval; 17private TimeSpan _sessionKeyRolloverInterval; 18private TimeSpan _timestampValidityDuration; 57public TimeSpan ReplayWindow 65if (value < TimeSpan.Zero) 81public TimeSpan MaxClockSkew 89if (value < TimeSpan.Zero) 107public TimeSpan TimestampValidityDuration 115if (value < TimeSpan.Zero) 133public TimeSpan MaxCookieCachingTime 141if (value < TimeSpan.Zero) 174public TimeSpan SessionKeyRenewalInterval 182if (value < TimeSpan.Zero) 198public TimeSpan SessionKeyRolloverInterval 206if (value < TimeSpan.Zero)
System\ServiceModel\Channels\OpenCollectionAsyncResult.cs (1)
20public OpenCollectionAsyncResult(TimeSpan timeout, AsyncCallback otherCallback, object state, IList<ICommunicationObject> collection)
System\ServiceModel\Channels\OutputChannel.cs (8)
26public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 33if (timeout < TimeSpan.Zero) 66protected abstract void OnSend(Message message, TimeSpan timeout); 68protected abstract Task OnSendAsync(Message message, TimeSpan timeout); 75public void Send(Message message, TimeSpan timeout) 82if (timeout < TimeSpan.Zero) 100public Task SendAsync(Message message, TimeSpan timeout) 107if (timeout < TimeSpan.Zero)
System\ServiceModel\Channels\ReliableChannelBinder.cs (48)
31private TimeSpan _defaultCloseTimeout; 36TolerateFaultsMode faultMode, TimeSpan defaultCloseTimeout, 37TimeSpan defaultSendTimeout) 84public TimeSpan DefaultSendTimeout { get; } 236public Task CloseAsync(TimeSpan timeout) 241public async Task CloseAsync(TimeSpan timeout, MaskingMode maskingMode) 314protected virtual Task CloseChannelAsync(TChannel channel, TimeSpan timeout) 453protected abstract Task OnCloseAsync(TimeSpan timeout); 489protected abstract Task OnOpenAsync(TimeSpan timeout); 544protected virtual Task OnSendAsync(TChannel channel, Message message, TimeSpan timeout) 549protected virtual Task<(bool success, RequestContext requestContext)> OnTryReceiveAsync(TChannel channel, TimeSpan timeout) 554public async Task OpenAsync(TimeSpan timeout) 601public Task SendAsync(Message message, TimeSpan timeout) 606public async Task SendAsync(Message message, TimeSpan timeout, MaskingMode maskingMode) 703private void ThrowIfTimeoutNegative(TimeSpan timeout) 705if (timeout < TimeSpan.Zero) 728protected abstract Task<bool> TryGetChannelAsync(TimeSpan timeout); 730public virtual Task<(bool, RequestContext)> TryReceiveAsync(TimeSpan timeout) 735public virtual async Task<(bool, RequestContext)> TryReceiveAsync(TimeSpan timeout, MaskingMode maskingMode) 796protected bool ValidateInputOperation(TimeSpan timeout) 798if (timeout < TimeSpan.Zero) 807protected bool ValidateOutputOperation(Message message, TimeSpan timeout, MaskingMode maskingMode) 814if (timeout < TimeSpan.Zero) 823internal Task WaitForPendingOperationsAsync(TimeSpan timeout) 1029if (await _binder.TryGetChannelAsync(TimeSpan.Zero)) 1469if (!await _binder.TryGetChannelAsync(TimeSpan.Zero)) 1535public Task<(bool success, TChannel channel)> TryGetChannelForInputAsync(bool canGetChannel, TimeSpan timeout) 1540public Task<(bool success, TChannel channel)> TryGetChannelForOutputAsync(TimeSpan timeout, MaskingMode maskingMode) 1545private async Task<(bool success, TChannel channel)> TryGetChannelAsync(bool canGetChannel, bool canCauseFault, TimeSpan timeout, 1665public async Task WaitForPendingOperationsAsync(TimeSpan timeout) 1718TChannel channel, TimeSpan timeout, MaskingMode maskingMode, 1885protected override void OnClose(TimeSpan timeout) 1889protected override IAsyncResult OnBeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state) 1903protected override void OnReply(Message message, TimeSpan timeout) 1933protected override IAsyncResult OnBeginReply(Message message, TimeSpan timeout, 1939protected override void OnClose(TimeSpan timeout) 1967private async Task OnReplyAsync(Message message, TimeSpan timeout) 1995protected override void OnReply(Message message, TimeSpan timeout) 2005ReliableChannelBinder<IDuplexSessionChannel> binder, IDuplexSessionChannel channel, TimeSpan timeout) 2012TimeSpan iterationTimeout = timeoutHelper.RemainingTime(); 2013bool lastIteration = (iterationTimeout == TimeSpan.Zero); 2029(success, message) = await TaskHelpers.FromAsync<TimeSpan, bool, Message>(channel.BeginTryReceive, channel.EndTryReceive, timeout, null); 2079lastIteration = (iterationTimeout == TimeSpan.Zero); 2087TimeSpan timeout) 2093TimeSpan iterationTimeout = timeoutHelper.RemainingTime(); 2094bool lastIteration = (iterationTimeout == TimeSpan.Zero); 2104(success, context) = await TaskHelpers.FromAsync<TimeSpan, bool, RequestContext>(channel.BeginTryReceiveRequest, channel.EndTryReceiveRequest, iterationTimeout, null); 2154lastIteration = (iterationTimeout == TimeSpan.Zero);
System\ServiceModel\Channels\ReliableChannelFactory.cs (9)
29public TimeSpan AcknowledgementInterval { get; } 32public TimeSpan InactivityTimeout { get; } 57public TimeSpan SendTimeout => InternalSendTimeout; 67protected internal override Task OnOpenAsync(TimeSpan timeout) 72protected override void OnOpen(TimeSpan timeout) 77protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 87protected internal override async Task OnCloseAsync(TimeSpan timeout) 96protected override void OnClose(TimeSpan timeout) 101protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Channels\ReliableInputConnection.cs (1)
220public async Task CloseAsync(TimeSpan timeout)
System\ServiceModel\Channels\ReliableMessagingHelpers.cs (46)
16internal delegate Task OperationWithTimeoutAsyncCallback(TimeSpan timeout); 38public async Task CloseAsync(TimeSpan timeout) 113private TimeSpan _defaultInterval; 121public InterruptibleTimer(TimeSpan defaultInterval, WaitCallback callback, object state) : this(defaultInterval, callback, null, state) 131public InterruptibleTimer(TimeSpan defaultInterval, AsyncWaitCallback callback, object state) : this(defaultInterval, null, callback, state) 141private InterruptibleTimer(TimeSpan defaultInterval, WaitCallback callback, AsyncWaitCallback asyncCallback, object state) 231public void Set(TimeSpan interval) 241private void InternalSet(TimeSpan interval, bool ifNotSet) 370public Task<bool> WaitAsync(TimeSpan timeout) 375public async Task<bool> WaitAsync(TimeSpan timeout, bool throwTimeoutException) 471public abstract Task CloseAsync(TimeSpan timeout); 478private TimeSpan _defaultCloseTimeout; 479private TimeSpan _defaultSendTimeout; 482protected TypedFaultHelper(TimeSpan defaultSendTimeout, TimeSpan defaultCloseTimeout) 573public override async Task CloseAsync(TimeSpan timeout) 582protected abstract Task SendFaultAsync(IReliableChannelBinder binder, TState state, TimeSpan timeout); 678public ReplyFaultHelper(TimeSpan defaultSendTimeout, TimeSpan defaultCloseTimeout) 694protected override async Task SendFaultAsync(IReliableChannelBinder binder, FaultState faultState, TimeSpan timeout) 710public SendFaultHelper(TimeSpan defaultSendTimeout, TimeSpan defaultCloseTimeout) 724protected override async Task SendFaultAsync(IReliableChannelBinder binder, Message message, TimeSpan timeout) 738static public TimeSpan UnknownInitiationTime = TimeSpan.FromSeconds(2); 739static public TimeSpan RequestorIterationTime = TimeSpan.FromSeconds(10); 740static public TimeSpan RequestorReceiveTime = TimeSpan.FromSeconds(10); 758private TimeSpan originalTimeout; 868private TimeSpan GetNextRequestTimeout(TimeSpan remainingTimeout, out TimeoutHelper iterationTimeout, out bool lastIteration) 912protected abstract Task<Message> OnRequestAsync(Message request, TimeSpan timeout, bool last); 914public async Task<Message> RequestAsync(TimeSpan timeout) 926TimeSpan requestTimeout = GetNextRequestTimeout(timeoutHelper.RemainingTime(), 1042protected override async Task<Message> OnRequestAsync(Message request, TimeSpan timeout, bool last) 1073private TimeSpan GetReceiveTimeout(TimeSpan timeoutRemaining) 1085protected override async Task<Message> OnRequestAsync(Message request, TimeSpan timeout, bool last) 1090TimeSpan receiveTimeout = GetReceiveTimeout(timeoutHelper.RemainingTime()); 1145private TimeSpan GetWaitTimeout(TimeSpan timeoutRemaining) 1157protected override async Task<Message> OnRequestAsync(Message request, TimeSpan timeout, bool last) 1161TimeSpan waitTimeout = GetWaitTimeout(timeoutHelper.RemainingTime()); 1662public static TimeSpan CalculateKeepAliveInterval(TimeSpan inactivityTimeout, int maxRetryCount)
System\ServiceModel\Channels\ReliableOutputConnection.cs (8)
12internal delegate Task SendAsyncHandler(MessageAttemptInfo attemptInfo, TimeSpan timeout, bool maskUnhandledException); 26private TimeSpan _sendTimeout; 34TimeSpan initialRtt, 36TimeSpan sendTimeout) 65private Task CompleteTransferAsync(TimeSpan timeout) 94public Task<bool> AddMessageAsync(Message message, TimeSpan timeout, object state) 104public async Task CloseAsync(TimeSpan timeout) 133private async Task<bool> InternalAddMessageAsync(Message message, TimeSpan timeout, object state, bool isLast)
System\ServiceModel\Channels\ReliableOutputSessionChannel.cs (19)
97private async Task CloseSequenceAsync(TimeSpan timeout) 199protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 204protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 239protected override void OnClose(TimeSpan timeout) 244protected internal override async Task OnCloseAsync(TimeSpan timeout) 265protected abstract Task OnConnectionSendAsync(Message message, TimeSpan timeout, bool saveHandledException, bool maskUnhandledException); 267private async Task OnConnectionSendAckRequestedAsyncHandler(TimeSpan timeout) 277private async Task OnConnectionSendAsyncHandler(MessageAttemptInfo attemptInfo, TimeSpan timeout, bool maskUnhandledException) 299protected abstract Task OnConnectionSendMessageAsync(Message message, TimeSpan timeout, MaskingMode maskingMode); 328protected override void OnOpen(TimeSpan timeout) 333protected internal override async Task OnOpenAsync(TimeSpan timeout) 353protected override async Task OnSendAsync(Message message, TimeSpan timeout) 359protected override void OnSend(Message message, TimeSpan timeout) 574private async Task TerminateSequenceAsync(TimeSpan timeout) 655protected override async Task OnConnectionSendAsync(Message message, TimeSpan timeout, 694protected override async Task OnConnectionSendMessageAsync(Message message, TimeSpan timeout, MaskingMode maskingMode) 734protected override async Task OnConnectionSendAsync(Message message, TimeSpan timeout, bool saveHandledException, bool maskUnhandledException) 766protected override Task OnConnectionSendMessageAsync(Message message, TimeSpan timeout, MaskingMode maskingMode) 816(bool success, RequestContext context) = await Binder.TryReceiveAsync(TimeSpan.MaxValue);
System\ServiceModel\Channels\ReliableRequestSessionChannel.cs (12)
77private async Task CloseSequenceAsync(TimeSpan timeout) 208protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 213protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 248protected internal override async Task OnCloseAsync(TimeSpan timeout) 264protected override void OnClose(TimeSpan timeout) 275private async Task OnConnectionSendAsync(MessageAttemptInfo attemptInfo, TimeSpan timeout, bool maskUnhandledException) 328private Task OnConnectionSendAckAsyncRequested(TimeSpan timeout) 361protected internal override async Task OnOpenAsync(TimeSpan timeout) 381protected override void OnOpen(TimeSpan timeout) 631private async Task TerminateSequenceAsync(TimeSpan timeout) 669private Task WaitForShutdownAsync(TimeSpan timeout) 699private TimeSpan _originalTimeout;
System\ServiceModel\Channels\ReliableSessionBindingElement.cs (8)
15private TimeSpan _acknowledgementInterval = ReliableSessionDefaults.AcknowledgementInterval; 16private TimeSpan _inactivityTimeout = ReliableSessionDefaults.InactivityTimeout; 45[DefaultValue(typeof(TimeSpan), ReliableSessionDefaults.AcknowledgementIntervalString)] 46public TimeSpan AcknowledgementInterval 54if (value <= TimeSpan.Zero) 73[DefaultValue(typeof(TimeSpan), ReliableSessionDefaults.InactivityTimeoutString)] 74public TimeSpan InactivityTimeout 82if (value <= TimeSpan.Zero)
System\ServiceModel\Channels\RequestChannel.cs (8)
78protected void WaitForPendingRequests(TimeSpan timeout) 83internal protected async Task WaitForPendingRequestsAsync(TimeSpan timeout) 208public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 225public Message Request(Message message, TimeSpan timeout) 235private async Task<Message> RequestAsyncInternal(Message message, TimeSpan timeout) 241public async Task<Message> RequestAsync(Message message, TimeSpan timeout) 248if (timeout < TimeSpan.Zero) 264TimeSpan savedTimeout = timeoutHelper.RemainingTime();
System\ServiceModel\Channels\RequestContext.cs (3)
16public abstract void Close(TimeSpan timeout); 19public abstract void Reply(Message message, TimeSpan timeout); 21public abstract IAsyncResult BeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state);
System\ServiceModel\Channels\RequestContextBase.cs (12)
12private TimeSpan _defaultCloseTimeout; 19protected RequestContextBase(Message requestMessage, TimeSpan defaultCloseTimeout, TimeSpan defaultSendTimeout) 73public TimeSpan DefaultCloseTimeout 78public TimeSpan DefaultSendTimeout { get; } 109public override void Close(TimeSpan timeout) 111if (timeout < TimeSpan.Zero) 175protected abstract void OnClose(TimeSpan timeout); 176protected abstract void OnReply(Message message, TimeSpan timeout); 177protected abstract IAsyncResult OnBeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state); 225public override IAsyncResult BeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state) 248public override void Reply(Message message, TimeSpan timeout)
System\ServiceModel\Channels\SecurityChannelFactory.cs (29)
78private Task CloseProtocolFactoryAsync(bool aborted, TimeSpan timeout) 107CloseProtocolFactoryAsync(true, TimeSpan.Zero); 114protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 124protected internal override async Task OnCloseAsync(TimeSpan timeout) 135protected override void OnClose(TimeSpan timeout) 173protected internal override async Task OnOpenAsync(TimeSpan timeout) 181protected override void OnOpen(TimeSpan timeout) 213protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 223private Task OnOpenCoreAsync(TimeSpan timeout) 279protected internal override async Task OnOpenAsync(TimeSpan timeout) 347public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 362public async Task SendAsync(Message message, TimeSpan timeout) 383public void Send(Message message, TimeSpan timeout) 417public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 432internal Message ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout) 464public async Task<Message> RequestAsync(Message message, TimeSpan timeout) 476private async Task<Message> RequestAsyncInternal(Message message, TimeSpan timeout) 482public Message Request(Message message, TimeSpan timeout) 534public Task<Message> ReceiveAsync(TimeSpan timeout) 544public Message Receive(TimeSpan timeout) 554public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) 564public virtual IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 576internal Message ProcessMessage(Message message, TimeSpan timeout) 607public async Task<(bool, Message)> TryReceiveAsync(TimeSpan timeout) 623(success, message) = await TaskHelpers.FromAsync<TimeSpan, bool, Message>(InnerDuplexChannel.BeginTryReceive, InnerDuplexChannel.EndTryReceive, timeout, null); 634public bool TryReceive(TimeSpan timeout, out Message message) 641public Task<bool> WaitForMessageAsync(TimeSpan timeout) 653public bool WaitForMessage(TimeSpan timeout) 658public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Channels\ServiceChannel.cs (46)
41private TimeSpan _operationTimeout; 158protected override TimeSpan DefaultCloseTimeout 163protected override TimeSpan DefaultOpenTimeout 188internal TimeSpan CloseTimeout 266internal TimeSpan OpenTimeout 281public TimeSpan OperationTimeout 286if (value < TimeSpan.Zero) 442manager.CallOnce(TimeSpan.MaxValue, null); 452return manager.BeginCallOnce(TimeSpan.MaxValue, null, callback, state); 474private void EnsureOpened(TimeSpan timeout) 486private IAsyncResult BeginEnsureOpened(TimeSpan timeout, AsyncCallback callback, object state) 678internal IAsyncResult BeginCall(string action, bool oneway, ProxyOperationRuntime operation, object[] ins, TimeSpan timeout, AsyncCallback callback, object asyncState) 720internal object Call(string action, bool oneway, ProxyOperationRuntime operation, object[] ins, object[] outs, TimeSpan timeout) 880private TimeoutException GetOpenTimeoutException(TimeSpan timeout) 1206public void Send(Message message, TimeSpan timeout) 1217public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 1233public Message Request(Message message, TimeSpan timeout) 1244public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 1280protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 1290protected override void OnClose(TimeSpan timeout) 1295protected internal override async Task OnCloseAsync(TimeSpan timeout) 1322protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 1332protected override void OnOpen(TimeSpan timeout) 1337protected internal override async Task OnOpenAsync(TimeSpan timeout) 1410IAsyncResult IDuplexContextChannel.BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state) 1420void IDuplexContextChannel.CloseOutputSession(TimeSpan timeout) 1696string action, object[] inputParameters, bool isOneWay, TimeSpan timeout, 1769TimeSpan timeout = _rpc.TimeoutHelper.RemainingTime(); 1835TimeSpan timeout = _rpc.TimeoutHelper.RemainingTime(); 1947void Call(ServiceChannel channel, TimeSpan timeout); 1948IAsyncResult BeginCall(ServiceChannel channel, TimeSpan timeout, AsyncCallback callback, object state); 1969private void ValidateTimeoutIsMaxValue(TimeSpan timeout) 1971if (timeout != TimeSpan.MaxValue) 1977void ICallOnce.Call(ServiceChannel channel, TimeSpan timeout) 1983IAsyncResult ICallOnce.BeginCall(ServiceChannel channel, TimeSpan timeout, AsyncCallback callback, object state) 2011void ICallOnce.Call(ServiceChannel channel, TimeSpan timeout) 2016IAsyncResult ICallOnce.BeginCall(ServiceChannel channel, TimeSpan timeout, AsyncCallback callback, object state) 2072internal void CallOnce(TimeSpan timeout, CallOnceManager cascade) 2121internal IAsyncResult BeginCallOnce(TimeSpan timeout, CallOnceManager cascade, 2287internal bool Wait(TimeSpan timeout) 2330private TimeSpan _timeout; 2333internal AsyncWaiter(CallOnceManager manager, TimeSpan timeout, 2340if (timeout != TimeSpan.MaxValue) 2406private SessionIdleManager(IChannelBinder binder, TimeSpan idle) 2414internal static SessionIdleManager CreateIfNeeded(IChannelBinder binder, TimeSpan idle) 2416if (binder.HasSession && (idle != TimeSpan.MaxValue))
System\ServiceModel\Channels\ServiceChannelFactory.cs (20)
50protected override TimeSpan DefaultCloseTimeout 55protected override TimeSpan DefaultReceiveTimeout 60protected override TimeSpan DefaultOpenTimeout 65protected override TimeSpan DefaultSendTimeout 241protected override void OnClose(TimeSpan timeout) 262protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 281protected internal override Task OnCloseAsync(TimeSpan timeout) 395private async Task OnCloseAsyncInternal(TimeSpan timeout) 437protected override void OnOpen(TimeSpan timeout) 442protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 452protected override void OnClose(TimeSpan timeout) 459protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 469protected internal override Task OnCloseAsync(TimeSpan timeout) 474protected internal override Task OnOpenAsync(TimeSpan timeout) 495private new async Task OnCloseAsyncInternal(TimeSpan timeout) 654private TimeSpan _sendTimeout; 664public TimeSpan CloseTimeout { get; } 666public TimeSpan OpenTimeout { get; } 668public TimeSpan ReceiveTimeout { get; } 670public TimeSpan SendTimeout
System\ServiceModel\Channels\ServiceChannelProxy.cs (11)
583void ICommunicationObject.Close(TimeSpan timeout) 593IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 608void ICommunicationObject.Open(TimeSpan timeout) 618IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 703TimeSpan IContextChannel.OperationTimeout 750IAsyncResult IOutputChannel.BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 765void IOutputChannel.Send(Message message, TimeSpan timeout) 775Message IRequestChannel.Request(Message message, TimeSpan timeout) 785IAsyncResult IRequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 795public IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state) 805public void CloseOutputSession(TimeSpan timeout)
System\ServiceModel\Channels\TimeoutStream.cs (1)
19public TimeoutStream(Stream stream, TimeSpan timeout)
System\ServiceModel\Channels\TransmissionStrategy.cs (7)
68public TransmissionStrategy(ReliableMessagingVersion reliableMessagingVersion, TimeSpan initRtt, 71if (initRtt < TimeSpan.Zero) 123return (Ticks.Now / TimeSpan.TicksPerMillisecond) << Constants.TimeMultiplier; 176public Task<(MessageAttemptInfo attemptInfo, bool success)> AddAsync(Message message, TimeSpan timeout, object state) 181public async Task<MessageAttemptInfo> AddLastAsync(Message message, TimeSpan timeout, object state) 411private async Task<(MessageAttemptInfo attemptInfo, bool success)> InternalAddAsync(Message message, bool isLast, TimeSpan timeout, object state) 777public async Task<MessageAttemptInfo> WaitAsync(TimeSpan timeout)
System\ServiceModel\Channels\TransportChannelFactory.cs (3)
115protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 121protected override void OnClose(TimeSpan timeout) 127internal protected override Task OnCloseAsync(TimeSpan timeout)
System\ServiceModel\Channels\TransportDefaults.cs (2)
192internal static TimeSpan AcknowledgementInterval { get { return TimeSpanHelper.FromMilliseconds(200, AcknowledgementIntervalString); } } 196internal static TimeSpan InactivityTimeout { get { return TimeSpanHelper.FromMinutes(10, InactivityTimeoutString); } }
System\ServiceModel\Channels\TransportSecurityHelpers.cs (4)
21SecurityTokenProviderContainer tokenProvider, TimeSpan timeout) 30SspiSecurityTokenProvider tokenProvider, TimeSpan timeout) 137private static async Task<T> GetTokenAsync<T>(SecurityTokenProvider tokenProvider, TimeSpan timeout) 149public static async Task<NetworkCredential> GetUserNameCredentialAsync(SecurityTokenProviderContainer tokenProvider, TimeSpan timeout)
System\ServiceModel\Channels\WsrmMessageInfo.cs (2)
681public TimeSpan? Expires { get; set; } 683public TimeSpan? OfferExpires { get; set; }
System\ServiceModel\ClientBase.cs (16)
313private async Task OpenAsync(TimeSpan timeout) 363var timeout = GetChannelFactory().InternalCloseTimeout; 367private async Task CloseAsync(TimeSpan timeout) 497void ICommunicationObject.Open(TimeSpan timeout) 508void ICommunicationObject.Close(TimeSpan timeout) 619IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 634IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 1032TimeSpan IContextChannel.OperationTimeout 1103void ICommunicationObject.Close(TimeSpan timeout) 1113IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 1128void ICommunicationObject.Open(TimeSpan timeout) 1138IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 1173void IOutputChannel.Send(Message message, TimeSpan timeout) 1183IAsyncResult IOutputChannel.BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 1208Message IRequestChannel.Request(Message message, TimeSpan timeout) 1218IAsyncResult IRequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Diagnostics\TraceUtility.cs (1)
86TimeSpan elapsedTime = new TimeSpan(DateTime.UtcNow.Ticks - startTicks);
System\ServiceModel\Dispatcher\BufferedReceiveBinder.cs (10)
58public void CloseAfterFault(TimeSpan timeout) 69public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 91public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 126public void Send(Message message, TimeSpan timeout) 131public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 141public Message Request(Message message, TimeSpan timeout) 146public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 156public bool WaitForMessage(TimeSpan timeout) 161public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 189if (binder._channelBinder.TryReceive(TimeSpan.MaxValue, out requestContext))
System\ServiceModel\Dispatcher\ChannelDispatcher.cs (11)
32private TimeSpan _transactionTimeout; 51_transactionTimeout = TimeSpan.Zero; 59protected override TimeSpan DefaultCloseTimeout 74protected override TimeSpan DefaultOpenTimeout 245internal override void CloseInput(TimeSpan timeout) 384protected override void OnClose(TimeSpan timeout) 402protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 437protected override void OnOpen(TimeSpan timeout) 454protected internal override Task OnCloseAsync(TimeSpan timeout) 460protected internal override Task OnOpenAsync(TimeSpan timeout) 513protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Dispatcher\ChannelDispatcherBase.cs (1)
18internal virtual void CloseInput(TimeSpan timeout)
System\ServiceModel\Dispatcher\ChannelHandler.cs (6)
19public static readonly TimeSpan CloseAfterFaultTimeout = TimeSpan.FromSeconds(10); 104Fx.Assert((_idleManager != null) == (Binder.HasSession && _listener.ChannelDispatcher.DefaultCommunicationTimeouts.ReceiveTimeout != TimeSpan.MaxValue), "idle manager is present only when there is a session with a finite receive timeout"); 229return _receiver.BeginTryReceive(TimeSpan.MaxValue, ChannelHandler.s_onAsyncReceiveComplete, this); 809private bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 1126while (!TryReceive(TimeSpan.MaxValue, out request))
System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (39)
21private TimeSpan _defaultSendTimeout; 61public TimeSpan DefaultCloseTimeout { get; set; } 83public TimeSpan DefaultSendTimeout 188public void CloseAfterFault(TimeSpan timeout) 235private TimeoutException GetReceiveTimeoutException(TimeSpan timeout) 294public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 340public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 350public void Send(Message message, TimeSpan timeout) 355public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 410public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 440public Message Request(Message message, TimeSpan timeout) 480TimeSpan remaining = timeoutHelper.RemainingTime(); 615public bool WaitForMessage(TimeSpan timeout) 620public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 646protected override void OnClose(TimeSpan timeout) 650protected override void OnReply(Message message, TimeSpan timeout) 658protected override IAsyncResult OnBeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state) 673public ReplyAsyncResult(DuplexRequestContext context, Message message, TimeSpan timeout, AsyncCallback callback, object state) 763internal Message WaitForReply(TimeSpan timeout) 812private TimeSpan _timeout; 817internal AsyncDuplexRequest(Message message, DuplexChannelBinder parent, TimeSpan timeout, AsyncCallback callback, object state) 823if (timeout != TimeSpan.MaxValue) 1132private TimeSpan DefaultCloseTimeout 1149private TimeSpan DefaultReceiveTimeout 1178result = _innerChannel.BeginReceive(TimeSpan.MaxValue, s_receiveAsyncCallback, this); 1347public Message Receive(TimeSpan timeout) 1357public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) 1367public bool TryReceive(TimeSpan timeout, out Message message) 1372public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 1382public bool WaitForMessage(TimeSpan timeout) 1387public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 1413public void Close(TimeSpan timeout) 1436public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 1479public void Open(TimeSpan timeout) 1490public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 1506public void Send(Message message, TimeSpan timeout) 1516public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 1568public void WaitForBackgroundClose(TimeSpan timeout) 1575public IAsyncResult BeginWaitForBackgroundClose(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Dispatcher\ErrorHandlingReceiver.cs (2)
57internal bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 97internal IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Dispatcher\IChannelBinder.cs (9)
19void CloseAfterFault(TimeSpan timeout); 21bool TryReceive(TimeSpan timeout, out RequestContext requestContext); 22IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state); 25void Send(Message message, TimeSpan timeout); 26IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state); 29Message Request(Message message, TimeSpan timeout); 30IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state); 33bool WaitForMessage(TimeSpan timeout); 34IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state);
System\ServiceModel\Dispatcher\IListenerBinder.cs (2)
15IChannelBinder Accept(TimeSpan timeout); 16IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state);
System\ServiceModel\Dispatcher\ImmutableCommunicationTimeouts.cs (8)
10private TimeSpan _close; 11private TimeSpan _open; 12private TimeSpan _receive; 13private TimeSpan _send; 38TimeSpan IDefaultCommunicationTimeouts.CloseTimeout 43TimeSpan IDefaultCommunicationTimeouts.OpenTimeout 48TimeSpan IDefaultCommunicationTimeouts.ReceiveTimeout 53TimeSpan IDefaultCommunicationTimeouts.SendTimeout
System\ServiceModel\Dispatcher\InputChannelBinder.cs (14)
57public void CloseAfterFault(TimeSpan timeout) 62public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 87public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 97public void Send(Message message, TimeSpan timeout) 102public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 117public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 127public Message Request(Message message, TimeSpan timeout) 132public bool WaitForMessage(TimeSpan timeout) 137public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) 164: base(request, TimeSpan.Zero, TimeSpan.Zero) 173protected override void OnClose(TimeSpan timeout) 177protected override void OnReply(Message message, TimeSpan timeout) 181protected override IAsyncResult OnBeginReply(Message message, TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Dispatcher\ListenerBinder.cs (12)
75public IChannelBinder Accept(TimeSpan timeout) 86public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state) 122public IChannelBinder Accept(TimeSpan timeout) 133public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state) 167public IChannelBinder Accept(TimeSpan timeout) 178public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state) 212public IChannelBinder Accept(TimeSpan timeout) 223public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state) 257public IChannelBinder Accept(TimeSpan timeout) 268public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state) 302public IChannelBinder Accept(TimeSpan timeout) 313public IAsyncResult BeginAccept(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Dispatcher\ListenerHandler.cs (11)
46protected override TimeSpan DefaultCloseTimeout 51protected override TimeSpan DefaultOpenTimeout 63protected internal override async Task OnCloseAsync(TimeSpan timeout) 77protected internal override Task OnOpenAsync(TimeSpan timeout) 83protected override void OnOpen(TimeSpan timeout) 87protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 140private async Task CloseChannelAsync(IChannel channel, TimeSpan timeout) 173public void CloseInput(TimeSpan timeout) 199private async Task CloseChannelsAsync(TimeSpan timeout) 325protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 330protected override void OnClose(TimeSpan timeout)
System\ServiceModel\Dispatcher\OutputChannelBinder.cs (9)
59public void CloseAfterFault(TimeSpan timeout) 64public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 79public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 89public void Send(Message message, TimeSpan timeout) 94public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 104public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 109public Message Request(Message message, TimeSpan timeout) 114public bool WaitForMessage(TimeSpan timeout) 119public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Dispatcher\ProxyRpc.cs (1)
30internal ProxyRpc(ServiceChannel channel, ProxyOperationRuntime operation, string action, object[] inputs, TimeSpan timeout)
System\ServiceModel\Dispatcher\ReplyChannelBinder.cs (9)
57public void CloseAfterFault(TimeSpan timeout) 62public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 77public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 87public void Send(Message message, TimeSpan timeout) 92public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 102public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 107public Message Request(Message message, TimeSpan timeout) 112public bool WaitForMessage(TimeSpan timeout) 117public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Dispatcher\RequestChannelBinder.cs (9)
55public void CloseAfterFault(TimeSpan timeout) 60public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) 75public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) 85public void Send(Message message, TimeSpan timeout) 90public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 100public bool TryReceive(TimeSpan timeout, out RequestContext requestContext) 105public Message Request(Message message, TimeSpan timeout) 119public bool WaitForMessage(TimeSpan timeout) 124public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\ICommunicationObject.cs (6)
23void Close(TimeSpan timeout); 25IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state); 29void Open(TimeSpan timeout); 31IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state); 37Task CloseAsync(TimeSpan timeout); 38Task OpenAsync(TimeSpan timeout);
System\ServiceModel\IContextChannel.cs (1)
15TimeSpan OperationTimeout { get; set; }
System\ServiceModel\IDefaultCommunicationTimeouts.cs (4)
10TimeSpan CloseTimeout { get; } 11TimeSpan OpenTimeout { get; } 12TimeSpan ReceiveTimeout { get; } 13TimeSpan SendTimeout { get; }
System\ServiceModel\IDuplexContextChannel.cs (2)
13IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state); 15void CloseOutputSession(TimeSpan timeout);
System\ServiceModel\InstanceContext.cs (8)
80protected override TimeSpan DefaultCloseTimeout 88protected override TimeSpan DefaultOpenTimeout 212protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 222protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 232protected override void OnClose(TimeSpan timeout) 241protected override void OnOpen(TimeSpan timeout) 256protected internal override Task OnCloseAsync(TimeSpan timeout) 261protected internal override Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\ReliableSession.cs (2)
39public TimeSpan InactivityTimeout 44if (value <= TimeSpan.Zero)
System\ServiceModel\Security\AcceleratedTokenProvider.cs (3)
89public override Task OnOpenAsync(TimeSpan timeout) 108public override Task OnCloseAsync(TimeSpan timeout) 155protected override Task<AcceleratedTokenProviderState> CreateNegotiationStateAsync(EndpointAddress target, Uri via, TimeSpan timeout)
System\ServiceModel\Security\ClientCredentialsSecurityTokenManager.cs (3)
344protected override SecurityToken GetTokenCore(TimeSpan timeout) 351internal Task<SecurityToken> GetTokenAsync(TimeSpan timeout, ChannelBinding channelbinding) 356internal override Task<SecurityToken> GetTokenCoreInternalAsync(TimeSpan timeout)
System\ServiceModel\Security\IChannelSecureConversationSessionSettings.cs (2)
9TimeSpan KeyRenewalInterval 15TimeSpan KeyRolloverInterval
System\ServiceModel\Security\InitiatorSessionSymmetricTransportSecurityProtocol.cs (1)
125protected override async Task<Message> SecureOutgoingMessageAtInitiatorAsync(Message message, string actor, TimeSpan timeout)
System\ServiceModel\Security\InMemoryNonceCache.cs (4)
23public InMemoryNonceCache(TimeSpan cachingTime, int maxCachedNonces) 58private TimeSpan _cachingTimeSpan; 60public NonceCacheImpl(TimeSpan cachingTimeSpan, int maxCachedNonces) 61: base(s_lowWaterMark, maxCachedNonces, s_comparer, PurgingMode.AccessBasedPurge, TimeSpan.FromTicks(cachingTimeSpan.Ticks >> 2), false)
System\ServiceModel\Security\ISecurityCommunicationObject.cs (4)
12TimeSpan DefaultOpenTimeout { get; } 13TimeSpan DefaultCloseTimeout { get; } 15Task OnCloseAsync(TimeSpan timeout); 19Task OnOpenAsync(TimeSpan timeout);
System\ServiceModel\Security\IssuanceTokenProviderBase.cs (16)
37private TimeSpan _maxServiceTokenCachingTime; 94internal static TimeSpan DefaultClientMaxTokenCachingTime 98Fx.Assert(TimeSpan.Parse(defaultClientMaxTokenCachingTimeString, CultureInfo.InvariantCulture) == TimeSpan.MaxValue, "TimeSpan value not correct"); 99return TimeSpan.MaxValue; 133public TimeSpan MaxServiceTokenCachingTime 142if (value <= TimeSpan.Zero) 262public override Task OnOpenAsync(TimeSpan timeout) 310TimeSpan interval = serviceToken.ValidTo.ToUniversalTime() - serviceToken.ValidFrom.ToUniversalTime(); 348protected override SecurityToken GetTokenCore(TimeSpan timeout) 365internal override Task<SecurityToken> GetTokenCoreInternalAsync(TimeSpan timeout) 382internal override Task CancelTokenCoreInternalAsync(TimeSpan timeout, SecurityToken token) 399protected abstract Task<T> CreateNegotiationStateAsync(EndpointAddress target, Uri via, TimeSpan timeout); 404protected abstract Task InitializeChannelFactoriesAsync(EndpointAddress target, TimeSpan timeout); 440protected async Task<SecurityToken> DoNegotiationAsync(TimeSpan timeout) 446TimeSpan timeLeft = timeout;
System\ServiceModel\Security\NegotiationTokenProvider.cs (3)
76public override async Task OnCloseAsync(TimeSpan timeout) 98public override async Task OnOpenAsync(TimeSpan timeout) 151protected override Task InitializeChannelFactoriesAsync(EndpointAddress target, TimeSpan timeout)
System\ServiceModel\Security\NonceCache.cs (3)
12private TimeSpan _cachingTime; 18public TimeSpan CachingTimeSpan 26if (value < TimeSpan.Zero)
System\ServiceModel\Security\ReceiveSecurityHeader.cs (6)
73private TimeSpan _replayWindow; 74private TimeSpan _clockSkew; 313public void SetTimeParameters(NonceCache nonceCache, TimeSpan replayWindow, TimeSpan clockSkew) 320public void Process(TimeSpan timeout, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy) 628SecurityToken encryptionToken, string idInEncryptedForm, TimeSpan timeout)
System\ServiceModel\Security\SecurityChannel.cs (2)
55_securityProtocol.CloseAsync(true, TimeSpan.Zero).GetAwaiter().GetResult(); 61protected internal override async Task OnCloseAsync(TimeSpan timeout)
System\ServiceModel\Security\SecurityProtocol.cs (13)
80public TimeSpan DefaultOpenTimeout 85public TimeSpan DefaultCloseTimeout 250private async Task MergeSupportingTokenProvidersAsync(TimeSpan timeout) 290public Task OpenAsync(TimeSpan timeout) 295public virtual async Task OnOpenAsync(TimeSpan timeout) 358public Task CloseAsync(bool aborted, TimeSpan timeout) 390public virtual async Task OnCloseAsync(TimeSpan timeout) 492internal async Task<IList<SupportingTokenSpecification>> TryGetSupportingTokensAsync(SecurityProtocolFactory factory, EndpointAddress target, Uri via, Message message, TimeSpan timeout) 587internal static async Task<SecurityToken> GetTokenAsync(SecurityTokenProvider provider, EndpointAddress target, TimeSpan timeout) 612public abstract Task<Message> SecureOutgoingMessageAsync(Message message, TimeSpan timeout); 615public virtual async Task<(SecurityProtocolCorrelationState, Message)> SecureOutgoingMessageAsync(Message message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState) 628public abstract void VerifyIncomingMessage(ref Message message, TimeSpan timeout); 631public virtual SecurityProtocolCorrelationState VerifyIncomingMessage(ref Message message, TimeSpan timeout, params SecurityProtocolCorrelationState[] correlationStates)
System\ServiceModel\Security\SecurityProtocolFactory.cs (25)
61internal static readonly TimeSpan defaultMaxClockSkew = TimeSpan.Parse(defaultMaxClockSkewString, CultureInfo.InvariantCulture); 62internal static readonly TimeSpan defaultReplayWindow = TimeSpan.Parse(defaultReplayWindowString, CultureInfo.InvariantCulture); 65internal static readonly TimeSpan defaultTimestampValidityDuration = TimeSpan.Parse(defaultTimestampValidityDurationString, CultureInfo.InvariantCulture); 79private TimeSpan _maxClockSkew = defaultMaxClockSkew; 82private TimeSpan _replayWindow = defaultReplayWindow; 87private TimeSpan _timestampValidityDuration = defaultTimestampValidityDuration; 226public TimeSpan MaxClockSkew 235if (value < TimeSpan.Zero) 269public TimeSpan ReplayWindow 278if (value <= TimeSpan.Zero) 360public TimeSpan TimestampValidityDuration 369if (value <= TimeSpan.Zero) 380public TimeSpan DefaultOpenTimeout => ServiceDefaults.OpenTimeout; 382public TimeSpan DefaultCloseTimeout => ServiceDefaults.CloseTimeout; 412public virtual Task OnCloseAsync(TimeSpan timeout) 421public SecurityProtocol CreateSecurityProtocol(EndpointAddress target, Uri via, object listenerSecurityState, bool isReturnLegSecurityRequired, TimeSpan timeout) 456protected abstract SecurityProtocol OnCreateSecurityProtocol(EndpointAddress target, Uri via, object listenerSecurityState, TimeSpan timeout); 467public virtual Task OnOpenAsync(TimeSpan timeout) 494if (MaxClockSkew == TimeSpan.MaxValue || ReplayWindow == TimeSpan.MaxValue) 511public Task OpenAsync(bool actAsInitiator, TimeSpan timeout) 517public Task CloseAsync(bool aborted, TimeSpan timeout)
System\ServiceModel\Security\SecuritySessionClientSettings.cs (59)
29internal static readonly TimeSpan s_defaultKeyRenewalInterval = TimeSpan.Parse(DefaultKeyRenewalIntervalString, CultureInfo.InvariantCulture); 30internal static readonly TimeSpan s_defaultKeyRolloverInterval = TimeSpan.Parse(DefaultKeyRolloverIntervalString, CultureInfo.InvariantCulture); 37private TimeSpan _keyRenewalInterval; 38private TimeSpan _keyRolloverInterval; 73public TimeSpan KeyRenewalInterval 81if (value <= TimeSpan.Zero) 90public TimeSpan KeyRolloverInterval 98if (value <= TimeSpan.Zero) 149public TimeSpan DefaultOpenTimeout 154public TimeSpan DefaultCloseTimeout 199public Task OnCloseAsync(TimeSpan timeout) 213_sessionProtocolFactory.CloseAsync(true, TimeSpan.Zero).Wait(); 217public Task OnOpenAsync(TimeSpan timeout) 241internal Task CloseAsync(TimeSpan timeout) 252IChannelFactory innerChannelFactory, ChannelBuilder channelBuilder, TimeSpan timeout) 440private async Task OpenCoreAsync(SecurityToken sessionToken, TimeSpan timeout) 463protected override void OnOpen(TimeSpan timeout) 468protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 478protected internal override async Task OnOpenAsync(TimeSpan timeout) 617protected async Task<SecurityProtocolCorrelationState> SendCloseMessageAsync(TimeSpan timeout) 635protected async Task SendCloseResponseMessageAsync(TimeSpan timeout) 831protected Message ProcessIncomingMessage(Message message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState, out MessageFault protocolFault) 891protected Message ProcessRequestContext(RequestContext requestContext, TimeSpan timeout, SecurityProtocolCorrelationState correlationState) 958TimeSpan tokenValidityInterval = TimeSpan.FromTicks((long)(((token.ValidTo.Ticks - token.ValidFrom.Ticks) * Settings._issuedTokenRenewalThreshold) / 100)); 1000private async Task RenewKeyAsync(TimeSpan timeout) 1066protected async Task<(SecurityProtocolCorrelationState, Message)> SecureOutgoingMessageAsync(Message message, TimeSpan timeout) 1077protected void VerifyIncomingMessage(ref Message message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState) 1094protected virtual async Task CloseCoreAsync(TimeSpan timeout) 1120protected async Task<Message> ReceiveInternalAsync(TimeSpan timeout, SecurityProtocolCorrelationState correlationState) 1141if (timeoutHelper.RemainingTime() == TimeSpan.Zero) 1151protected async Task<(bool, bool)> CloseSessionAsync(TimeSpan timeout) 1205protected virtual async Task<SecurityProtocolCorrelationState> CloseOutputSessionAsync(TimeSpan timeout) 1261protected internal override async Task OnCloseAsync(TimeSpan timeout) 1302protected override void OnClose(TimeSpan timeout) 1307protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 1443protected override async Task<SecurityProtocolCorrelationState> CloseOutputSessionAsync(TimeSpan timeout) 1469Message IRequestChannel.Request(Message message, TimeSpan timeout) => RequestAsync(message, timeout).WaitForCompletionNoSpin(); 1473IAsyncResult IRequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) => RequestAsync(message, timeout).ToApm(callback, state); 1477private Message ProcessReply(Message reply, TimeSpan timeout, SecurityProtocolCorrelationState correlationState) 1518public async Task<Message> RequestAsync(Message message, TimeSpan timeout) 1581public Message Receive(TimeSpan timeout) => ReceiveAsync(timeout).GetAwaiter().GetResult(); 1583public Task<Message> ReceiveAsync(TimeSpan timeout) => InputChannel.HelpReceiveAsync(this, timeout); 1587public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) => ReceiveAsync(timeout).ToApm(callback, state); 1591public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) => TryReceiveAsync(timeout).ToApm(callback, state); 1606public bool TryReceive(TimeSpan timeout, out Message message) 1613public async Task<(bool, Message)> TryReceiveAsync(TimeSpan timeout) 1630public void Send(Message message, TimeSpan timeout) => SendAsync(message, timeout).WaitForCompletionNoSpin(); 1632public async Task SendAsync(Message message, TimeSpan timeout) 1645public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) => SendAsync(message, timeout).ToApm(callback, state); 1665Message message = await ReceiveInternalAsync(TimeSpan.MaxValue, null); 1710public bool WaitForMessage(TimeSpan timeout) => WaitForMessageAsync(timeout).GetAwaiter().GetResult(); 1712public Task<bool> WaitForMessageAsync(TimeSpan timeout) 1717public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) => WaitForMessageAsync(timeout).ToApm(callback, state); 1785public void CloseOutputSession(TimeSpan timeout) => CloseOutputSessionAsync(timeout).GetAwaiter().GetResult(); 1787public async Task CloseOutputSessionAsync(TimeSpan timeout) 1822public IAsyncResult BeginCloseOutputSession(TimeSpan timeout, AsyncCallback callback, object state) => CloseOutputSessionAsync(timeout).ToApm(callback, state);
System\ServiceModel\Security\SecuritySessionSecurityTokenProvider.cs (12)
267public override async Task OnOpenAsync(TimeSpan timeout) 308public override async Task OnCloseAsync(TimeSpan timeout) 399protected override SecurityToken GetTokenCore(TimeSpan timeout) 405internal override Task<SecurityToken> GetTokenCoreInternalAsync(TimeSpan timeout) 411internal override Task<SecurityToken> RenewTokenCoreInternalAsync(TimeSpan timeout, SecurityToken tokenToBeRenewed) 491private async Task<SecurityToken> DoOperationAsync(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout) 739protected internal override Task OnOpenAsync(TimeSpan timeout) 744protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 754protected internal override async Task OnCloseAsync(TimeSpan timeout) 760protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 770protected override void OnClose(TimeSpan timeout) 776protected override void OnOpen(TimeSpan timeout)
System\ServiceModel\Security\SecurityTimestamp.cs (5)
17internal static readonly TimeSpan defaultTimeToLive = SecurityProtocolFactory.defaultTimestampValidityDuration; 154internal void ValidateRangeAndFreshness(TimeSpan timeToLive, TimeSpan allowedClockSkew) 165internal void ValidateFreshness(TimeSpan timeToLive, TimeSpan allowedClockSkew)
System\ServiceModel\Security\SecurityUtils.cs (15)
298return new DateTime(DateTime.MaxValue.Ticks - TimeSpan.TicksPerDay, DateTimeKind.Utc); 307return new DateTime(DateTime.MinValue.Ticks + TimeSpan.TicksPerDay, DateTimeKind.Utc); 506internal static Task OpenTokenProviderIfRequiredAsync(SecurityTokenProvider tokenProvider, TimeSpan timeout) 522internal static void CloseTokenProviderIfRequired(SecurityTokenProvider tokenProvider, TimeSpan timeout) 527internal static Task CloseTokenProviderIfRequiredAsync(SecurityTokenProvider tokenProvider, TimeSpan timeout) 545CloseCommunicationObject(tokenProvider, true, TimeSpan.Zero); 548internal static void CloseTokenAuthenticatorIfRequired(SecurityTokenAuthenticator tokenAuthenticator, TimeSpan timeout) 553internal static void CloseTokenAuthenticatorIfRequired(SecurityTokenAuthenticator tokenAuthenticator, bool aborted, TimeSpan timeout) 560CloseCommunicationObject(tokenAuthenticator, true, TimeSpan.Zero); 563private static Task OpenCommunicationObjectAsync(IAsyncCommunicationObject obj, TimeSpan timeout) 573private static Task CloseCommunicationObjectAsync(IAsyncCommunicationObject obj, bool aborted, TimeSpan timeout) 596private static void CloseCommunicationObject(Object obj, bool aborted, TimeSpan timeout) 1093private Action<TimeSpan> _operationWithTimeout; 1095public OperationWithTimeoutAsyncResult(Action<TimeSpan> operationWithTimeout, TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Security\SendSecurityHeader.cs (1)
385public void AddTimestamp(TimeSpan timestampValidityDuration)
System\ServiceModel\Security\SessionSymmetricTransportSecurityProtocolFactory.cs (2)
39protected override SecurityProtocol OnCreateSecurityProtocol(EndpointAddress target, Uri via, object listenerSecurityState, TimeSpan timeout) 51public override async Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\Security\SspiSecurityTokenProvider.cs (2)
35protected override SecurityToken GetTokenCore(TimeSpan timeout) 40protected override IAsyncResult BeginGetTokenCore(TimeSpan timeout, AsyncCallback callback, object state)
System\ServiceModel\Security\TimeBoundedCache.cs (2)
21private TimeSpan _purgeInterval; 26protected TimeBoundedCache(int lowWaterMark, int maxCacheItems, IEqualityComparer keyComparer, PurgingMode purgingMode, TimeSpan purgeInterval, bool doRemoveNotification)
System\ServiceModel\Security\Tokens\SecurityTokenProviderContainer.cs (2)
22public void Close(TimeSpan timeout) 28public Task OpenAsync(TimeSpan timeout)
System\ServiceModel\Security\TransportSecurityProtocol.cs (4)
23public override async Task<Message> SecureOutgoingMessageAsync(Message message, TimeSpan timeout) 52protected virtual async Task<Message> SecureOutgoingMessageAtInitiatorAsync(Message message, string actor, TimeSpan timeout) 67public sealed override void VerifyIncomingMessage(ref Message message, TimeSpan timeout) 104protected virtual void VerifyIncomingMessageCore(ref Message message, TimeSpan timeout)
System\ServiceModel\Security\TransportSecurityProtocolFactory.cs (1)
33protected override SecurityProtocol OnCreateSecurityProtocol(EndpointAddress target, Uri via, object listenerSecurityState, TimeSpan timeout)
System\ServiceModel\Security\WrapperSecurityCommunicationObject.cs (30)
30protected override TimeSpan DefaultCloseTimeout 35protected override TimeSpan DefaultOpenTimeout 45protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 50protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 55protected override void OnClose(TimeSpan timeout) 88protected override void OnOpen(TimeSpan timeout) 110protected internal override Task OnCloseAsync(TimeSpan timeout) 115protected internal override Task OnOpenAsync(TimeSpan timeout) 179public virtual TimeSpan DefaultOpenTimeout 184public virtual TimeSpan DefaultCloseTimeout 200public Task CloseAsync(TimeSpan timeout) 205public void Close(TimeSpan timeout) 215public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 230public Task OpenAsync(TimeSpan timeout) 235public void Open(TimeSpan timeout) 245public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 265public virtual Task OnCloseAsync(TimeSpan timeout) 283public virtual Task OnOpenAsync(TimeSpan timeout) 341public virtual TimeSpan DefaultOpenTimeout 346public virtual TimeSpan DefaultCloseTimeout 362public void Close(TimeSpan timeout) 372public IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state) 387public void Open(TimeSpan timeout) 397public IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 417public IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 422public IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 427public virtual void OnClose(TimeSpan timeout) 431public Task OnCloseAsync(TimeSpan timeout) 459public virtual void OnOpen(TimeSpan timeout) 463public Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\ServiceChannelManager.cs (5)
68public void CloseInput(TimeSpan timeout) 102public async Task CloseInputAsync(TimeSpan timeout) 241protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 246protected override void OnClose(TimeSpan timeout) 255protected override async Task OnCloseAsync(TimeSpan timeout)
System\ServiceModel\ServiceDefaults.cs (8)
10public static TimeSpan CloseTimeout { get { return TimeSpan.FromMinutes(1); } } 11public static TimeSpan OpenTimeout { get { return TimeSpan.FromMinutes(1); } } 12public static TimeSpan ReceiveTimeout { get { return TimeSpan.FromMinutes(10); } } 13public static TimeSpan SendTimeout { get { return TimeSpan.FromMinutes(1); } }
System\ServiceModel\SpnEndpointIdentity.cs (3)
12private static TimeSpan s_spnLookupTime = TimeSpan.FromMinutes(1); 39public static TimeSpan SpnLookupTime
System\ServiceModel\TimeSpanHelper.cs (15)
13static public TimeSpan FromMinutes(int minutes, string text) 15TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMinute * minutes); 16Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 19static public TimeSpan FromSeconds(int seconds, string text) 21TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerSecond * seconds); 22Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 25static public TimeSpan FromMilliseconds(int ms, string text) 27TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMillisecond * ms); 28Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), "");
System.ServiceModel.Primitives.Tests (88)
Channels\CommunicationObjectTest.cs (24)
22TimeSpan timeout = TimeSpan.FromSeconds(30); 53TimeSpan timeout = TimeSpan.FromSeconds(30); 87TimeSpan timeout = TimeSpan.FromSeconds(30); 114TimeSpan timeout = TimeSpan.FromSeconds(30); 144TimeSpan timeout = TimeSpan.FromMinutes(30); 177TimeSpan timeout = TimeSpan.FromSeconds(30); 239TimeSpan timeout = TimeSpan.FromMinutes(5); 306TimeSpan timeout = TimeSpan.FromSeconds(30); 331TimeSpan timeout = TimeSpan.FromSeconds(30); 358TimeSpan timeout = TimeSpan.FromSeconds(30); 362mco.OnBeginOpenOverride = (TimeSpan t, AsyncCallback c, object s) => 385TimeSpan timeout = TimeSpan.FromSeconds(30); 389mco.OnBeginCloseOverride = (TimeSpan t, AsyncCallback c, object s) =>
Channels\CustomChannelTest.cs (1)
227mockRequestChannel.RequestOverride = (Message m, TimeSpan t) =>
IdentityModel\SecurityTokenProviderTest.cs (42)
23var token = provider.GetToken(TimeSpan.Zero); 26token = provider.RenewToken(TimeSpan.Zero, token); 29provider.CancelToken(TimeSpan.Zero, token); 32var iar = provider.BeginGetToken(TimeSpan.Zero, null, null); 36iar = provider.BeginRenewToken(TimeSpan.Zero, token, null, null); 40iar = provider.BeginCancelToken(TimeSpan.Zero, token, null, null); 44token = provider.GetTokenAsync(TimeSpan.Zero).Result; 47token = provider.RenewTokenAsync(TimeSpan.Zero, token).Result; 50provider.CancelTokenAsync(TimeSpan.Zero, token).Wait(); 59var token = provider.GetToken(TimeSpan.Zero); 62token = provider.RenewToken(TimeSpan.Zero, token); 65provider.CancelToken(TimeSpan.Zero, token); 68var iar = provider.BeginGetToken(TimeSpan.Zero, null, null); 72iar = provider.BeginRenewToken(TimeSpan.Zero, token, null, null); 76iar = provider.BeginCancelToken(TimeSpan.Zero, token, null, null); 80token = provider.GetTokenAsync(TimeSpan.Zero).Result; 83token = provider.RenewTokenAsync(TimeSpan.Zero, token).Result; 86provider.CancelTokenAsync(TimeSpan.Zero, token).Wait(); 97var token = provider.GetToken(TimeSpan.Zero); 100token = provider.RenewToken(TimeSpan.Zero, token); 103provider.CancelToken(TimeSpan.Zero, token); 106var iar = provider.BeginGetToken(TimeSpan.Zero, null, null); 110iar = provider.BeginRenewToken(TimeSpan.Zero, token, null, null); 114iar = provider.BeginCancelToken(TimeSpan.Zero, token, null, null); 118token = provider.GetTokenAsync(TimeSpan.Zero).Result; 121token = provider.RenewTokenAsync(TimeSpan.Zero, token).Result; 124provider.CancelTokenAsync(TimeSpan.Zero, token).Wait(); 133protected override SecurityToken GetTokenCore(TimeSpan timeout) 138protected override SecurityToken RenewTokenCore(TimeSpan timeout, SecurityToken tokenToBeRenewed) 144protected override void CancelTokenCore(TimeSpan timeout, SecurityToken token) 155protected override SecurityToken GetTokenCore(TimeSpan timeout) 160protected override IAsyncResult BeginGetTokenCore(TimeSpan timeout, AsyncCallback callback, object state) 172protected override SecurityToken RenewTokenCore(TimeSpan timeout, SecurityToken tokenToBeRenewed) 178protected override IAsyncResult BeginRenewTokenCore(TimeSpan timeout, SecurityToken tokenToBeRenewed, AsyncCallback callback, object state) 191protected override void CancelTokenCore(TimeSpan timeout, SecurityToken token) 197protected override IAsyncResult BeginCancelTokenCore(TimeSpan timeout, SecurityToken token, AsyncCallback callback, object state) 216protected override SecurityToken GetTokenCore(TimeSpan timeout) 221protected override Task<SecurityToken> GetTokenCoreAsync(TimeSpan timeout) 226protected override SecurityToken RenewTokenCore(TimeSpan timeout, SecurityToken tokenToBeRenewed) 232protected override Task<SecurityToken> RenewTokenCoreAsync(TimeSpan timeout, SecurityToken tokenToBeRenewed) 238protected override void CancelTokenCore(TimeSpan timeout, SecurityToken token) 244protected override Task CancelTokenCoreAsync(TimeSpan timeout, SecurityToken token)
ServiceModel\ThrowingChannelBase.cs (4)
41protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) => throw _exception; 43protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) => InnerChannel.BeginOpen(timeout, callback, state); 45protected override void OnClose(TimeSpan timeout) => throw _exception; 51protected override void OnOpen(TimeSpan timeout) => InnerChannel.Open(timeout);
ServiceModel\ThrowingOnCloseBindingElement.cs (17)
72protected override void OnOpen(TimeSpan timeout) 77protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 93protected override void OnClose(TimeSpan timeout) 104protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 114private async Task OnCloseAsyncImpl(TimeSpan timeout) 195public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) => InnerChannel.BeginSend(message, timeout, callback, state); 198public void Send(Message message, TimeSpan timeout) => InnerChannel.Send(message, timeout); 212public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) => InnerChannel.BeginRequest(message, timeout, callback, state); 215public Message Request(Message message, TimeSpan timeout) => InnerChannel.Request(message, timeout); 254public Message Receive(TimeSpan timeout) => InnerChannel.Receive(timeout); 256public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) => InnerChannel.BeginReceive(timeout, callback, state); 258public bool TryReceive(TimeSpan timeout, out Message message) => InnerChannel.TryReceive(timeout, out message); 259public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) => InnerChannel.BeginTryReceive(timeout, callback, state); 261public bool WaitForMessage(TimeSpan timeout) => InnerChannel.WaitForMessage(timeout); 262public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) => InnerChannel.BeginWaitForMessage(timeout, callback, state); 276public void Send(Message message, TimeSpan timeout) => InnerChannel.Send(message, timeout); 278public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) => InnerChannel.BeginSend(message, callback, state);
System.ServiceModel.Syndication (4)
System\ServiceModel\Syndication\SyndicationFeed.cs (4)
183internal TimeSpan? InternalTimeToLive { get; private set; } 185public TimeSpan? TimeToLive 256private static TimeSpan? TryReadTimeToLiveFromExtension(SyndicationElementExtensionCollection elementExtensions) 271return TimeSpan.FromMinutes(timeToLive);
System.ServiceModel.UnixDomainSocket (69)
System\ServiceModel\Channels\SocketConnection.cs (31)
20private TimeSpan _asyncSendTimeout; 21private TimeSpan _readFinTimeout; 22private TimeSpan _asyncReceiveTimeout; 156public ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout) 167private async ValueTask<int> ReadCoreAsync(Memory<byte> buffer, TimeSpan timeout, bool closing) 239public async ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, bool immediate, TimeSpan timeout) 312public async ValueTask CloseAsync(TimeSpan timeout) 373private void Shutdown(TimeSpan timeout) 392ConvertSendException(socketException, TimeSpan.MaxValue, _asyncSendTimeout)); 493private void SetReadTimeout(TimeSpan timeout, bool closing) 495if (timeout <= TimeSpan.Zero) 502if (timeout == TimeSpan.MaxValue) 544private void SetWriteTimeout(TimeSpan timeout) 546if (timeout <= TimeSpan.Zero) 553if (timeout == TimeSpan.MaxValue) 587private bool ShouldUpdateTimeout(DateTime oldTimeoutDeadline, TimeSpan newTimeout) 589var oldTimeout = oldTimeoutDeadline - DateTime.UtcNow; 590if (oldTimeout < TimeSpan.Zero) // Expired already 633private Exception ConvertSendException(SocketException socketException, TimeSpan remainingTime, TimeSpan timeout) 639private Exception ConvertReceiveException(SocketException socketException, TimeSpan remainingTime, TimeSpan timeout) 645private static Exception ConvertTransferException(SocketException socketException, TimeSpan timeout, Exception originalException, 647SocketConnection socketConnection, TimeSpan remainingTime) 661remainingTime <= TimeSpan.Zero) 790public static Exception ConvertConnectException(SocketException socketException, Uri remoteUri, TimeSpan timeSpent, Exception innerException) 805if (timeSpent == TimeSpan.MaxValue) 826if (timeSpent == TimeSpan.MaxValue) 837private static TimeoutException CreateTimeoutException(Uri uri, TimeSpan timeout, SocketException innerException) 842public async ValueTask<IConnection> ConnectAsync(Uri uri, TimeSpan timeout) 848if (timeoutHelper.RemainingTime() == TimeSpan.Zero)
System\ServiceModel\Channels\TransportDefaults.cs (4)
28public static TimeSpan ConnectionLeaseTimeout => TimeSpan.FromMinutes(5); 36public static TimeSpan IdleTimeout => TimeSpan.FromMinutes(2);
System\ServiceModel\Channels\UnixDomainSocketChannelFactory.cs (7)
21public TimeSpan LeaseTimeout { get; } 70if (typeof(T) == typeof(TimeSpan)) 72TimeSpan temp; 87return Unsafe.As<TimeSpan, T>(ref temp); 127return (LeaseTimeout == other.GetConnectionPoolSetting<TimeSpan>(nameof(LeaseTimeout))) && 131(IdleTimeout == other.GetConnectionPoolSetting<TimeSpan>(nameof(IdleTimeout))) && 132(MaxOutputDelay == other.GetConnectionPoolSetting<TimeSpan>(nameof(MaxOutputDelay)));
System\ServiceModel\Channels\UnixDomainSocketConnectionPoolSettings.cs (6)
11private TimeSpan _idleTimeout; 12private TimeSpan _leaseTimeout; 40public TimeSpan IdleTimeout 45if (value < TimeSpan.Zero) 61public TimeSpan LeaseTimeout 66if (value < TimeSpan.Zero)
System\ServiceModel\Channels\UnixPosixIdentitySecurityUpgradeProvider.cs (6)
34protected override void OnClose(TimeSpan timeout) 38protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 48protected internal override Task OnCloseAsync(TimeSpan timeout) 53protected override void OnOpen(TimeSpan timeout) 57protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 67protected internal override Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\TimeSpanHelper.cs (15)
11static public TimeSpan FromMinutes(int minutes, string text) 13TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMinute * minutes); 14Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 17static public TimeSpan FromSeconds(int seconds, string text) 19TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerSecond * seconds); 20Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), ""); 23static public TimeSpan FromMilliseconds(int ms, string text) 25TimeSpan value = TimeSpan.FromTicks(TimeSpan.TicksPerMillisecond * ms); 26Contract.Assert(value == TimeSpan.Parse(text, CultureInfo.InvariantCulture), "");
System.ServiceProcess.ServiceController (2)
artifacts\obj\System.ServiceProcess.ServiceController\Debug\net10.0\System.ServiceProcess.ServiceController.netcoreapp.notsupported.cs (1)
11public void RequestAdditionalTime(System.TimeSpan time) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_ServiceController); }
artifacts\obj\System.ServiceProcess.ServiceController\Debug\net10.0\System.ServiceProcess.ServiceController.notsupported.cs (1)
92public void WaitForStatus(System.ServiceProcess.ServiceControllerStatus desiredStatus, System.TimeSpan timeout) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_ServiceController); }
System.Speech (29)
artifacts\obj\System.Speech\Debug\net10.0\System.Speech.notsupported.cs (29)
70public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 72public System.TimeSpan RecognizerAudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 208public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 217public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 218public System.TimeSpan Duration { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 221public System.Speech.Recognition.RecognizedAudio GetRange(System.TimeSpan audioPosition, System.TimeSpan duration) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } 240public RecognizedWordUnit(string text, float confidence, string pronunciation, string lexicalForm, System.Speech.Recognition.DisplayAttributes displayAttributes, System.TimeSpan audioPosition, System.TimeSpan audioDuration) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } 271public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 324public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 338public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 341public System.TimeSpan BabbleTimeout { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 343public System.TimeSpan EndSilenceTimeout { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 345public System.TimeSpan EndSilenceTimeoutAmbiguous { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 348public System.TimeSpan InitialSilenceTimeout { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 350public System.TimeSpan RecognizerAudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 376public System.Speech.Recognition.RecognitionResult Recognize(System.TimeSpan initialSilenceTimeout) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } 383public void RequestRecognizerUpdate(object userToken, System.TimeSpan audioPositionAheadToRaiseUpdate) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } 407public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 413public System.TimeSpan RecognizerAudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 439public void RequestRecognizerUpdate(object userToken, System.TimeSpan audioPositionAheadToRaiseUpdate) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } 638public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 657public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 658public System.TimeSpan Duration { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 691public void AppendBreak(System.TimeSpan duration) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } 796public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 883public System.TimeSpan AudioPosition { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } } 884public System.TimeSpan Duration { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } }
System.Text.Json (19)
System\Text\Json\JsonHelpers.Date.cs (3)
426long offsetTicks = (((long)parseData.OffsetHours) * 3600 + ((long)parseData.OffsetMinutes) * 60) * TimeSpan.TicksPerSecond; 544long ticks = totalDays * TimeSpan.TicksPerDay; 546ticks += totalSeconds * TimeSpan.TicksPerSecond;
System\Text\Json\Nodes\JsonValueOfT.cs (1)
92if (type == typeof(DateTime) || type == typeof(DateTimeOffset) || type == typeof(TimeSpan) ||
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (1)
63bool result = Utf8Parser.TryParse(source, out TimeSpan timespan, out int bytesConsumed, 'c');
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (7)
11internal sealed class TimeSpanConverter : JsonPrimitiveConverter<TimeSpan> 17public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 27internal override TimeSpan ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 33private static TimeSpan ReadCore(ref Utf8JsonReader reader) 62bool result = Utf8Parser.TryParse(source, out TimeSpan tmpValue, out int bytesConsumed, 'c'); 77public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options) 87internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
223/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="TimeSpan"/> values. 226public static JsonConverter<TimeSpan> TimeSpanConverter => s_timeSpanConverter ??= new TimeSpanConverter(); 227private static JsonConverter<TimeSpan>? s_timeSpanConverter;
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.Cache.cs (2)
22public Cache(TimeSpan slidingExpiration, TimeSpan evictionInterval)
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.cs (2)
21_cache = new(slidingExpiration: TimeSpan.FromMilliseconds(1000), evictionInterval: TimeSpan.FromMilliseconds(200));
System.Text.Json.SourceGeneration (1)
Helpers\KnownTypeSymbols.cs (1)
133public INamedTypeSymbol? TimeSpanType => GetOrResolveType(typeof(TimeSpan), ref _TimeSpanType);
System.Text.RegularExpressions (49)
System\Text\RegularExpressions\Regex.Cache.cs (3)
132public static Regex GetOrAdd(string pattern, RegexOptions options, TimeSpan matchTimeout) 282private readonly TimeSpan _matchTimeout; 284public Key(string pattern, string culture, RegexOptions options, TimeSpan matchTimeout)
System\Text\RegularExpressions\Regex.Count.cs (2)
88public static int Count(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 123public static int Count(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.cs (4)
64public Regex([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) : 87internal Regex(string pattern, RegexOptions options, TimeSpan matchTimeout, CultureInfo? culture) 119private RegexTree Init(string pattern, RegexOptions options, TimeSpan matchTimeout, [NotNull] ref CultureInfo? culture) 163protected internal static void ValidateMatchTimeout(TimeSpan matchTimeout)
System\Text\RegularExpressions\Regex.EnumerateMatches.cs (1)
65public static ValueMatchEnumerator EnumerateMatches(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.EnumerateSplits.cs (7)
70/// The behavior of <see cref="EnumerateSplits(ReadOnlySpan{char}, string, RegexOptions, TimeSpan)"/> is similar to the behavior of <see cref="Split(string, string, RegexOptions, TimeSpan)"/>, producing the splits 72/// <see cref="Split(string, string, RegexOptions, TimeSpan)"/> will include the contents of capture groups in the resulting splits, while <see cref="EnumerateSplits(ReadOnlySpan{char}, string, RegexOptions, TimeSpan)"/> will not. 73/// And if <see cref="RegexOptions.RightToLeft"/> is specified, <see cref="Split(string, string, RegexOptions, TimeSpan)"/> will reverse the order of the resulting splits to be left-to-right, whereas 74/// <see cref="EnumerateSplits(ReadOnlySpan{char}, string, RegexOptions, TimeSpan)"/> will yield the splits in the order they're found right-to-left. 90public static ValueSplitEnumerator EnumerateSplits(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.Match.cs (4)
50public static bool IsMatch(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 66public static bool IsMatch(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 131public static Match Match(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 187public static MatchCollection Matches(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.Replace.cs (2)
30public static string Replace(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, string replacement, RegexOptions options, TimeSpan matchTimeout) => 100public static string Replace(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, MatchEvaluator evaluator, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.Split.cs (1)
24public static string[] Split(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.Timeout.cs (6)
34public static readonly TimeSpan InfiniteMatchTimeout = Timeout.InfiniteTimeSpan; 44internal static readonly TimeSpan s_defaultMatchTimeout = InitDefaultMatchTimeout(); 47protected internal TimeSpan internalMatchTimeout; 60public TimeSpan MatchTimeout => internalMatchTimeout; 68private static TimeSpan InitDefaultMatchTimeout() 72if (defaultTimeout is not TimeSpan defaultMatchTimeOut)
System\Text\RegularExpressions\RegexAssemblyCompiler.cs (5)
45internal void GenerateRegexType(string pattern, RegexOptions options, string name, bool isPublic, RegexTree tree, RegexInterpreterCode code, TimeSpan matchTimeout) 85_ilg = regexTypeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new Type[] { typeof(TimeSpan) }).GetILGenerator(); 105TimeSpan matchTimeout) 135Call(typeof(TimeSpan).GetMethod(nameof(TimeSpan.FromTicks), BindingFlags.Public | BindingFlags.Static)!);
System\Text\RegularExpressions\RegexCompilationInfo.cs (3)
15private TimeSpan _matchTimeout; 22public RegexCompilationInfo(string pattern, RegexOptions options, string name, string fullnamespace, bool ispublic, TimeSpan matchTimeout) 34public TimeSpan MatchTimeout
System\Text\RegularExpressions\RegexMatchTimeoutException.cs (3)
22public RegexMatchTimeoutException(string regexInput, string regexPattern, TimeSpan matchTimeout) 77public TimeSpan MatchTimeout { get; } = TimeSpan.FromTicks(-1);
System\Text\RegularExpressions\RegexRunner.cs (4)
171protected internal Match? Scan(Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick, TimeSpan timeout) 339internal void InitializeTimeout(TimeSpan timeout) 347void ConfigureTimeout(TimeSpan timeout) 364void ThrowRegexTimeout() => throw new RegexMatchTimeoutException(runtext ?? string.Empty, runregex!.pattern!, TimeSpan.FromMilliseconds(_timeout));
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (3)
151TimeSpan matchTimeout) 169private SymbolicRegexMatcher(SymbolicRegexBuilder<TSet> builder, SymbolicRegexNode<TSet> rootNode, int captureCount, RegexFindOptimizations findOptimizations, TimeSpan matchTimeout) 346void ThrowRegexTimeout() => throw new RegexMatchTimeoutException(string.Empty, string.Empty, TimeSpan.FromMilliseconds(_timeout));
System\Text\RegularExpressions\Symbolic\SymbolicRegexRunnerFactory.cs (1)
15public SymbolicRegexRunnerFactory(RegexTree regexTree, RegexOptions options, TimeSpan matchTimeout)
System.Threading (20)
System\Threading\Barrier.cs (8)
518/// <see cref="System.TimeSpan"/> to measure the time interval. 520/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of 521/// milliseconds to wait, or a <see cref="System.TimeSpan"/> that represents -1 milliseconds to 536public bool SignalAndWait(TimeSpan timeout) 544/// <see cref="System.TimeSpan"/> to measure the time interval, while observing a <see 547/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of 548/// milliseconds to wait, or a <see cref="System.TimeSpan"/> that represents -1 milliseconds to 566public bool SignalAndWait(TimeSpan timeout, CancellationToken cancellationToken)
System\Threading\CountdownEvent.cs (8)
442/// <see cref="System.TimeSpan"/> to measure the time interval. 444/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of 445/// milliseconds to wait, or a <see cref="System.TimeSpan"/> that represents -1 milliseconds to 457public bool Wait(TimeSpan timeout) 468/// a <see cref="System.TimeSpan"/> to measure the time interval, while observing a 471/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of 472/// milliseconds to wait, or a <see cref="System.TimeSpan"/> that represents -1 milliseconds to 488public bool Wait(TimeSpan timeout, CancellationToken cancellationToken)
System\Threading\ReaderWriterLock.cs (4)
278public void AcquireReaderLock(TimeSpan timeout) => AcquireReaderLock(ToTimeoutMilliseconds(timeout)); 441public void AcquireWriterLock(TimeSpan timeout) => AcquireWriterLock(ToTimeoutMilliseconds(timeout)); 743public LockCookie UpgradeToWriterLock(TimeSpan timeout) => UpgradeToWriterLock(ToTimeoutMilliseconds(timeout)); 1107private static int ToTimeoutMilliseconds(TimeSpan timeout)
System.Threading.RateLimiting (47)
System\Threading\RateLimiting\ChainedRateLimiter.cs (2)
57public override TimeSpan? IdleDuration 63TimeSpan? lowestIdleDuration = null;
System\Threading\RateLimiting\ConcurrencyLimiter.cs (1)
35public override TimeSpan? IdleDuration => RateLimiterHelper.GetElapsedTime(_idleSince);
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (6)
16private static readonly TimeSpan s_idleTimeLimit = TimeSpan.FromSeconds(10); 37: this(partitioner, equalityComparer, TimeSpan.FromMilliseconds(100)) 43IEqualityComparer<TKey>? equalityComparer, TimeSpan timerInterval) 234if (rateLimiter.Value.Value.IdleDuration is TimeSpan idleDuration && idleDuration > s_idleTimeLimit) 239idleDuration = rateLimiter.Value.Value.IdleDuration ?? TimeSpan.Zero;
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (6)
35public override TimeSpan? IdleDuration => RateLimiterHelper.GetElapsedTime(_idleSince); 41public override TimeSpan ReplenishmentPeriod => _options.Window; 58if (options.Window <= TimeSpan.Zero) 215return new FixedWindowLease(false, TimeSpan.FromTicks(_options.Window.Ticks * replenishWindow)); 423private readonly TimeSpan? _retryAfter; 425public FixedWindowLease(bool isAcquired, TimeSpan? retryAfter)
System\Threading\RateLimiting\FixedWindowRateLimiterOptions.cs (3)
13/// Must be set to a value greater than <see cref="TimeSpan.Zero" /> by the time these options are passed to the constructor of <see cref="FixedWindowRateLimiter"/>. 15public TimeSpan Window { get; set; } = TimeSpan.Zero;
System\Threading\RateLimiting\MetadataName.cs (2)
15public static MetadataName<TimeSpan> RetryAfter { get; } = Create<TimeSpan>("RETRY_AFTER");
System\Threading\RateLimiting\NoopLimiter.cs (1)
17public override TimeSpan? IdleDuration => null;
System\Threading\RateLimiting\RateLimiter.cs (1)
58public abstract TimeSpan? IdleDuration { get; }
System\Threading\RateLimiting\RateLimiterHelper.cs (2)
13public static TimeSpan? GetElapsedTime(long? startTimestamp) 27public static TimeSpan GetElapsedTime(long startTimestamp, long endTimestamp)
System\Threading\RateLimiting\ReplenishingRateLimiter.cs (1)
15public abstract TimeSpan ReplenishmentPeriod { get; }
System\Threading\RateLimiting\SlidingWindowRateLimiter.cs (6)
29private readonly TimeSpan _replenishmentPeriod; 39public override TimeSpan? IdleDuration => RateLimiterHelper.GetElapsedTime(_idleSince); 45public override TimeSpan ReplenishmentPeriod => _replenishmentPeriod; 66if (options.Window <= TimeSpan.Zero) 436private readonly TimeSpan? _retryAfter; 438public SlidingWindowLease(bool isAcquired, TimeSpan? retryAfter)
System\Threading\RateLimiting\SlidingWindowRateLimiterOptions.cs (3)
13/// Must be set to a value greater than <see cref="TimeSpan.Zero" /> by the time these options are passed to the constructor of <see cref="SlidingWindowRateLimiter"/>. 15public TimeSpan Window { get; set; } = TimeSpan.Zero;
System\Threading\RateLimiting\TimerAwaitable.cs (4)
19private readonly TimeSpan _period; 21private readonly TimeSpan _dueTime; 26public TimerAwaitable(TimeSpan dueTime, TimeSpan period)
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (6)
37public override TimeSpan? IdleDuration => RateLimiterHelper.GetElapsedTime(_idleSince); 43public override TimeSpan ReplenishmentPeriod => _options.ReplenishmentPeriod; 64if (options.ReplenishmentPeriod <= TimeSpan.Zero) 222return new TokenBucketLease(false, TimeSpan.FromTicks(_options.ReplenishmentPeriod.Ticks * replenishPeriods)); 437private readonly TimeSpan? _retryAfter; 439public TokenBucketLease(bool isAcquired, TimeSpan? retryAfter)
System\Threading\RateLimiting\TokenBucketRateLimiterOptions.cs (3)
13/// Must be set to a value greater than <see cref="TimeSpan.Zero" /> by the time these options are passed to the constructor of <see cref="TokenBucketRateLimiter"/>. 15public TimeSpan ReplenishmentPeriod { get; set; } = TimeSpan.Zero;
System.Threading.Tasks.Dataflow (12)
Base\DataflowBlock.cs (10)
811/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.</param> 822this ISourceBlock<TOutput> source, TimeSpan timeout) 831/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.</param> 843this ISourceBlock<TOutput> source, TimeSpan timeout, CancellationToken cancellationToken) 890/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.</param> 902this ISourceBlock<TOutput> source, TimeSpan timeout) 911/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.</param> 925this ISourceBlock<TOutput> source, TimeSpan timeout, CancellationToken cancellationToken) 968/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.</param> 972this ISourceBlock<TOutput> source, bool attemptTryReceive, TimeSpan timeout, CancellationToken cancellationToken)
Internal\Common.cs (2)
415internal static readonly TimeSpan InfiniteTimeSpan = Timeout.InfiniteTimeSpan; 420internal static bool IsValidTimeout(TimeSpan timeout)
System.Transactions.Local (48)
System\Transactions\CommittableTransaction.cs (2)
21public CommittableTransaction(TimeSpan timeout) : this(TransactionManager.DefaultIsolationLevel, timeout) 30internal CommittableTransaction(IsolationLevel isoLevel, TimeSpan timeout) : base(isoLevel, (InternalTransaction?)null)
System\Transactions\Configuration\DefaultSettingsSection.cs (3)
9private static readonly TimeSpan s_timeout = TimeSpan.Parse(ConfigurationStrings.DefaultTimeout); 15public static TimeSpan Timeout => s_timeout;
System\Transactions\Configuration\MachineSettingsSection.cs (3)
9private static readonly TimeSpan s_maxTimeout = TimeSpan.Parse(ConfigurationStrings.DefaultMaxTimeout); 13public static TimeSpan MaxTimeout => s_maxTimeout;
System\Transactions\InternalTransaction.cs (1)
232internal InternalTransaction(TimeSpan timeout, CommittableTransaction committableTransaction)
System\Transactions\TransactionManager.cs (9)
287public static TimeSpan DefaultTimeout 343private static TimeSpan s_maximumTimeout; 344public static TimeSpan MaximumTimeout 371ArgumentOutOfRangeException.ThrowIfLessThan(value, TimeSpan.Zero); 528internal static TimeSpan ValidateTimeout(TimeSpan transactionTimeout) 530ArgumentOutOfRangeException.ThrowIfLessThan(transactionTimeout, TimeSpan.Zero); 532if (MaximumTimeout != TimeSpan.Zero) 534if (transactionTimeout > MaximumTimeout || transactionTimeout == TimeSpan.Zero)
System\Transactions\TransactionOptions.cs (2)
10private TimeSpan _timeout; 13public TimeSpan Timeout
System\Transactions\TransactionScope.cs (20)
106public TransactionScope(TransactionScopeOption scopeOption, TimeSpan scopeTimeout) 113TimeSpan scopeTimeout, 124TimeSpan txTimeout = TransactionManager.ValidateTimeout(scopeTimeout); 134if ((null != _expectedCurrent) && (null == _committableTransaction) && (TimeSpan.Zero != scopeTimeout)) 141TimeSpan.Zero); 196TimeSpan scopeTimeout = transactionOptions.Timeout; 220if ((null != _expectedCurrent) && (null == _committableTransaction) && (TimeSpan.Zero != scopeTimeout)) 227TimeSpan.Zero); 276TimeSpan scopeTimeout = transactionOptions.Timeout; 302if ((null != _expectedCurrent) && (null == _committableTransaction) && (TimeSpan.Zero != scopeTimeout)) 309TimeSpan.Zero); 366TimeSpan.Zero, 375public TransactionScope(Transaction transactionToUse, TimeSpan scopeTimeout) 382TimeSpan scopeTimeout, 406TimeSpan scopeTimeout, 466TimeSpan scopeTimeout, 475if (TimeSpan.Zero != scopeTimeout) 481TimeSpan.Zero 1123private static void ValidateScopeTimeout(string? paramName, TimeSpan scopeTimeout) 1125ArgumentOutOfRangeException.ThrowIfLessThan(scopeTimeout, TimeSpan.Zero, paramName);
System\Transactions\TransactionState.cs (3)
2162TimeSpan newTimeout; 2166newTimeout = TimeSpan.Zero; 2171if (newTimeout <= TimeSpan.Zero)
System\Transactions\TransactionTable.cs (5)
170internal long TimeoutTicks(TimeSpan timeout) 172if (timeout != TimeSpan.Zero) 177long timeoutTicks = ((timeout.Ticks / TimeSpan.TicksPerMillisecond) >> 198internal TimeSpan RecalcTimeout(InternalTransaction tx) 200return TimeSpan.FromMilliseconds((tx.AbsoluteTimeout - _ticks) * _timerInterval);
System.Windows.Controls.Ribbon (7)
Microsoft\Windows\Controls\KeyTipService.cs (1)
1099Interval = TimeSpan.FromMilliseconds(ShowKeyTipsWaitTime)
Microsoft\Windows\Controls\Ribbon\RibbonGroup.cs (2)
1306TimeSpan twoTenthsOfASeconds = new TimeSpan(0, 0, 0, 0, 200); 1311TimeSpan fourTenthsOfASeconds = new TimeSpan(0, 0, 0, 0, 400);
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (2)
1166timer.Interval = TimeSpan.FromMilliseconds(SystemParameters.MenuShowDelay + CloseSubmenuTimerDelayBuffer); 1170timer.Interval = TimeSpan.FromMilliseconds(SystemParameters.MenuShowDelay);
Microsoft\Windows\Controls\TextSearchInternal.cs (2)
723private static TimeSpan TimeOut 734return TimeSpan.FromMilliseconds(NativeMethods.GetDoubleClickTime() * 2);
System.Windows.Forms.Tests (4)
System\Resources\ResxDataNodeTests.cs (2)
136{ TimeSpan.MinValue, TimeSpan.MaxValue }
System\Windows\Forms\HtmlElementTests.cs (1)
2357Assert.Null(element.InvokeMember("getAttribute", default(TimeSpan)));
System\Windows\Forms\TreeViewTests.cs (1)
7159action.ExecutionTime().Should().BeLessThanOrEqualTo(TimeSpan.FromMilliseconds(500));
System.Windows.Forms.UI.IntegrationTests (19)
DataGridViewTests.cs (1)
115inputSimulator => inputSimulator.Mouse.MoveMouseTo(targetPoint.X, targetPoint.Y).Sleep(TimeSpan.FromMilliseconds(1000)));
Infra\ScreenRecordService.cs (15)
25private static readonly List<(TimeSpan elapsed, Bitmap image)> s_frames = []; 135(TimeSpan elapsed, Bitmap image)[] frames; 149(TimeSpan elapsed, Bitmap image, Size offset)[] croppedFrames = DetectChangedRegions(frames); 159(TimeSpan elapsed, Bitmap image, Size offset) firstFrame = croppedFrames[0]; 172WriteFctl(fileStream, buffer, crc, sequenceNumber: 0, size: new Size(firstFrame.image.Width, firstFrame.image.Height), offset: firstFrame.offset, delay: TimeSpan.Zero, ApngDisposeOp.None, ApngBlendOp.Source); 182TimeSpan elapsed = croppedFrames[i].elapsed - croppedFrames[i - 1].elapsed; 214TimeSpan elapsed = s_timer.Elapsed; 234private static (TimeSpan elapsed, Bitmap image, Size offset)[] DetectChangedRegions((TimeSpan elapsed, Bitmap image)[] frames) 242List<(TimeSpan elapsed, Bitmap image, Size offset)> resultFrames = new(frames.Length); 367private static void WriteFrame(Stream stream, byte[] buffer, Crc32 crc, ref int sequenceNumber, Bitmap frame, Size offset, TimeSpan delay) 472private static void WriteFctl(Stream stream, byte[] buffer, Crc32 crc, int sequenceNumber, Size size, Size offset, TimeSpan delay, ApngDisposeOp disposeOp, ApngBlendOp blendOp) 597var throttle = TimeSpan.Zero; 616TimeSpan elapsed = s_timer.Elapsed;
Input\KeyboardSimulator.cs (1)
115internal KeyboardSimulator Sleep(TimeSpan time)
Input\MouseSimulator.cs (1)
171internal MouseSimulator Sleep(TimeSpan time)
MonthCalendarTests.cs (1)
195.Sleep(TimeSpan.FromMilliseconds(500))
System.Windows.Presentation (4)
System\Windows\Threading\DispatcherExtensions.cs (2)
119public static void Invoke(this Dispatcher dispatcher, Action action, TimeSpan timeout) 145public static void Invoke(this Dispatcher dispatcher, Action action, TimeSpan timeout, DispatcherPriority priority)
System\Windows\Threading\TaskExtensions.cs (2)
23return DispatcherOperationWait(@this, TimeSpan.FromMilliseconds(-1)); 29public static DispatcherOperationStatus DispatcherOperationWait(this Task @this, TimeSpan timeout)
System.Xaml (6)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (2)
292else if (type == typeof(TimeSpan)) 392else if (typeof(TimeSpan).IsAssignableFrom(type))
System\Windows\Markup\DateTimeValueSerializer.cs (1)
76if (dateTime.TimeOfDay == TimeSpan.Zero)
System\Xaml\Replacements\DateTimeOffsetConverter2.cs (1)
55typeof(TimeSpan)
System\Xaml\Schema\BuiltInValueConverter.cs (1)
147if (typeof(TimeSpan) == targetType)
System\Xaml\XamlLanguage.cs (1)
117new Lazy<XamlType>(() => GetXamlType(typeof(TimeSpan)), true);
System.Xaml.Tests (9)
System\Windows\Markup\ValueSerializerTests.cs (1)
113yield return new object[] { typeof(TimeSpan) };
System\Xaml\Replacements\DateTimeOffsetConverter2Tests.cs (5)
31DateTimeOffset dateTimeOffset = new DateTimeOffset(2018, 12, 9, 1, 2, 3, 4, TimeSpan.FromMinutes(10)); 71yield return new object?[] { new DateTimeOffset(2018, 12, 9, 1, 2, 3, 4, TimeSpan.FromMinutes(10)), new CultureInfo("en-US") }; 86var dateTimeOffset = new DateTimeOffset(2018, 12, 9, 1, 2, 3, 4, TimeSpan.FromMinutes(10)); 91Assert.Equal(new Type[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(TimeSpan) }, parameters.Select(p => p.ParameterType)); 92Assert.Equal(new object[] { 2018, 12, 9, 1, 2, 3, 4, TimeSpan.FromMinutes(10) }, descriptor.Arguments);
System\Xaml\XamlLanguageTests.cs (1)
254Assert.Equal(typeof(TimeSpan), type.UnderlyingType);
System\Xaml\XamlSchemaContextTests.cs (1)
573new XamlType(typeof(TimeSpan), new XamlSchemaContext())
System\Xaml\XamlTypeTests.cs (1)
4219yield return new object?[] { new SubXamlType(typeof(TimeSpan), new XamlSchemaContext()), new XamlValueConverter<TypeConverter>(typeof(TimeSpanConverter), null) };
Templates.Blazor.Tests (18)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
49Timeout = TimeSpan.FromMinutes(2)
src\ProjectTemplates\Shared\ProcessLock.cs (2)
25public async Task WaitAsync(TimeSpan? timeout = null) 27timeout ??= TimeSpan.FromMinutes(20);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
276TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
src\Shared\Process\ProcessEx.cs (7)
21private static readonly TimeSpan DefaultProcessTimeout = TimeSpan.FromMinutes(15); 32private readonly CancellationTokenSource _stdoutLinesCancellationSource = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 36public ProcessEx(ITestOutputHelper output, Process proc, TimeSpan timeout) 103public static ProcessEx Run(ITestOutputHelper output, string workingDirectory, string command, string args = null, IDictionary<string, string> envVars = null, TimeSpan? timeout = default) 205public void WaitForExit(bool assertSuccess, TimeSpan? timeSpan = null) 209timeSpan = TimeSpan.FromSeconds(600);
src\Shared\Process\ProcessExtensions.cs (6)
14private static readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30); 18public static void KillTree(this Process process, TimeSpan timeout) 41private static void GetAllChildIdsUnix(int parentId, ISet<int> children, TimeSpan timeout) 79private static void KillProcessUnix(int processId, TimeSpan timeout) 95private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout, out string stdout)
Templates.Blazor.WebAssembly.Auth.Tests (34)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
49Timeout = TimeSpan.FromMinutes(2)
src\ProjectTemplates\Shared\ProcessLock.cs (2)
25public async Task WaitAsync(TimeSpan? timeout = null) 27timeout ??= TimeSpan.FromMinutes(20);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
276TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
src\Shared\E2ETesting\BrowserFixture.cs (3)
213TimeSpan.FromSeconds(60).Add(TimeSpan.FromSeconds(attempt * 60))); 215driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1);
src\Shared\E2ETesting\SauceConnectServer.cs (2)
150Timeout = TimeSpan.FromSeconds(1), 214process?.KillTree(TimeSpan.FromSeconds(10));
src\Shared\E2ETesting\WaitAssert.cs (11)
23public static TimeSpan DefaultTimeout = TimeSpan.FromSeconds(E2ETestOptions.Instance.DefaultWaitTimeoutInSeconds); 24public static TimeSpan FailureTimeout = TimeSpan.FromSeconds(E2ETestOptions.Instance.DefaultAfterFailureWaitTimeoutInSeconds); 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 64public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 67public static void DoesNotExist(this IWebDriver driver, By finder, TimeSpan timeout = default) 74public static IWebElement Exists(this IWebDriver driver, By finder, TimeSpan timeout) 89private static void WaitAssertCore(IWebDriver driver, Action assertion, TimeSpan timeout = default) 94private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
src\Shared\Process\ProcessEx.cs (7)
21private static readonly TimeSpan DefaultProcessTimeout = TimeSpan.FromMinutes(15); 32private readonly CancellationTokenSource _stdoutLinesCancellationSource = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 36public ProcessEx(ITestOutputHelper output, Process proc, TimeSpan timeout) 103public static ProcessEx Run(ITestOutputHelper output, string workingDirectory, string command, string args = null, IDictionary<string, string> envVars = null, TimeSpan? timeout = default) 205public void WaitForExit(bool assertSuccess, TimeSpan? timeSpan = null) 209timeSpan = TimeSpan.FromSeconds(600);
src\Shared\Process\ProcessExtensions.cs (6)
14private static readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30); 18public static void KillTree(this Process process, TimeSpan timeout) 41private static void GetAllChildIdsUnix(int parentId, ISet<int> children, TimeSpan timeout) 79private static void KillProcessUnix(int processId, TimeSpan timeout) 95private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout, out string stdout)
Templates.Blazor.WebAssembly.Tests (34)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
49Timeout = TimeSpan.FromMinutes(2)
src\ProjectTemplates\Shared\ProcessLock.cs (2)
25public async Task WaitAsync(TimeSpan? timeout = null) 27timeout ??= TimeSpan.FromMinutes(20);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
276TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
src\Shared\E2ETesting\BrowserFixture.cs (3)
213TimeSpan.FromSeconds(60).Add(TimeSpan.FromSeconds(attempt * 60))); 215driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1);
src\Shared\E2ETesting\SauceConnectServer.cs (2)
150Timeout = TimeSpan.FromSeconds(1), 214process?.KillTree(TimeSpan.FromSeconds(10));
src\Shared\E2ETesting\WaitAssert.cs (11)
23public static TimeSpan DefaultTimeout = TimeSpan.FromSeconds(E2ETestOptions.Instance.DefaultWaitTimeoutInSeconds); 24public static TimeSpan FailureTimeout = TimeSpan.FromSeconds(E2ETestOptions.Instance.DefaultAfterFailureWaitTimeoutInSeconds); 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 64public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 67public static void DoesNotExist(this IWebDriver driver, By finder, TimeSpan timeout = default) 74public static IWebElement Exists(this IWebDriver driver, By finder, TimeSpan timeout) 89private static void WaitAssertCore(IWebDriver driver, Action assertion, TimeSpan timeout = default) 94private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
src\Shared\Process\ProcessEx.cs (7)
21private static readonly TimeSpan DefaultProcessTimeout = TimeSpan.FromMinutes(15); 32private readonly CancellationTokenSource _stdoutLinesCancellationSource = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 36public ProcessEx(ITestOutputHelper output, Process proc, TimeSpan timeout) 103public static ProcessEx Run(ITestOutputHelper output, string workingDirectory, string command, string args = null, IDictionary<string, string> envVars = null, TimeSpan? timeout = default) 205public void WaitForExit(bool assertSuccess, TimeSpan? timeSpan = null) 209timeSpan = TimeSpan.FromSeconds(600);
src\Shared\Process\ProcessExtensions.cs (6)
14private static readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30); 18public static void KillTree(this Process process, TimeSpan timeout) 41private static void GetAllChildIdsUnix(int parentId, ISet<int> children, TimeSpan timeout) 79private static void KillProcessUnix(int processId, TimeSpan timeout) 95private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout, out string stdout)
Templates.Mvc.Tests (34)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
49Timeout = TimeSpan.FromMinutes(2)
src\ProjectTemplates\Shared\ProcessLock.cs (2)
25public async Task WaitAsync(TimeSpan? timeout = null) 27timeout ??= TimeSpan.FromMinutes(20);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
276TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
src\Shared\E2ETesting\BrowserFixture.cs (3)
213TimeSpan.FromSeconds(60).Add(TimeSpan.FromSeconds(attempt * 60))); 215driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1);
src\Shared\E2ETesting\SauceConnectServer.cs (2)
150Timeout = TimeSpan.FromSeconds(1), 214process?.KillTree(TimeSpan.FromSeconds(10));
src\Shared\E2ETesting\WaitAssert.cs (11)
23public static TimeSpan DefaultTimeout = TimeSpan.FromSeconds(E2ETestOptions.Instance.DefaultWaitTimeoutInSeconds); 24public static TimeSpan FailureTimeout = TimeSpan.FromSeconds(E2ETestOptions.Instance.DefaultAfterFailureWaitTimeoutInSeconds); 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 64public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 67public static void DoesNotExist(this IWebDriver driver, By finder, TimeSpan timeout = default) 74public static IWebElement Exists(this IWebDriver driver, By finder, TimeSpan timeout) 89private static void WaitAssertCore(IWebDriver driver, Action assertion, TimeSpan timeout = default) 94private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
src\Shared\Process\ProcessEx.cs (7)
21private static readonly TimeSpan DefaultProcessTimeout = TimeSpan.FromMinutes(15); 32private readonly CancellationTokenSource _stdoutLinesCancellationSource = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 36public ProcessEx(ITestOutputHelper output, Process proc, TimeSpan timeout) 103public static ProcessEx Run(ITestOutputHelper output, string workingDirectory, string command, string args = null, IDictionary<string, string> envVars = null, TimeSpan? timeout = default) 205public void WaitForExit(bool assertSuccess, TimeSpan? timeSpan = null) 209timeSpan = TimeSpan.FromSeconds(600);
src\Shared\Process\ProcessExtensions.cs (6)
14private static readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30); 18public static void KillTree(this Process process, TimeSpan timeout) 41private static void GetAllChildIdsUnix(int parentId, ISet<int> children, TimeSpan timeout) 79private static void KillProcessUnix(int processId, TimeSpan timeout) 95private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout, out string stdout)
Templates.Tests (34)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
49Timeout = TimeSpan.FromMinutes(2)
src\ProjectTemplates\Shared\ProcessLock.cs (2)
25public async Task WaitAsync(TimeSpan? timeout = null) 27timeout ??= TimeSpan.FromMinutes(20);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
276TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
src\Shared\E2ETesting\BrowserFixture.cs (3)
213TimeSpan.FromSeconds(60).Add(TimeSpan.FromSeconds(attempt * 60))); 215driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1);
src\Shared\E2ETesting\SauceConnectServer.cs (2)
150Timeout = TimeSpan.FromSeconds(1), 214process?.KillTree(TimeSpan.FromSeconds(10));
src\Shared\E2ETesting\WaitAssert.cs (11)
23public static TimeSpan DefaultTimeout = TimeSpan.FromSeconds(E2ETestOptions.Instance.DefaultWaitTimeoutInSeconds); 24public static TimeSpan FailureTimeout = TimeSpan.FromSeconds(E2ETestOptions.Instance.DefaultAfterFailureWaitTimeoutInSeconds); 35public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout) 38public static void True(this IWebDriver driver, Func<bool> actual, TimeSpan timeout, string message) 64public static TElement Exists<TElement>(this IWebDriver driver, Func<TElement> actual, TimeSpan timeout) 67public static void DoesNotExist(this IWebDriver driver, By finder, TimeSpan timeout = default) 74public static IWebElement Exists(this IWebDriver driver, By finder, TimeSpan timeout) 89private static void WaitAssertCore(IWebDriver driver, Action assertion, TimeSpan timeout = default) 94private static TResult WaitAssertCore<TResult>(IWebDriver driver, Func<TResult> assertion, TimeSpan timeout = default)
src\Shared\Process\ProcessEx.cs (7)
21private static readonly TimeSpan DefaultProcessTimeout = TimeSpan.FromMinutes(15); 32private readonly CancellationTokenSource _stdoutLinesCancellationSource = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 36public ProcessEx(ITestOutputHelper output, Process proc, TimeSpan timeout) 103public static ProcessEx Run(ITestOutputHelper output, string workingDirectory, string command, string args = null, IDictionary<string, string> envVars = null, TimeSpan? timeout = default) 205public void WaitForExit(bool assertSuccess, TimeSpan? timeSpan = null) 209timeSpan = TimeSpan.FromSeconds(600);
src\Shared\Process\ProcessExtensions.cs (6)
14private static readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30); 18public static void KillTree(this Process process, TimeSpan timeout) 41private static void GetAllChildIdsUnix(int parentId, ISet<int> children, TimeSpan timeout) 79private static void KillProcessUnix(int processId, TimeSpan timeout) 95private static void RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout, out string stdout)
Test.Utilities (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
TestProject.IntegrationServiceA (2)
ResilienceUtils.cs (2)
20Delay = TimeSpan.FromSeconds(1), 24.AddTimeout(TimeSpan.FromSeconds(overallTimeoutSecs))
Text.Analyzers (11)
src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 106TimeSpan delay,
src\Dependencies\Threading\TestHooks\IExpeditableDelaySource.cs (2)
26/// <para>The <paramref name="delay"/> argument's <see cref="TimeSpan.TotalMilliseconds"/> property is greater than <see cref="int.MaxValue"/>.</para> 30Task<bool> Delay(TimeSpan delay, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
745or nameof(TimeSpan))
UnitTests.Common (101)
IMockCommunicationObject.cs (10)
15Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 16Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; } 18Func<TimeSpan, AsyncCallback, object, IAsyncResult> OnBeginCloseOverride { get; set; } 19Func<TimeSpan, AsyncCallback, object, IAsyncResult> OnBeginOpenOverride { get; set; } 20Action<TimeSpan> OnOpenOverride { get; set; } 21Action<TimeSpan> OnCloseOverride { get; set; } 34void DefaultOnOpen(TimeSpan timeout); 37void DefaultOnClose(TimeSpan timeout); 40IAsyncResult DefaultOnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state); 43IAsyncResult DefaultOnBeginClose(TimeSpan timeout, AsyncCallback callback, object state);
MockAsyncResult.cs (3)
10public MockAsyncResult(TimeSpan timeout, AsyncCallback callback, object state) 18public MockAsyncResult() : this(TimeSpan.FromSeconds(30), null, null) 22public TimeSpan Timeout { get; set; }
MockChannelBase.cs (20)
55public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 56public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; } 58public Func<TimeSpan, AsyncCallback, object, IAsyncResult> OnBeginCloseOverride { get; set; } 59public Func<TimeSpan, AsyncCallback, object, IAsyncResult> OnBeginOpenOverride { get; set; } 60public Action<TimeSpan> OnOpenOverride { get; set; } 61public Action<TimeSpan> OnCloseOverride { get; set; } 82protected override TimeSpan DefaultCloseTimeout 90public TimeSpan DefaultDefaultCloseTimeout() 92return TimeSpan.FromSeconds(30); 95protected override TimeSpan DefaultOpenTimeout 103public TimeSpan DefaultDefaultOpenTimeout() 105return TimeSpan.FromSeconds(30); 118protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 123public IAsyncResult DefaultOnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 138protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 143public IAsyncResult DefaultOnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 158protected override void OnClose(TimeSpan timeout) 163public void DefaultOnClose(TimeSpan timeout) 190protected override void OnOpen(TimeSpan timeout) 195public void DefaultOnOpen(TimeSpan timeout)
MockChannelFactory.cs (20)
54public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 55public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; } 57public Func<TimeSpan, AsyncCallback, object, IAsyncResult> OnBeginCloseOverride { get; set; } 58public Func<TimeSpan, AsyncCallback, object, IAsyncResult> OnBeginOpenOverride { get; set; } 59public Action<TimeSpan> OnOpenOverride { get; set; } 60public Action<TimeSpan> OnCloseOverride { get; set; } 84protected override TimeSpan DefaultCloseTimeout 92public TimeSpan DefaultDefaultCloseTimeout() 94return TimeSpan.FromSeconds(30); 97protected override TimeSpan DefaultOpenTimeout 105public TimeSpan DefaultDefaultOpenTimeout() 107return TimeSpan.FromSeconds(30); 120protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 125public IAsyncResult DefaultOnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 139protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 144public IAsyncResult DefaultOnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 158protected override void OnClose(TimeSpan timeout) 163public void DefaultOnClose(TimeSpan timeout) 188protected override void OnOpen(TimeSpan timeout) 193public void DefaultOnOpen(TimeSpan timeout)
MockCommunicationObject.cs (28)
50public Func<TimeSpan> DefaultCloseTimeoutOverride { get; set; } 51public Func<TimeSpan> DefaultOpenTimeoutOverride { get; set; } 53public Func<TimeSpan, AsyncCallback, object, IAsyncResult> OnBeginCloseOverride { get; set; } 54public Func<TimeSpan, AsyncCallback, object, IAsyncResult> OnBeginOpenOverride { get; set; } 55public Action<TimeSpan> OnOpenOverride { get; set; } 56public Action<TimeSpan> OnCloseOverride { get; set; } 67protected override TimeSpan DefaultCloseTimeout 75public TimeSpan DefaultDefaultCloseTimeout() 77return TimeSpan.FromSeconds(30); 80protected override TimeSpan DefaultOpenTimeout 88public TimeSpan DefaultDefaultOpenTimeout() 90return TimeSpan.FromSeconds(30); 103protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 108public IAsyncResult DefaultOnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) 123protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 129public IAsyncResult DefaultOnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) 144protected override void OnClose(TimeSpan timeout) 149public void DefaultOnClose(TimeSpan timeout) 176protected override void OnOpen(TimeSpan timeout) 181public void DefaultOnOpen(TimeSpan timeout) 247mco.OnOpenOverride = (TimeSpan t) => 253mco.OnBeginOpenOverride = (TimeSpan t, AsyncCallback c, object s) => 276mco.OnCloseOverride = (TimeSpan t) => 282mco.OnBeginCloseOverride = (TimeSpan t, AsyncCallback c, object s) => 330mco.OnOpenOverride = (TimeSpan t) => 337mco.OnBeginOpenOverride = (TimeSpan t, AsyncCallback c, object s) => 359mco.OnCloseOverride = (TimeSpan t) => 366mco.OnBeginCloseOverride = (TimeSpan t, AsyncCallback c, object s) =>
MockInteractiveChannelInitializer.cs (1)
29MockAsyncResult result = new MockAsyncResult(TimeSpan.FromSeconds(30), callback, state);
MockRequestChannel.cs (6)
18public Func<Message, TimeSpan, Message> RequestOverride { get; set; } 19public Func<Message,TimeSpan,AsyncCallback,object, IAsyncResult> BeginRequestOverride { get; set; } 32public Message Request(Message message, TimeSpan timeout) 37public Message DefaultRequest(Message message, TimeSpan timeout) 49public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) 59public IAsyncResult DefaultBeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state)
TestData.cs (9)
17public static MemberDataSet<TimeSpan> ValidTimeOuts 21return new MemberDataSet<TimeSpan> 23{ TimeSpan.FromMilliseconds(0)}, 24{ TimeSpan.FromMinutes(1)}, 25{ TimeSpan.MaxValue}, 30public static MemberDataSet<TimeSpan> InvalidTimeOuts 34return new MemberDataSet<TimeSpan> 36{ TimeSpan.FromMinutes(-1)}, 37{ TimeSpan.MinValue},
TestHelpers.cs (2)
20public static readonly TimeSpan TestTimeout = TimeSpan.FromSeconds(20);
TestTypes.cs (2)
428private TimeSpan _timeSpanValue; 551public TimeSpan TimeSpanValue
VBCSCompiler (19)
src\Compilers\Server\VBCSCompiler\BuildServerController.cs (4)
60internal TimeSpan? GetKeepAliveTimeout() 74return TimeSpan.FromSeconds(keepAliveValue); 108TimeSpan? keepAlive = null, 143TimeSpan? keepAlive = null,
src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (3)
182private static TimeSpan? CheckForNewKeepAlive(BuildRequest request) 184TimeSpan? timeout = null; 196timeout = TimeSpan.FromSeconds(result);
src\Compilers\Server\VBCSCompiler\CompletionData.cs (2)
37internal TimeSpan? NewKeepAlive { get; } 40internal CompletionData(CompletionReason reason, TimeSpan? newKeepAlive = null, bool shutdownRequested = false)
src\Compilers\Server\VBCSCompiler\DiagnosticListener.cs (2)
19void UpdateKeepAlive(TimeSpan keepAlive); 39public void UpdateKeepAlive(TimeSpan keepAlive)
src\Compilers\Server\VBCSCompiler\NamedPipeClientConnectionHost.cs (1)
198var cancelTask = Task.Delay(TimeSpan.FromMilliseconds(-1), cancellationToken);
src\Compilers\Server\VBCSCompiler\ServerDispatcher.cs (7)
46internal static readonly TimeSpan DefaultServerKeepAlive = TimeSpan.FromMinutes(10); 52internal static readonly TimeSpan GCTimeout = TimeSpan.FromSeconds(30); 63private TimeSpan? _keepAlive; 81public void ListenAndDispatchConnections(TimeSpan? keepAlive, CancellationToken cancellationToken = default) 322private void ChangeKeepAlive(TimeSpan keepAlive)
VBCSCompiler.UnitTests (17)
BuildClientTests.cs (2)
144var oneSec = TimeSpan.FromSeconds(1);
BuildServerConnectionTests.cs (1)
101timeoutOverride: (int)TimeSpan.FromSeconds(2).TotalMilliseconds,
BuildServerControllerTests.cs (1)
35Assert.Equal(TimeSpan.FromSeconds(42), _controller.GetKeepAliveTimeout());
CompilerServerApiTest.cs (1)
104keepAlive: TimeSpan.FromMilliseconds(-1));
Extensions.cs (3)
41public static async ValueTask<T> TakeAsync<T>(this BlockingCollection<T> collection, TimeSpan? pollTimeSpan = null, CancellationToken cancellationToken = default) 43var delay = pollTimeSpan ?? TimeSpan.FromSeconds(.25);
ServerUtil.cs (4)
48internal static BuildRequest CreateEmptyCSharpWithKeepAlive(TimeSpan keepAlive, string workingDirectory, string tempDirectory = null) => BuildRequest.Create( 82TimeSpan? keepAlive = null) 88keepAlive ??= TimeSpan.FromMilliseconds(-1); 177TimeSpan? keepAlive = null)
TestableDiagnosticListener.cs (2)
15public TimeSpan? KeepAlive { get; set; } 28public void UpdateKeepAlive(TimeSpan keepAlive) => KeepAlive = keepAlive;
VBCSCompilerServerTests.cs (3)
285keepAlive: TimeSpan.FromSeconds(3), 310? ProtocolUtil.CreateEmptyCSharpWithKeepAlive(TimeSpan.FromSeconds(3), workingDirectory) 347await serverData.SendAsync(ProtocolUtil.CreateEmptyCSharpWithKeepAlive(TimeSpan.FromSeconds(3), workingDirectory));
Wasm.Performance.ConsoleHost (1)
Scenarios\ComponentRenderingScenarioBase.cs (1)
36var duration = DateTime.Now - startTime;
Wasm.Performance.Driver (5)
Program.cs (5)
46var stressRunDuration = TimeSpan.FromSeconds(stressRunSeconds); 79var timeForEachRun = TimeSpan.FromMinutes(3); 315if (!isDone.WaitOne(TimeSpan.FromSeconds(30)))
WindowsBase.Tests (30)
System\Windows\SplashScreenTests.cs (1)
62splashScreen.Close(TimeSpan.Zero);
System\Windows\Threading\DispatcherTimerTests.cs (29)
15Assert.Equal(TimeSpan.Zero, timer.Interval); 35Assert.Equal(TimeSpan.Zero, timer.Interval); 55Assert.Equal(TimeSpan.Zero, timer.Interval); 62yield return new object?[] { TimeSpan.FromMilliseconds(0), DispatcherPriority.ApplicationIdle }; 63yield return new object?[] { TimeSpan.FromMilliseconds(0), DispatcherPriority.Background }; 64yield return new object?[] { TimeSpan.FromMilliseconds(int.MaxValue), DispatcherPriority.ContextIdle }; 65yield return new object?[] { TimeSpan.FromMilliseconds(0), DispatcherPriority.DataBind }; 66yield return new object?[] { TimeSpan.FromMilliseconds(1), DispatcherPriority.Input }; 67yield return new object?[] { TimeSpan.FromMilliseconds(2), DispatcherPriority.Loaded }; 68yield return new object?[] { TimeSpan.FromMilliseconds(3), DispatcherPriority.Normal }; 69yield return new object?[] { TimeSpan.FromMilliseconds(4), DispatcherPriority.Render }; 70yield return new object?[] { TimeSpan.FromMilliseconds(5), DispatcherPriority.Send }; 71yield return new object?[] { TimeSpan.FromMilliseconds(6), DispatcherPriority.SystemIdle }; 76public void Ctor_TimeSpan_DispatcherPriority_EventHandler_Dispatcher(TimeSpan interval, DispatcherPriority priority) 94Assert.Throws<InvalidEnumArgumentException>("priority", () => new DispatcherTimer(TimeSpan.Zero, priority, (s, e) => {}, Dispatcher.CurrentDispatcher)); 102Assert.Throws<ArgumentException>("priority", () => new DispatcherTimer(TimeSpan.Zero, DispatcherPriority.Inactive, (s, e) => {}, Dispatcher.CurrentDispatcher)); 109Assert.Throws<ArgumentNullException>("dispatcher", () => new DispatcherTimer(TimeSpan.Zero, DispatcherPriority.Normal, (s, e) => {}, null)); 114yield return new object[] { TimeSpan.FromTicks(-1) }; 115yield return new object[] { TimeSpan.FromMilliseconds((double)int.MaxValue + 1) }; 116yield return new object[] { TimeSpan.MinValue }; 117yield return new object[] { TimeSpan.MaxValue }; 122public void Ctor_InvalidInterval_ThrowsArgumentOutOfRangeException(TimeSpan interval) 130Assert.Throws<ArgumentNullException>("callback", () => new DispatcherTimer(TimeSpan.Zero, DispatcherPriority.Normal, null, Dispatcher.CurrentDispatcher)); 155yield return new object[] { TimeSpan.Zero }; 156yield return new object[] { TimeSpan.FromMilliseconds(1) }; 157yield return new object[] { TimeSpan.FromMilliseconds(int.MaxValue) }; 162public void Interval_Set_GetReturnsExpected(TimeSpan value) 177public void Interval_SetEnabled_GetReturnsExpected(TimeSpan value) 195public void Interval_SetInvalid_ThrowsArgumentOutOfRangeException(TimeSpan value)
xunit.assert (8)
EqualityAsserts.cs (8)
508 Equal(expected, actual, TimeSpan.Zero); 520 TimeSpan precision) 522 var difference = (expected - actual).Duration(); 528 (precision == TimeSpan.Zero ? "" : string.Format(CultureInfo.CurrentCulture, " (difference {0} is larger than {1})", difference, precision)); 542 Equal(expected, actual, TimeSpan.Zero); 554 TimeSpan precision) 556 var difference = (expected - actual).Duration(); 562 (precision == TimeSpan.Zero ? "" : string.Format(CultureInfo.CurrentCulture, " (difference {0} is larger than {1})", difference, precision));
xunit.console (1)
ConsoleRunner.cs (1)
397resultsSink = new DelegatingLongRunningTestDetectionSink(resultsSink, TimeSpan.FromSeconds(longRunningSeconds), MessageSinkWithTypesAdapter.Wrap(diagnosticMessageSink));