275 instantiations of TimeSpan
Aspire.Hosting.Azure.Tests (1)
AzureContainerRegistryTests.cs (1)
338.WithPurgeTask("0 0 * * *", ago: new TimeSpan(2, 3, 6, 0));
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);
Microsoft.AspNetCore.Server.HttpSys (1)
TimeoutManager.cs (1)
174return new TimeSpan(0, 0, (int)_timeouts[(int)type]);
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
705refreshIn = new TimeSpan(tokenLifetime.Ticks / 2);
Microsoft.Build (4)
BackEnd\BuildManager\BuildSubmissionBase.cs (1)
70public bool IsCompleted => WaitHandle.WaitOne(new TimeSpan(0));
BackEnd\Components\Communications\NodeEndpointInProc.cs (1)
400if (!_packetPump.Join((int)new TimeSpan(0, 0, BuildParameters.EndpointShutdownTimeout).TotalMilliseconds))
Logging\BaseConsoleLogger.cs (1)
731protected TimeSpan elapsedTime = new TimeSpan(0);
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1815return new TimeSpan(_binaryReader.ReadInt64());
Microsoft.Build.Framework (2)
BinaryTranslator.cs (1)
469value = new System.TimeSpan(ticks);
Telemetry\BuildCheckTelemetry.cs (1)
53TimeSpan totalRuntime = new TimeSpan(runtimeTicks);
Microsoft.Extensions.AI (1)
Common\FunctionInvocationHelpers.cs (1)
39new((long)((Stopwatch.GetTimestamp() - startingTimestamp) * ((double)TimeSpan.TicksPerSecond / Stopwatch.Frequency)));
Microsoft.Extensions.AI.Abstractions.Tests (1)
parent\parent\Shared\JsonSchemaExporter\TestTypes.cs (1)
90Value: new(hours: 5, minutes: 13, seconds: 3),
Microsoft.Extensions.Caching.Memory (1)
CacheEntry.cs (1)
72var 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\aspnetcore\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)
786timeSpan = new TimeSpan(0, 0, seconds);
Microsoft.Private.Windows.Core (2)
System\IO\BinaryReaderExtensions.cs (1)
178values.Add((T)(object)new TimeSpan(reader.ReadInt64()));
System\Value.PackedDateTimeOffset.cs (1)
70TimeSpan offset = new(
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);
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)
6470_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)
211return 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.Data.OleDb (2)
System\Data\ProviderBase\DbBuffer.cs (1)
651return new TimeSpan(
System\Data\ProviderBase\DbConnectionPoolOptions.cs (1)
31_loadBalanceTimeout = new TimeSpan(0, 0, loadBalanceTimeout);
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Activity.cs (1)
775Duration = new TimeSpan(1); // We want Duration of 0 to mean 'EndTime not set)
System.DirectoryServices (8)
System\DirectoryServices\ActiveDirectory\ActiveDirectorySiteLink.cs (2)
22private readonly TimeSpan _systemDefaultInterval = new TimeSpan(0, 15, 0); 295return new TimeSpan(0, tmpValue, 0);
System\DirectoryServices\ActiveDirectory\ADSearcher.cs (1)
11private static readonly TimeSpan s_defaultTimeSpan = new TimeSpan(0, 120, 0);
System\DirectoryServices\ActiveDirectory\ConfigSet.cs (1)
30private static readonly TimeSpan s_locationTimeout = new TimeSpan(0, 4, 0);
System\DirectoryServices\DirectorySearcher.cs (4)
23private static readonly TimeSpan s_minusOneSecond = new TimeSpan(0, 0, -1); 680if (ServerTimeLimit >= new TimeSpan(0)) 695if (ClientTimeout >= new TimeSpan(0)) 713if (ServerPageTimeLimit >= new TimeSpan(0))
System.DirectoryServices.AccountManagement (9)
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_Query.cs (1)
122((DirectorySearcher)ps.UnderlyingSearcher).ServerTimeLimit = new TimeSpan(0, 0, 30); // 30 seconds
System\DirectoryServices\AccountManagement\AD\ADStoreCtx.cs (4)
1033ds.ServerTimeLimit = new TimeSpan(0, 0, 30); // 30 seconds 1436ds.ServerTimeLimit = new TimeSpan(0, 0, 30); // 30 seconds 1712ds.ServerTimeLimit = new TimeSpan(0, 0, 30); // 30 seconds 1815ds.ServerTimeLimit = new TimeSpan(0, 0, 30); // 30 seconds
System\DirectoryServices\AccountManagement\AD\SDSUtils.cs (1)
770ds.ClientTimeout = new TimeSpan(0, 0, 30);
System\DirectoryServices\AccountManagement\SAM\SAMQuerySet.cs (2)
376value = DateTime.UtcNow - new TimeSpan(0, 0, secondsLapsed); 759storeValue = DateTime.UtcNow - new TimeSpan(0, 0, secondsLapsed);
System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx_LoadStore.cs (1)
867Nullable<DateTime> dt = DateTime.UtcNow - new TimeSpan(0, 0, secondsLapsed);
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.Management (2)
System\Management\ManagementDateTime.cs (2)
368timespan = new System.TimeSpan(days, hours, minutes, seconds, 0); 426TimeSpan tsTemp = new TimeSpan(timespan.Days, timespan.Hours, timespan.Minutes, timespan.Seconds, 0);
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 (69)
src\runtime\src\libraries\Common\src\System\TimeProvider.cs (1)
117return new TimeSpan((long)((endingTimestamp - startingTimestamp) * ((double)TimeSpan.TicksPerSecond / timestampFrequency)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppDomain.Unix.cs (1)
21return new TimeSpan((long)userTime100Nanoseconds);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (1)
116private static TimeSpan NullOffset => new TimeSpan(DateTimeFormat.NullOffset);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpan.cs (1)
174timeSpan = new TimeSpan(ticks);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\DateTime.cs (3)
1531public TimeSpan TimeOfDay => new TimeSpan((long)(UTicks % TimeSpan.TicksPerDay)); 1643return new TimeSpan(Ticks - value.Ticks); 1860public static TimeSpan operator -(DateTime d1, DateTime d2) => new TimeSpan(d1.Ticks - d2.Ticks);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Stopwatch.cs (2)
76public TimeSpan Elapsed => new(ElapsedTimeSpanTicks); 107new((long)((endingTimestamp - startingTimestamp) * s_tickFrequency));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (1)
288_nextPollingOffset += new TimeSpan(missed * _pollingInterval.Ticks);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSource.cs (8)
82_gen0GCCounter ??= new IncrementingPollingCounter("gen-0-gc-count", this, () => GC.CollectionCount(0)) { DisplayName = "Gen 0 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 83_gen1GCCounter ??= new IncrementingPollingCounter("gen-1-gc-count", this, () => GC.CollectionCount(1)) { DisplayName = "Gen 1 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 84_gen2GCCounter ??= new IncrementingPollingCounter("gen-2-gc-count", this, () => GC.CollectionCount(2)) { DisplayName = "Gen 2 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 87_monitorContentionCounter ??= new IncrementingPollingCounter("monitor-lock-contention-count", this, () => Monitor.LockContentionCount) { DisplayName = "Monitor Lock Contention Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; 89_completedItemsCounter ??= new IncrementingPollingCounter("threadpool-completed-items-count", this, () => ThreadPool.CompletedWorkItemCount) { DisplayName = "ThreadPool Completed Work Item Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; 90_allocRateCounter ??= new IncrementingPollingCounter("alloc-rate", this, () => GC.GetTotalAllocatedBytes()) { DisplayName = "Allocation Rate", DisplayUnits = "B", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; 98_exceptionCounter ??= new IncrementingPollingCounter("exception-count", this, () => Exception.GetExceptionCount()) { DisplayName = "Exception Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; 110_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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (2)
918Format(dateTime, format, provider, new TimeSpan(NullOffset)); 1046TryFormat(dateTime, destination, out charsWritten, format, provider, new TimeSpan(NullOffset));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (9)
570result = new TimeSpan(hourOffset, minuteOffset, 0); 1115result.timeZoneOffset = new TimeSpan(0); 3340result = (new TimeSpan(hourOffset, minuteOffset, 0)); 4056result.timeZoneOffset = new TimeSpan(0); 4355TimeSpan tempTimeZoneOffset = new TimeSpan(0); 4378result.timeZoneOffset = new TimeSpan(0); 4404result.timeZoneOffset = new TimeSpan(0); 4410TimeSpan tempTimeZoneOffset = new TimeSpan(0); 5286result.timeZoneOffset = new TimeSpan(offsetHours, offsetMinutes, 0);
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (2)
595return new TimeSpan(_store.ReadInt64()); 696return new TimeSpan(ticks);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Timeout.cs (1)
11public static readonly TimeSpan InfiniteTimeSpan = new TimeSpan(0, 0, 0, 0, Infinite);
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.StringSerializer.cs (3)
554return new TimeSpan(hours: 0, minutes: token, seconds: 0); 667new TimeSpan(daylightDeltaTicks), 670new TimeSpan(baseUtcOffsetDeltaTicks),
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (6)
118_baseUtcOffset = new TimeSpan(_baseUtcOffset.Hours, _baseUtcOffset.Minutes, 0); 665result = new TimeSpan(result.Hours, result.Minutes, 0); 734daylightSavingsTimeSpan = new TimeSpan(1, 0, 0); 796result = new TimeSpan(hours, 0, 0); 826timeOffset = new TimeSpan(timeOffset.GetValueOrDefault().Hours, timeOffset.GetValueOrDefault().Minutes, timeOffset.GetValueOrDefault().Seconds); 1313UtcOffset = new TimeSpan(0, 0, TZif_ToInt32(data, index + 00));
System\GC.NativeAot.cs (1)
878return new TimeSpan(RuntimeImports.RhGetTotalPauseDuration());
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)
178values.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)
386XsdDateTimeKind.LocalEastOfZulu => new DateTime(_dt.Subtract(new TimeSpan(ZoneHour, ZoneMinute, 0)).Ticks, DateTimeKind.Utc), 387XsdDateTimeKind.LocalWestOfZulu => new DateTime(_dt.Add(new TimeSpan(ZoneHour, ZoneMinute, 0)).Ticks, DateTimeKind.Utc), 440ticks = result.Ticks - new TimeSpan(xdt.ZoneHour, xdt.ZoneMinute, 0).Ticks; 453ticks = result.Ticks + new TimeSpan(xdt.ZoneHour, xdt.ZoneMinute, 0).Ticks; 495result = new DateTimeOffset(dt, new TimeSpan(xdt.ZoneHour, xdt.ZoneMinute, 0)); 498result = new DateTimeOffset(dt, new TimeSpan(-xdt.ZoneHour, -xdt.ZoneMinute, 0)); 501result = 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\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (2)
595return new TimeSpan(_store.ReadInt64()); 696return 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.Security.Cryptography (1)
System\Security\Cryptography\X509Certificates\FindPal.Windows.cs (1)
451new TimeSpan(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.ServiceProcess.ServiceController (1)
System\ServiceProcess\ServiceController.cs (1)
952currentDependent.WaitForStatus(ServiceControllerStatus.Stopped, new TimeSpan(0, 0, 30));
System.Speech (14)
Internal\SapiInterop\SpeechEvent.cs (2)
42_audioPosition = audioFormat.AverageBytesPerSecond > 0 ? new TimeSpan((long)((sapiEvent.ullAudioStreamOffset * TimeSpan.TicksPerSecond) / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero; 48_audioPosition = new TimeSpan((long)sapiEventEx.ullAudioTimeOffset);
Internal\Synthesis\AudioDeviceOut.cs (2)
337return new TimeSpan(0); 339return new TimeSpan((_bytesWritten * TimeSpan.TicksPerSecond) / _nAvgBytesPerSec);
Internal\Synthesis\AudioFileOut.cs (2)
208return new TimeSpan(0); 210return new TimeSpan((_bytesWritten * TimeSpan.TicksPerSecond) / _wfxIn.nAvgBytesPerSec);
Recognition\RecognizerBase.cs (4)
1139return audioFormat.AverageBytesPerSecond > 0 ? new TimeSpan((long)((recoStatus.AudioStatus.CurDevicePos * TimeSpan.TicksPerSecond) / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero; 1169return new TimeSpan((long)recoStatus.ullRecognitionStreamTime); 2815audioPosition = audioFormat.AverageBytesPerSecond > 0 ? new TimeSpan((long)((recoStatus.AudioStatus.CurDevicePos * TimeSpan.TicksPerSecond) / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero; 2816recognizerPosition = new TimeSpan((long)recoStatus.ullRecognitionStreamTime);
Result\RecognitionResult.cs (2)
261_audioPosition ??= new TimeSpan((long)_header.times.ullStart); 270_audioDuration ??= new TimeSpan((long)_header.times.ullLength);
Result\RecognizedPhrase.cs (2)
204wordList.Add(new RecognizedWordUnit(displayForm, element.SREngineConfidence, pronunciation, lexicalForm!, displayAttributes, new TimeSpan(element.ulAudioTimeOffset * TimeSpan.TicksPerMillisecond / 10000), new TimeSpan(element.ulAudioSizeTime * TimeSpan.TicksPerMillisecond / 10000)));
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)
135MatchTimeout = new TimeSpan(info.GetInt64("timeoutTicks"));
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\SlidingWindowRateLimiter.cs (1)
89_replenishmentPeriod = new TimeSpan(_options.Window.Ticks / _options.SegmentsPerWindow);
System.Transactions.Local (3)
System\Transactions\TransactionManager.cs (3)
292return new TimeSpan(Interlocked.Read(ref s_defaultTimeoutTicks)); 336return new TimeSpan(Interlocked.Read(ref s_maximumTimeoutTicks)); 353TimeSpan timeout = new TimeSpan(s_defaultTimeoutTicks);
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);
vstest.console (1)
CommandLine\CommandLineOptions.cs (1)
45private readonly TimeSpan _defaultRetrievalTimeout = new(0, 0, 0, 1, 500);
vstest.console.arm64 (1)
src\vstest\src\vstest.console\CommandLine\CommandLineOptions.cs (1)
45private readonly TimeSpan _defaultRetrievalTimeout = new(0, 0, 0, 1, 500);
14575 references to TimeSpan
aspire (403)
Acquisition\PeerInstallProbe.cs (4)
35internal static readonly TimeSpan s_defaultTimeout = TimeSpan.FromSeconds(5); 51private readonly TimeSpan _timeout; 59internal PeerInstallProbe(TimeSpan timeout, ILogger<PeerInstallProbe> logger)
Agents\AspireSkills\AspireSkillsInstaller.cs (11)
54private static readonly TimeSpan s_cacheLockInitialRetryDelay = TimeSpan.FromMilliseconds(100); 55private static readonly TimeSpan s_cacheLockMaxRetryDelay = TimeSpan.FromMilliseconds(400); 56private static readonly TimeSpan s_defaultMaxCacheAge = TimeSpan.FromDays(7); 859var retryDelay = s_cacheLockInitialRetryDelay; 972var maxAge = ReadWindow(configuration, MaxCacheAgeKey, s_defaultMaxCacheAge); 1095private static TimeSpan ReadWindow(IConfiguration configuration, string key, TimeSpan fallback) 1099return TimeSpan.FromSeconds(seconds);
Backchannel\AppHostCliBackchannel.cs (4)
257var maxWait = TimeSpan.FromSeconds(60); 455var maxWait = TimeSpan.FromSeconds(30);
Backchannel\AuxiliaryBackchannelMonitor.cs (11)
31private static readonly TimeSpan s_maxRetryElapsed = TimeSpan.FromSeconds(3); 32private static readonly TimeSpan s_maxRetryDelay = TimeSpan.FromSeconds(1); 239using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(1)); 417var maxElapsed = s_maxRetryElapsed; 418var delay = TimeSpan.FromMilliseconds(100); 419var maxDelay = s_maxRetryDelay; 432delay = TimeSpan.FromMilliseconds(Math.Min(delay.TotalMilliseconds * 2, maxDelay.TotalMilliseconds)); 465var socketAge = _timeProvider.GetUtcNow() - fileInfo.CreationTimeUtc;
Backchannel\ExtensionBackchannel.cs (3)
150using var timer = new PeriodicTimer(TimeSpan.FromMilliseconds(50)); 169var waitingFor = DateTimeOffset.UtcNow - startTime; 170if (waitingFor > TimeSpan.FromSeconds(10))
Bundles\BundleService.cs (7)
60private static readonly TimeSpan s_directoryMoveMaxRetryElapsed = TimeSpan.FromSeconds(3); 61private static readonly TimeSpan s_directoryMoveMaxRetryDelay = TimeSpan.FromSeconds(1); 401var delay = TimeSpan.FromMilliseconds(100); 423delay = TimeSpan.FromMilliseconds(Math.Min(
Caching\DiskCache.cs (13)
13private static readonly TimeSpan s_defaultCacheExpiryWindow = TimeSpan.FromHours(3); 14private static readonly TimeSpan s_defaultMaxCacheAge = TimeSpan.FromDays(7); 18private readonly TimeSpan _expiryWindow; 19private readonly TimeSpan _maxAge; 40private static TimeSpan ReadWindow(IConfiguration configuration, string key, TimeSpan fallback) 44return TimeSpan.FromSeconds(seconds); 210var age = TimeSpan.FromSeconds(currentUnixTime - ts); 245var age = TimeSpan.FromSeconds(currentUnixTime - ts);
Certificates\CertificateGeneration\MacOSCertificateManager.cs (2)
286var maxRegexTimeout = TimeSpan.FromMinutes(1);
Certificates\CertificateHelpers.cs (1)
130if (!process.WaitForExit(TimeSpan.FromSeconds(5)))
Certificates\NativeCertificateToolRunner.cs (3)
84now, now.Add(TimeSpan.FromDays(365)), 108now, now.Add(TimeSpan.FromDays(365)), 130certificate = certificateManager.CreateAspNetCoreHttpsDevelopmentCertificate(now, now.Add(TimeSpan.FromDays(365)));
Commands\AppHostLauncher.cs (16)
50private static readonly TimeSpan s_legacyDetachedStartupStabilityWindow = TimeSpan.FromSeconds(2); 51private static readonly TimeSpan s_legacyDetachedStartupProbeInterval = TimeSpan.FromMilliseconds(100); 145TimeSpan? stopAfterLaunchDelay, 244updateStatus => LaunchAndWaitForBackchannelAsync(executablePath, childArgs, expectedHash, legacyHashes, appHostSelectionOrigin, TimeSpan.FromSeconds(timeoutSeconds), updateStatus, cancellationToken)); 285private async Task StopLaunchedAppHostAsync(LaunchResult result, TimeSpan delay, CancellationToken cancellationToken) 287if (delay > TimeSpan.Zero) 307await childProcess.WaitForExitAsync(cancellationToken).WaitAsync(TimeSpan.FromSeconds(10), cancellationToken).ConfigureAwait(false); 483TimeSpan timeout, 578var remainingTimeout = timeout - (timeProvider.GetUtcNow() - startTime); 579if (remainingTimeout <= TimeSpan.Zero) 645var waitTask = Task.Delay(TimeSpan.FromMilliseconds(500), timeProvider, cancellationToken); 720TimeSpan remainingTimeout, 724var stabilityWindow = remainingTimeout < s_legacyDetachedStartupStabilityWindow 749TimeSpan stabilityWindow,
Commands\AppHostStartupTimeout.cs (6)
38public static TimeSpan GetBackchannelConnectionTimeout(IConfiguration configuration) 44&& seconds <= TimeSpan.MaxValue.TotalSeconds) 46return TimeSpan.FromSeconds(seconds); 49var timeout = TimeSpan.FromSeconds(WaitCommand.DefaultTimeoutSeconds); 53timeout = TimeSpan.FromSeconds(startupTimeoutSeconds);
Commands\BaseCommand.cs (4)
20private static readonly TimeSpan s_extensionInteractionFlushTimeout = TimeSpan.FromSeconds(10); 51protected virtual TimeSpan GracefulShutdownBudget => TimeSpan.Zero;
Commands\DashboardRunCommand.cs (3)
24private static readonly TimeSpan s_bundleStatusDelay = TimeSpan.FromMilliseconds(200); 441using var timeoutCts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
Commands\InstallationInfoOutput.cs (4)
14internal static readonly TimeSpan s_defaultDiscoveryTimeout = TimeSpan.FromSeconds(30); 27TimeSpan timeout, 30ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(timeout, TimeSpan.Zero);
Commands\LsCommand.cs (2)
193var statusRefreshInterval = TimeSpan.FromSeconds(1);
Commands\PipelineCommandBase.cs (1)
942var duration = DateTime.UtcNow - task.StartTime;
Commands\RenderCommand.cs (93)
265await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken); 280await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken); 295await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken); 356await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken); 363() => Thread.Sleep(TimeSpan.FromSeconds(1)), 487new("root", "Pipeline", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(14), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromSeconds(14)), 488new("level-1", "Provision", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(12), null, "root", 1, 2, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(13)), 489new("level-2", "Generate templates", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(10), null, "level-1", 2, 3, TimeSpan.FromSeconds(1.5), TimeSpan.FromSeconds(11.5)), 490new("level-3", "Upload manifests", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(8), null, "level-2", 3, 4, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(10)), 491new("level-4", "Wait for deployment", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(6), null, "level-3", 4, 5, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(9)), 492new("level-5", "Finalize output", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(2), null, "level-4", 5, 6, TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(11)), 493new("level-10", "Leaf nested 10 levels deep", ConsoleActivityLogger.ActivityState.Warning, TimeSpan.FromSeconds(1), null, "level-5", 10, 7, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(11)), 494new("level-11", "This is a very very very very very long name", ConsoleActivityLogger.ActivityState.Warning, TimeSpan.FromSeconds(1), null, "level-10", 11, 8, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(11)), 504new("root", "Publish the application with a deliberately long root step display name", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(20), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromSeconds(20)), 505new("child", "Generate deployment assets for every resource with an extremely verbose child label", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(12), null, "root", 1, 2, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(14)), 506new("grandchild", "Write an unusually long manifest filename that would normally push the timeline off screen", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(3), null, "child", 2, 3, TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(11)), 511new("root", "Build [web] frontend", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromMilliseconds(120), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromMilliseconds(120)), 512new("child", "Deploy [api] service", ConsoleActivityLogger.ActivityState.Failure, TimeSpan.FromMilliseconds(35), "Failure while parsing [[resource]] => [bold]{bad}[/]", "root", 1, 2, TimeSpan.FromMilliseconds(60), TimeSpan.FromMilliseconds(95)), 513new("sibling", "Notify [observers]", ConsoleActivityLogger.ActivityState.Warning, TimeSpan.FromMilliseconds(12), null, "root", 1, 3, TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(112)), 518new("root-a", "Restore", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(5), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromSeconds(5)), 519new("orphan", "Orphaned child falls back to root ordering", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(2), null, "missing-parent", 1, 2, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(3)), 520new("root-b", "Publish", ConsoleActivityLogger.ActivityState.Warning, TimeSpan.FromSeconds(4), null, null, 0, 3, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(9)), 521new("child-b", "Package", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(1), null, "root-b", 1, 4, TimeSpan.FromSeconds(6), TimeSpan.FromSeconds(7)), 522new("info-step", "Using cached configuration", ConsoleActivityLogger.ActivityState.Info, TimeSpan.FromSeconds(0), null, "root-b", 1, 5, TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(7)), 523new("root-c", "Validate", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(2), null, null, 0, 6, TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(11)), 528new("root", "Full pipeline", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromMinutes(3), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromMinutes(3)), 529new("tiny", "Tiny 0.2ms event", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromMilliseconds(0.2), null, "root", 1, 2, TimeSpan.FromMilliseconds(5), TimeSpan.FromMilliseconds(5.2)), 530new("mid", "HTTP publish", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(18), null, "root", 1, 3, TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(48)), 531new("late", "Finalize", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(2), null, "root", 1, 4, TimeSpan.FromMinutes(2.5), TimeSpan.FromMinutes(2.53333333333333)), 532new("zero", "Zero event", ConsoleActivityLogger.ActivityState.Success, TimeSpan.Zero, null, "root", 1, 5, TimeSpan.FromMinutes(2.51), TimeSpan.FromMinutes(2.51)), 537new("root", "Deploy to Azure", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(30), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromSeconds(30)), 538new("provision", "Provision resources", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(18), null, "root", 1, 2, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(20)), 539new("configure", "Configure endpoints", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(8), null, "root", 1, 3, TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(28)), 644Timestamp = new DateTimeOffset(2026, 4, 23, 10, 30, 1, TimeSpan.Zero), 659Timestamp = new DateTimeOffset(2026, 4, 23, 10, 30, 5, TimeSpan.Zero), 674Timestamp = new DateTimeOffset(2026, 4, 23, 10, 30, 2, TimeSpan.Zero), 689Timestamp = new DateTimeOffset(2026, 4, 23, 10, 30, 8, TimeSpan.Zero),
Commands\RunCommand.cs (23)
80private static readonly TimeSpan s_appHostStartupCancellationTimeout = TimeSpan.FromSeconds(5); 90internal static readonly TimeSpan s_gracefulShutdownBudget = TimeSpan.FromSeconds(5); 96private static readonly TimeSpan s_detachedAppHostTeardownTimeout = s_gracefulShutdownBudget + TimeSpan.FromSeconds(3); 101private static readonly TimeSpan s_startupFailureObservationWindow = TimeSpan.FromSeconds(2); 105protected override TimeSpan GracefulShutdownBudget => s_gracefulShutdownBudget; 171var captureProfileDelay = TimeSpan.FromSeconds(parseResult.GetValue(RootCommand.CaptureProfileDelayOption)); 344var startupTimeout = TimeSpan.FromSeconds(timeoutSeconds); 794TimeSpan startupTimeout, 881TimeSpan startupTimeout, 976TimeSpan delay, 983if (delay > TimeSpan.Zero) 1214? TimeSpan.FromSeconds(parseResult.GetValue(RootCommand.CaptureProfileDelayOption)) 1215: (TimeSpan?)null; 1247private TimeSpan GetRemainingStartupTimeout(long startupStartTimestamp, TimeSpan startupTimeout) 1249var elapsed = _timeProvider.GetElapsedTime(startupStartTimestamp); 1250return elapsed >= startupTimeout ? TimeSpan.Zero : startupTimeout - elapsed;
Commands\StartCommand.cs (2)
66? TimeSpan.FromSeconds(parseResult.GetValue(RootCommand.CaptureProfileDelayOption)) 67: (TimeSpan?)null;
Commands\TelemetryCommandHelpers.cs (1)
561public static string FormatDuration(TimeSpan duration)
Commands\TelemetrySpansCommand.cs (1)
256var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano);
Commands\TelemetryTracesCommand.cs (6)
245var traceInfos = new Dictionary<string, (string Resource, string FirstSpanName, string TraceId, ulong? StartTimeNano, TimeSpan Duration, int SpanCount, bool HasError)>(); 262var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 267var maxDuration = info.Duration > duration ? info.Duration : duration; 319var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 340var totalDuration = rootSpans.Count > 0 ? rootSpans.Max(s => s.Duration) : spans.Max(s => s.Duration); 431TimeSpan Duration,
Commands\WaitCommand.cs (1)
143var elapsed = _timeProvider.GetElapsedTime(startTimestamp);
ConsoleCancellationManager.cs (8)
68private readonly TimeSpan _finalDrainBudget; 76private TimeSpan _gracefulBudget = TimeSpan.Zero; 108public ConsoleCancellationManager(TimeSpan finalDrainBudget) 174public bool IsEnabled => _gracefulBudget > TimeSpan.Zero; 184public void ConfigureForCommand(TimeSpan gracefulBudget) 186if (gracefulBudget < TimeSpan.Zero) 213if (_gracefulBudget <= TimeSpan.Zero)
Documentation\Docs\DocsIndexService.cs (2)
198var cacheElapsedTime = Stopwatch.GetElapsedTime(startTimestamp); 212var elapsedTime = Stopwatch.GetElapsedTime(startTimestamp);
DotNet\DotNetCliRunner.cs (9)
188private static readonly TimeSpan[] s_searchRetryDelays = [TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2)]; 501using var timer = new PeriodicTimer(TimeSpan.FromMilliseconds(50)); 509var connectionTimeout = AppHostStartupTimeout.GetBackchannelConnectionTimeout(configuration); 550var waitingFor = DateTimeOffset.UtcNow - startTime; 559if (waitingFor > TimeSpan.FromSeconds(10)) 878await Task.Delay(TimeSpan.FromSeconds(attempt + 1), cancellationToken).ConfigureAwait(false); 1573var delay = s_searchRetryDelays[delayIndex];
DotNet\ProcessExecution.cs (6)
21private static readonly TimeSpan s_drainIdleTimeout = TimeSpan.FromSeconds(5); 22private static readonly TimeSpan s_drainPollInterval = TimeSpan.FromMilliseconds(100); 347using var killDrain = new CancellationTokenSource(TimeSpan.FromSeconds(1)); 376using var drainCts = new CancellationTokenSource(TimeSpan.FromSeconds(2));
NuGet\NuGetPackageCache.cs (1)
102entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(1);
Processes\ProcessTreeGracefulShutdownService.cs (4)
27private static readonly TimeSpan s_processTerminationTimeout = TimeSpan.FromSeconds(10); 28private static readonly TimeSpan s_processTerminationPollInterval = TimeSpan.FromMilliseconds(250);
Profiling\ProfileCaptureOptions.cs (2)
23TimeSpan StartupDelay) 95TimeSpan.FromSeconds(startupDelaySeconds));
Profiling\ProfileCaptureService.cs (16)
39private static readonly TimeSpan s_dashboardStartTimeout = TimeSpan.FromSeconds(90); 40private static readonly TimeSpan s_profileDataTimeout = TimeSpan.FromSeconds(10); 41private static readonly TimeSpan s_pollInterval = TimeSpan.FromMilliseconds(250); 47private static readonly TimeSpan s_dashboardDisposeTimeout = TimeSpan.FromSeconds(5); 56TimeSpan dashboardStartTimeout, 57TimeSpan pollInterval, 227private readonly TimeSpan _profileDataTimeout; 228private readonly TimeSpan _profileDataPollInterval; 249TimeSpan profileDataTimeout, 250TimeSpan profileDataPollInterval, 267public async Task WaitForDashboardAsync(TimeSpan timeout, TimeSpan pollInterval, CancellationToken cancellationToken)
Program.cs (1)
1034using var cancellationManager = new ConsoleCancellationManager(finalDrainBudget: TimeSpan.FromSeconds(5));
Projects\AppHostRpcClient.cs (2)
196while ((DateTimeOffset.UtcNow - startTime) < TimeSpan.FromSeconds(ConnectionTimeoutSeconds)) 228while ((DateTimeOffset.UtcNow - startTime) < TimeSpan.FromSeconds(ConnectionTimeoutSeconds))
Projects\AppHostServerClosureSnapshots.cs (2)
326private static readonly TimeSpan s_stagingCleanupAge = TimeSpan.FromHours(1);
Projects\GuestAppHostProject.cs (3)
1303var connectionTimeout = AppHostStartupTimeout.GetBackchannelConnectionTimeout(_configuration); 1360var waitingFor = DateTimeOffset.UtcNow - startTime; 1375if (waitingFor > TimeSpan.FromSeconds(10))
Projects\ProjectLocator.cs (2)
155private static readonly TimeSpan s_workspaceConfigLockTimeout = TimeSpan.FromSeconds(30);
src\Shared\ChannelExtensions.cs (3)
27TimeSpan? minReadInterval = null, 40var s = lastRead.Value.Add(minReadInterval.Value) - DateTime.UtcNow; 41if (s > TimeSpan.Zero)
src\Shared\ContainerRuntimeDetector.cs (2)
89private static readonly TimeSpan s_processTimeout = TimeSpan.FromSeconds(10);
src\Shared\DurationFormatter.cs (14)
37new UnitStep { Unit = "d", Ticks = TimeSpan.TicksPerDay, Threshold = TimeSpan.TicksPerDay }, 38new UnitStep { Unit = "h", Ticks = TimeSpan.TicksPerHour, Threshold = TimeSpan.TicksPerHour }, 39new UnitStep { Unit = "m", Ticks = TimeSpan.TicksPerMinute, Threshold = TimeSpan.TicksPerMinute }, 40new UnitStep { Unit = "s", Ticks = TimeSpan.TicksPerSecond, Threshold = TimeSpan.TicksPerSecond / 10, IsDecimal = true }, 41new UnitStep { Unit = "ms", Ticks = TimeSpan.TicksPerMillisecond, Threshold = TimeSpan.TicksPerMillisecond / 100, IsDecimal = true }, 42new UnitStep { Unit = "μs", Ticks = TimeSpan.TicksPerMicrosecond, Threshold = TimeSpan.TicksPerMicrosecond, IsDecimal = true }, 45public static string FormatDuration(TimeSpan duration, CultureInfo? culture = null, DecimalDurationDisplay decimalDisplay = DecimalDurationDisplay.Optional) 71public static string GetUnit(TimeSpan duration)
src\Shared\FileLock.cs (7)
32private static readonly TimeSpan s_defaultRetryDelay = TimeSpan.FromMilliseconds(10); 33private static readonly TimeSpan s_defaultTimeout = TimeSpan.FromMinutes(5); 69/// Uses <see cref="Task.Delay(TimeSpan, CancellationToken)"/> between retries to avoid blocking the thread pool. 76public static async Task<FileLock> AcquireAsync(string lockPath, CancellationToken cancellationToken = default, TimeSpan? timeout = null) 78var effectiveTimeout = timeout ?? s_defaultTimeout;
src\Shared\Otlp\OtlpHelpers.cs (7)
57var timeSinceEpoch = dateTime.ToUniversalTime() - DateTime.UnixEpoch; 58return (ulong)timeSinceEpoch.Ticks * TimeSpan.NanosecondsPerTick; 66return (long)(nanoseconds / TimeSpan.NanosecondsPerTick); 72public static TimeSpan NanosecondsToTimeSpan(ulong nanoseconds) 74return TimeSpan.FromTicks(NanosecondsToTicks(nanoseconds)); 80public static TimeSpan CalculateDuration(ulong? startNano, ulong? endNano) 86return TimeSpan.Zero;
src\Shared\ParentProcessLivenessMonitor.cs (2)
13private static readonly TimeSpan s_pollInterval = TimeSpan.FromSeconds(1);
src\Shared\ProcessSignaler.cs (2)
25public static void RequestGracefulShutdownWithRuntimeStartTime(int pid, DateTimeOffset expectedStartTime, TimeSpan tolerance, ILogger logger) 130public static Process? TryGetRunningProcessWithRuntimeStartTime(int pid, DateTimeOffset expectedStartTime, TimeSpan tolerance, ILogger logger)
src\Shared\ProcessStartTimeHelper.cs (9)
26public static readonly TimeSpan LegacyStartTimeMatchTolerance = TimeSpan.FromSeconds(1); 37public static readonly TimeSpan StableStartTimeMatchTolerance = TimeSpan.FromMilliseconds(20); 144TimeSpan? tolerance = null, 160TimeSpan? tolerance, 233public static bool IsProcessRunningWithRuntimeStartTime(int pid, long expectedStartTimeUnixSeconds, TimeSpan? tolerance = null) 281public static bool AreClose(long expectedStartTimeUnixSeconds, long actualStartTimeUnixSeconds, TimeSpan? tolerance = null) 296public static bool AreCloseMilliseconds(long expectedStartTimeUnixMilliseconds, long actualStartTimeUnixMilliseconds, TimeSpan? tolerance = null)
Telemetry\InternalMicrosoftDetector.cs (14)
40private static readonly TimeSpan s_cacheRefreshInterval = TimeSpan.FromHours(6); 41private static readonly TimeSpan s_processProbeTimeout = TimeSpan.FromSeconds(3); 42private static readonly TimeSpan s_cancelledProbeDrainTimeout = TimeSpan.FromSeconds(1); 43private static readonly TimeSpan s_gitHubHttpTimeout = TimeSpan.FromSeconds(3); 44private static readonly TimeSpan s_gitHubCandidateTimeout = TimeSpan.FromSeconds(5); 51private readonly TimeSpan _gitHubCandidateTimeout; 52private readonly TimeSpan _gitHubHttpTimeout; 78TimeSpan? gitHubCandidateTimeout = null, 79TimeSpan? gitHubHttpTimeout = null)
Telemetry\ProfilingTelemetry.cs (2)
399internal ActivityScope StartProfileCaptureDelay(TimeSpan delay) 1098public void SetProfileCaptureDelay(TimeSpan delay) => SetTag(Tags.ProfileCaptureDelayMilliseconds, delay.TotalMilliseconds);
Tui\TerminalViewerApp.cs (1)
280var timeout = Task.Delay(TimeSpan.FromSeconds(2), CancellationToken.None);
Utils\CliDownloader.cs (1)
197cts.CancelAfter(TimeSpan.FromSeconds(timeoutSeconds));
Utils\CliPathHelper.cs (4)
40internal static readonly TimeSpan s_staleSocketThreshold = TimeSpan.FromHours(24); 305/// <see cref="CleanupStaleCliSockets(string, TimeSpan, TimeProvider)"/>. 314internal static int CleanupStaleCliSockets(string socketDirectory, TimeSpan maxAge, TimeProvider? timeProvider = null)
Utils\ConsoleActivityLogger.cs (22)
48private TimeSpan? _summaryElapsedOverride; 280var totalDuration = _summaryElapsedOverride ?? _stopwatch.Elapsed; 323summaryParts.Add(string.Format(CultureInfo.CurrentCulture, ConsoleActivityLoggerStrings.SummaryTotalTime, DurationFormatter.FormatDuration(TimeSpan.FromSeconds(totalSeconds), CultureInfo.InvariantCulture, DecimalDurationDisplay.Fixed))); 437? recordList.Max(r => r.EndOffset > TimeSpan.Zero ? r.EndOffset : r.Duration) 438: TimeSpan.Zero; 446TimeSpan Duration, 451TimeSpan StartOffset = default, 452TimeSpan EndOffset = default); 464var totalTimeline = orderedRecords.Max(r => r.EndOffset > TimeSpan.Zero ? r.EndOffset : r.Duration); 629private static string BuildTimelineLabels(TimeSpan totalTimeline, int width) 641private static string BuildTimelineStartLabel(TimeSpan totalTimeline) 643var unit = totalTimeline > TimeSpan.Zero ? DurationFormatter.GetUnit(totalTimeline) : "ms"; 647private static string FormatSummaryDuration(TimeSpan duration, TimeSpan totalTimeline) 649return duration == TimeSpan.Zero 654private bool ShouldRenderTimeline(int durationWidth, int nameWidth, TimeSpan totalTimeline) 671private static string BuildTimelineBar(StepDurationRecord record, TimeSpan totalTimeline, int width) 679var start = record.StartOffset; 680var end = record.EndOffset > start ? record.EndOffset : start + record.Duration; 684if (totalTimeline <= TimeSpan.Zero) 732var text = seconds.HasValue ? $"{message} ({DurationFormatter.FormatDuration(TimeSpan.FromSeconds(seconds.Value), CultureInfo.InvariantCulture, DecimalDurationDisplay.Fixed)})" : message;
Utils\EnvironmentChecker\DcpConnectionChecker.cs (5)
30private static readonly TimeSpan s_connectionTimeout = TimeSpan.FromSeconds(20); 31private static readonly TimeSpan s_processExitTimeout = TimeSpan.FromSeconds(5); 396await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false);
Utils\EnvironmentChecker\DcpKubeconfig.cs (3)
13private static readonly TimeSpan s_readRetryDelay = TimeSpan.FromMilliseconds(100); 23internal static async Task<DcpKubeconfig> ReadFileWithRetryAsync(string path, Func<TimeSpan, CancellationToken, Task>? delayAsync = null, CancellationToken cancellationToken = default)
Utils\EnvironmentChecker\DeprecatedWorkloadCheck.cs (2)
21private static readonly TimeSpan s_processTimeout = TimeSpan.FromSeconds(10);
Utils\EnvironmentChecker\EnvironmentChecker.cs (11)
17internal static readonly TimeSpan s_defaultCheckTimeout = TimeSpan.FromSeconds(30); 18internal static readonly TimeSpan s_defaultTotalTimeout = TimeSpan.FromMinutes(2); 22private readonly TimeSpan _checkTimeout; 23private readonly TimeSpan _totalTimeout; 30internal EnvironmentChecker(IEnumerable<IEnvironmentCheck> checks, ILogger<EnvironmentChecker> logger, TimeSpan checkTimeout, TimeSpan totalTimeout) 32ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(checkTimeout, TimeSpan.Zero); 33ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(totalTimeout, TimeSpan.Zero); 123private static EnvironmentCheckResult CreateTimeoutResult(string name, string message, Type checkType, TimeSpan timeout)
Utils\ProcessCaptureRunner.cs (9)
17private static readonly TimeSpan s_postKillExitWaitBound = TimeSpan.FromSeconds(2); 18private static readonly TimeSpan s_postKillCaptureWaitBound = TimeSpan.FromMilliseconds(250); 19private static readonly TimeSpan s_postExitCaptureWaitBound = TimeSpan.FromSeconds(2); 23TimeSpan timeout, 185private static async Task SwallowExitWaitAsync(Process process, TimeSpan bound, ILogger logger) 220private static async Task<TCapture> SwallowCaptureAsync<TCapture>(Task<TCapture> task, Func<TCapture> createEmptyCapture, ILogger logger, TimeSpan? bound = null)
Utils\TransactionalAction.cs (3)
83TimeSpan.Zero); 116private static extern ref TimeSpan MaximumTimeoutField( 127MaximumTimeoutField(null) = TimeSpan.Zero;
aspire-managed (15)
src\Shared\ParentProcessLivenessMonitor.cs (2)
13private static readonly TimeSpan s_pollInterval = TimeSpan.FromSeconds(1);
src\Shared\ParentProcessWatchdog.cs (4)
21internal static TimeSpan ForceExitGracePeriod { get; } = TimeSpan.FromSeconds(5); 96TimeSpan forceExitGracePeriod, 125TimeSpan forceExitGracePeriod,
src\Shared\ProcessStartTimeHelper.cs (9)
26public static readonly TimeSpan LegacyStartTimeMatchTolerance = TimeSpan.FromSeconds(1); 37public static readonly TimeSpan StableStartTimeMatchTolerance = TimeSpan.FromMilliseconds(20); 144TimeSpan? tolerance = null, 160TimeSpan? tolerance, 233public static bool IsProcessRunningWithRuntimeStartTime(int pid, long expectedStartTimeUnixSeconds, TimeSpan? tolerance = null) 281public static bool AreClose(long expectedStartTimeUnixSeconds, long actualStartTimeUnixSeconds, TimeSpan? tolerance = null) 296public static bool AreCloseMilliseconds(long expectedStartTimeUnixMilliseconds, long actualStartTimeUnixMilliseconds, TimeSpan? tolerance = null)
Aspire.Acquisition.Tests (20)
Scripts\Common\RealGitHubPRFixture.cs (1)
188.WithTimeout(TimeSpan.FromMinutes(2))
Scripts\Common\ScriptFunctionCommand.cs (1)
50WithTimeout(TimeSpan.FromSeconds(60));
Scripts\Common\ScriptHostFixture.cs (1)
109await _serverTask.WaitAsync(TimeSpan.FromSeconds(5));
Scripts\Common\ScriptToolCommand.cs (1)
45WithTimeout(TimeSpan.FromSeconds(60));
Scripts\PipedInstallTests.cs (10)
42cmd.WithTimeout(TimeSpan.FromSeconds(60)); 65cmd.WithTimeout(TimeSpan.FromSeconds(60)); 83cmd.WithTimeout(TimeSpan.FromSeconds(60)); 103cmd.WithTimeout(TimeSpan.FromSeconds(60)); 133cmd.WithTimeout(TimeSpan.FromSeconds(60)); 155cmd.WithTimeout(TimeSpan.FromSeconds(60)); 180cmd.WithTimeout(TimeSpan.FromSeconds(60)); 204cmd.WithTimeout(TimeSpan.FromSeconds(60)); 223cmd.WithTimeout(TimeSpan.FromSeconds(30)); 244cmd.WithTimeout(TimeSpan.FromSeconds(60));
Scripts\VerifyCliArchivePowerShellTests.cs (3)
29cmd.WithTimeout(TimeSpan.FromSeconds(60)); 48cmd.WithTimeout(TimeSpan.FromSeconds(60)); 76cmd.WithTimeout(TimeSpan.FromSeconds(60));
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.Azure.AI.OpenAI.Tests (2)
AspireAzureAIOpenAIExtensionsTests.cs (2)
159var networkTimeout = TimeSpan.FromSeconds(123);
Aspire.Azure.Messaging.WebPubSub.Tests (1)
AspireWebPubSubExtensionsTests.cs (1)
295using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
Aspire.Azure.Search.Documents.Tests (1)
AspireAzureSearchExtensionsTests.cs (1)
135using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
Aspire.Cli.EndToEnd.Tests (816)
AgentCommandTests.cs (18)
34var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 46timeout: TimeSpan.FromSeconds(30), description: "agent help showing mcp and init subcommands"); 52await auto.WaitUntilTextAsync("aspire agent mcp [options]", timeout: TimeSpan.FromSeconds(30)); 58await auto.WaitUntilTextAsync("aspire agent init [options]", timeout: TimeSpan.FromSeconds(30)); 66timeout: TimeSpan.FromSeconds(30), description: "mcp help showing tools and call subcommands"); 72await auto.WaitUntilTextAsync("aspire mcp tools [options]", timeout: TimeSpan.FromSeconds(30)); 95var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 115await auto.WaitUntilTextAsync(".mcp.json", timeout: TimeSpan.FromSeconds(10)); 123await auto.WaitUntilTextAsync("configuration complete", timeout: TimeSpan.FromSeconds(30)); 149var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 162timeout: TimeSpan.FromSeconds(60), description: "doctor output with deprecated warning and fix suggestion"); 185var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 198await auto.WaitUntilTextAsync("workspace:", timeout: TimeSpan.FromSeconds(30)); 203timeout: TimeSpan.FromSeconds(60), description: "skill location prompt"); 207timeout: TimeSpan.FromSeconds(30), description: "skill selection prompt"); 211await auto.WaitUntilTextAsync("configuration complete", timeout: TimeSpan.FromSeconds(30)); 242var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 259await auto.WaitUntilTextAsync("configuration complete", timeout: TimeSpan.FromSeconds(60));
AgentMcpExcludeFromMcpTests.cs (2)
28var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 56await auto.WaitUntilTextAsync("is up (running).", timeout: TimeSpan.FromMinutes(6));
AgentMcpLogsTests.cs (2)
41var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 61await auto.WaitUntilTextAsync("is up (running).", timeout: TimeSpan.FromMinutes(6));
AppHostSyntaxErrorOutputTests.cs (9)
29timeout: TimeSpan.FromMinutes(2)); 43timeout: TimeSpan.FromMinutes(2)); 57timeout: TimeSpan.FromMinutes(2)); 71timeout: TimeSpan.FromMinutes(3)); 85timeout: TimeSpan.FromMinutes(3)); 95TimeSpan timeout, 111var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 139TimeSpan timeout) 142await auto.RunCommandAsync($"cd \"$ASPIRE_E2E_WORKSPACE\"/{quotedWorkingDirectory}", counter, TimeSpan.FromSeconds(10));
BannerTests.cs (6)
27var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 49timeout: TimeSpan.FromSeconds(30), description: "waiting for banner and telemetry notice on first run"); 63var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 76timeout: TimeSpan.FromSeconds(30), description: "waiting for banner with version info"); 90var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 119}, timeout: TimeSpan.FromSeconds(30), description: "waiting for help output to complete");
BundleSmokeTests.cs (4)
31var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 56var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 122var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 214var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
CentralPackageManagementTests.cs (13)
28var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 86await auto.WaitUntilTextAsync("Perform updates?", timeout: TimeSpan.FromSeconds(60)); 90await auto.WaitUntilTextAsync("Update successful!", timeout: TimeSpan.FromSeconds(60)); 105await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 143var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 196await auto.WaitUntilTextAsync("Perform updates?", timeout: TimeSpan.FromSeconds(60)); 198await auto.WaitUntilTextAsync("Update successful!", timeout: TimeSpan.FromSeconds(60)); 237await auto.WaitUntilTextAsync("Perform updates?", timeout: TimeSpan.FromSeconds(60)); 239await auto.WaitUntilTextAsync("Update successful!", timeout: TimeSpan.FromSeconds(60)); 240await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 255await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 271var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 345await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120));
CertificatesCommandTests.cs (9)
26var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 45await auto.WaitUntilTextAsync("trusted successfully", timeout: TimeSpan.FromSeconds(60)); 51await auto.WaitUntilTextAsync("certificate is trusted", timeout: TimeSpan.FromSeconds(60)); 65var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 83await auto.WaitUntilTextAsync("cleaned successfully", timeout: TimeSpan.FromSeconds(60)); 89await auto.WaitUntilTextAsync("No HTTPS development certificate", timeout: TimeSpan.FromSeconds(60)); 103var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 117await auto.WaitUntilTextAsync("trusted successfully", timeout: TimeSpan.FromSeconds(60)); 123await auto.WaitUntilTextAsync("certificate is trusted", timeout: TimeSpan.FromSeconds(60));
ChannelUpdateWorkflowTests.cs (9)
76var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 125await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 179await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 204await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromSeconds(30)); 247var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 290var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 330var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 345await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 446}, TimeSpan.FromMinutes(3), description: "waiting for stable update preview");
CliTelemetryTests.cs (3)
32var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 62await auto.AspireStartAsync(counter, startTimeout: TimeSpan.FromMinutes(4), additionalArgs: $"--capture-profile --capture-profile-output {profilePath}", skipDashboardCheck: true); 90await auto.WaitUntilTextAsync("PASS", timeout: TimeSpan.FromSeconds(5));
ConfigDiscoveryTests.cs (4)
43var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 148var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 191}, timeout: TimeSpan.FromMinutes(3), description: "aspire run started or errored"); 195await auto.WaitForAnyPromptAsync(counter, timeout: TimeSpan.FromSeconds(30));
ConfigHealingTests.cs (2)
37var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 71await auto.WaitUntilTextAsync("Press CTRL+C to stop the AppHost and exit.", timeout: TimeSpan.FromMinutes(3));
ConfigMigrationTests.cs (15)
118var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 157await auto.WaitUntilTextAsync("not found", timeout: TimeSpan.FromSeconds(10)); 180var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 225var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 256await auto.WaitUntilTextAsync("stable", timeout: TimeSpan.FromSeconds(10)); 281var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 327await auto.WaitUntilTextAsync("not found", timeout: TimeSpan.FromSeconds(10)); 351var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 387await auto.WaitUntilTextAsync("preview", timeout: TimeSpan.FromSeconds(10)); 393await auto.WaitUntilTextAsync("true", timeout: TimeSpan.FromSeconds(10)); 431var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 484await auto.WaitUntilTextAsync("not found", timeout: TimeSpan.FromSeconds(10)); 516var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 543await auto.WaitUntilTextAsync("staging", timeout: TimeSpan.FromSeconds(10)); 569await auto.WaitUntilTextAsync("staging", timeout: TimeSpan.FromSeconds(10));
CSharpInitTests.cs (3)
34var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 47timeout: TimeSpan.FromSeconds(30), 51await auto.WaitUntilTextAsync("Created aspire.config.json", timeout: TimeSpan.FromMinutes(2));
CSharpProjectModeInitTests.cs (3)
72var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 111TimeSpan.FromMinutes(3)); 148var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
DashboardRunTests.cs (5)
40var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 72await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 90await auto.WaitUntilTextAsync("No traces found", timeout: TimeSpan.FromSeconds(30)); 119var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 149await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60));
DescribeCommandTests.cs (13)
28var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 46await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 57await auto.WaitUntilTextAsync("Name", timeout: TimeSpan.FromSeconds(30)); 58await auto.WaitUntilTextAsync("webfrontend", timeout: TimeSpan.FromSeconds(5)); 59await auto.WaitUntilTextAsync("apiservice", timeout: TimeSpan.FromSeconds(5)); 70await auto.WaitUntilTextAsync("webfrontend", timeout: TimeSpan.FromSeconds(10)); 76await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 95var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 143await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 160await auto.WaitUntilTextAsync("cache", timeout: TimeSpan.FromSeconds(10)); 176await auto.WaitUntilAsync(s => waitForApiserviceReplicaName.Search(s).Count > 0, timeout: TimeSpan.FromSeconds(10), description: "waiting for apiservice replica name"); 188await auto.WaitUntilAsync(s => waitForApiserviceReplicaName.Search(s).Count > 0, timeout: TimeSpan.FromSeconds(10), description: "waiting for apiservice replica in describe output"); 194await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1));
DockerDeploymentTests.cs (8)
31var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 52await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 98await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 114await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 131var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 152await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 199await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 215await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30));
DocsCommandE2ETests.cs (2)
47var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 90}, timeout: TimeSpan.FromSeconds(60), description: "waiting for docs get rendered output");
DoctorCommandTests.cs (10)
38var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 58timeout: TimeSpan.FromSeconds(60), description: "doctor to complete with partial trust warning"); 72var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 101}, timeout: TimeSpan.FromSeconds(60), description: "doctor to complete with trusted certificate"); 120var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 130await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 171var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 181await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 190TimeSpan.FromMinutes(2)); 208timeout: TimeSpan.FromSeconds(60),
DotnetToolSmokeTests.cs (5)
40var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 52await auto.WaitUntilTextAsync("aspire.cli", timeout: TimeSpan.FromSeconds(10)); 58await auto.WaitUntilTextAsync(".dotnet/tools/aspire", timeout: TimeSpan.FromSeconds(10)); 64await auto.WaitUntilTextAsync("dotnet tool update -g Aspire.Cli", timeout: TimeSpan.FromSeconds(10)); 75await auto.WaitUntilTextAsync(strategy.Version, timeout: TimeSpan.FromSeconds(10));
EmptyAppHostTemplateTests.cs (3)
27var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 55var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 96TimeSpan.FromMinutes(2));
EmulatedLocalReleaseBuildTests.cs (7)
75var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 143var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 242timeout: TimeSpan.FromSeconds(60), 262TimeSpan.FromSeconds(30)); 274await auto.WaitUntilTextAsync(AddCommandStrings.SelectAnIntegrationToAdd, timeout: TimeSpan.FromMinutes(1)); 283}, timeout: TimeSpan.FromMinutes(2), description: "version prompt or add success"); 290await auto.WaitUntilTextAsync("was added successfully.", timeout: TimeSpan.FromMinutes(2));
EmulatedReleasedBuildTests.cs (6)
60var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 118var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 173timeout: TimeSpan.FromSeconds(60), 187await auto.WaitUntilTextAsync(AddCommandStrings.SelectAnIntegrationToAdd, timeout: TimeSpan.FromMinutes(1)); 196}, timeout: TimeSpan.FromMinutes(2), description: "version prompt or add success"); 203await auto.WaitUntilTextAsync("was added successfully.", timeout: TimeSpan.FromMinutes(2));
EmulatedStagingBuildTests.cs (6)
70var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 131var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 205timeout: TimeSpan.FromSeconds(60), 219await auto.WaitUntilTextAsync(AddCommandStrings.SelectAnIntegrationToAdd, timeout: TimeSpan.FromMinutes(1)); 228}, timeout: TimeSpan.FromMinutes(2), description: "version prompt or add success"); 235await auto.WaitUntilTextAsync("was added successfully.", timeout: TimeSpan.FromMinutes(2));
EntityFrameworkCoreDeploymentTests.cs (11)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 62await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(10)); 63await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(1)); 80await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromMinutes(2)); 104await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromMinutes(3)); 111await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 122await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 148await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 288await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 303await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 320await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3));
Helpers\CliE2EAutomatorHelpers.cs (42)
40internal static TimeSpan AspireRunReadyTimeout => TimeSpan.FromSeconds(AspireRunStartupBudgetSeconds + 60); 64await auto.WaitUntilTextAsync("# ", timeout: TimeSpan.FromSeconds(60)); 109internal static Task WaitUntilAppHostStoppedSuccessfullyAsync(this Hex1bTerminalAutomator auto, TimeSpan timeout) 139TimeSpan.FromSeconds(300)); 147TimeSpan.FromSeconds(120)); 155TimeSpan.FromSeconds(120)); 164TimeSpan.FromSeconds(120)); 200TimeSpan? timeout = null) 202var effectiveTimeout = timeout ?? TimeSpan.FromMinutes(2); 230TimeSpan? timeout = null) 232var effectiveTimeout = timeout ?? TimeSpan.FromMinutes(2); 276TimeSpan effectiveTimeout) 356timeout: TimeSpan.FromSeconds(5), 372TimeSpan? timeout = null) 374var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(180); 437TimeSpan.FromSeconds(120)); 446TimeSpan.FromSeconds(120)); 491await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 516timeout: TimeSpan.FromSeconds(30), 571await auto.PrepareBashEnvironmentAsync(workspace.WorkspaceRoot.FullName, counter, TimeSpan.FromSeconds(10)); 598await auto.RunCommandAsync(command, counter, TimeSpan.FromSeconds(300)); 635timeout: TimeSpan.FromSeconds(10), 686TimeSpan.FromSeconds(30)); 735await auto.RunCommandAsync(command, counter, TimeSpan.FromSeconds(300)); 757TimeSpan? startTimeout = null, 763var effectiveTimeout = startTimeout ?? TimeSpan.FromMinutes(3); 869}, timeout: TimeSpan.FromSeconds(30), description: $"dashboard url validation [{dashboardUrlCounter} OK/ERR]"); 906}, timeout: TimeSpan.FromSeconds(30), description: $"dashboard URL check [{counter.Value} OK]"); 927await auto.WaitUntilTextAsync("dashboard-http-200", timeout: TimeSpan.FromSeconds(30)); 986}, timeout: TimeSpan.FromSeconds(30), description: $"aspire describe {resource}"); 1034TimeSpan? timeout = null) 1036timeout ??= TimeSpan.FromMinutes(2); 1040await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(1)); 1128await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 1141await auto.WaitUntilTextAsync("MCP_DATA_PRESENT", timeout: TimeSpan.FromSeconds(10)); 1151await auto.WaitUntilTextAsync("MCP_EXCLUDED_MARKER_ABSENT", timeout: TimeSpan.FromSeconds(10)); 1159await auto.WaitUntilTextAsync("MCP_INIT_OK", timeout: TimeSpan.FromSeconds(10));
Helpers\CliE2ETestHelpers.cs (1)
620private static readonly HttpClient s_nuGetHttpClient = new() { Timeout = TimeSpan.FromSeconds(30) };
Helpers\KubernetesDeployTestHelpers.cs (31)
40await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(90)); 45await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(90)); 50await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(90)); 74await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 79await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 84await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 96await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 106await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 163await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 205await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(10)); 209await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 213await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 217await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 242timeout: TimeSpan.FromSeconds(60), 248timeout: TimeSpan.FromSeconds(10), 255timeout: TimeSpan.FromSeconds(10), 261timeout: TimeSpan.FromSeconds(10), 267timeout: TimeSpan.FromSeconds(10), 273timeout: TimeSpan.FromSeconds(10), 301timeout: TimeSpan.FromMinutes(5), 324await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 332await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(180)); 372await auto.WaitUntilTextAsync(promptText, timeout: TimeSpan.FromMinutes(5)); 378await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(10)); 379await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 397await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(4)); 407await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromSeconds(30)); 412await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromSeconds(30)); 434await auto.WaitUntilTextAsync("VERIFY_OK", timeout: TimeSpan.FromMinutes(4)); 435await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 453await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60));
IsolatedInstancesOtelLogsTests.cs (7)
27var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 56await auto.WaitUntilTextAsync("is up (running).", timeout: TimeSpan.FromMinutes(6)); 62await auto.WaitUntilTextAsync("is up (running).", timeout: TimeSpan.FromMinutes(6)); 78await auto.WaitUntilTextAsync("INSTANCE1_HAS_LOGS", timeout: TimeSpan.FromSeconds(10)); 83await auto.WaitUntilTextAsync("INSTANCE2_HAS_LOGS", timeout: TimeSpan.FromSeconds(10)); 94await auto.WaitUntilTextAsync("CONTENTROOT1_OK", timeout: TimeSpan.FromSeconds(10)); 99await auto.WaitUntilTextAsync("CONTENTROOT2_OK", timeout: TimeSpan.FromSeconds(10));
JavaCodegenValidationTests.cs (8)
25var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 34await auto.WaitUntilTextAsync("Which language would you like to use?", timeout: TimeSpan.FromSeconds(30)); 37await auto.WaitUntilTextAsync("> Java", timeout: TimeSpan.FromSeconds(5)); 39await auto.WaitUntilTextAsync("Created AppHost.java", timeout: TimeSpan.FromMinutes(2)); 44await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 49await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 74await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 79await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3));
JavaEmptyAppHostTemplateTests.cs (1)
27var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
JavaPolyglotApphostDirectoryTests.cs (9)
35var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 52await auto.WaitUntilTextAsync("Which language would you like to use?", timeout: TimeSpan.FromSeconds(30)); 55await auto.WaitUntilTextAsync("> Java", timeout: TimeSpan.FromSeconds(5)); 57await auto.WaitUntilTextAsync("Created AppHost.java", timeout: TimeSpan.FromMinutes(2)); 62await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 66await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 70await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 92await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 107await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1));
JavaPolyglotTests.cs (8)
25var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 34await auto.WaitUntilTextAsync("Which language would you like to use?", timeout: TimeSpan.FromSeconds(30)); 37await auto.WaitUntilTextAsync("> Java", timeout: TimeSpan.FromSeconds(5)); 39await auto.WaitUntilTextAsync("Created AppHost.java", timeout: TimeSpan.FromMinutes(2)); 44await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 48await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 52await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 72await auto.WaitUntilTextAsync("Press CTRL+C to stop the AppHost and exit.", timeout: TimeSpan.FromMinutes(3));
JavaScriptPublishTests.cs (14)
34var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 43await auto.WaitUntilTextAsync("Which language would you like to use?", timeout: TimeSpan.FromSeconds(30)); 45await auto.WaitUntilTextAsync("> TypeScript (Node.js)", timeout: TimeSpan.FromSeconds(5)); 47await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 57await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 61await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 74await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(5)); 80await auto.WaitUntilTextAsync("ALL_OK", timeout: TimeSpan.FromSeconds(90)); 86await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 102var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 110await auto.RunCommandAsync("aspire init --language typescript --non-interactive", counter, TimeSpan.FromMinutes(2)); 119await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromMinutes(2)); 128await auto.RunCommandAsync("bash verify-runtime.sh", counter, TimeSpan.FromMinutes(2)); 134await auto.RunCommandAsync("if [ -f aspire-run.pid ]; then kill \"$(cat aspire-run.pid)\" 2>/dev/null || true; wait \"$(cat aspire-run.pid)\" 2>/dev/null || true; fi", counter, TimeSpan.FromMinutes(1));
JsReactTemplateTests.cs (2)
27var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 49}, timeout: TimeSpan.FromMinutes(2), description: "Press CTRL+C message (aspire run started)");
KubernetesDeployBasicApiServiceTests.cs (1)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
KubernetesDeployTypeScriptTests.cs (4)
34var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 64await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromMinutes(2)); 69await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 130await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromSeconds(30));
KubernetesDeployTypeScriptWithPersistentVolumeTests.cs (14)
45var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 75await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromMinutes(2)); 83await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 207await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 212await auto.WaitUntilTextAsync("PVC_BOUND_OK", timeout: TimeSpan.FromMinutes(2)); 213await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 217await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 221await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 245await auto.WaitUntilTextAsync("WROTE_OK_wrote-42", timeout: TimeSpan.FromMinutes(2)); 246await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 259await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 263await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(4)); 274await auto.WaitUntilTextAsync("READ_OK_wrote-42", timeout: TimeSpan.FromMinutes(2)); 275await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30));
KubernetesDeployWithGarnetTests.cs (1)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
KubernetesDeployWithHelmChartTests.cs (5)
35var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 141await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 150await auto.WaitUntilTextAsync("VERIFY_OK", timeout: TimeSpan.FromSeconds(60)); 151await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 156await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30));
KubernetesDeployWithMongoDBTests.cs (1)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
KubernetesDeployWithMySqlTests.cs (1)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
KubernetesDeployWithNatsTests.cs (1)
35var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
KubernetesDeployWithPersistentVolumeTests.cs (12)
39var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 174await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 179await auto.WaitUntilTextAsync("PVC_BOUND_OK", timeout: TimeSpan.FromMinutes(2)); 180await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 185await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 189await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 211await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 215await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(4)); 244await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 249await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 274await auto.WaitUntilTextAsync("DURAB_OK_PASS", timeout: TimeSpan.FromMinutes(4)); 275await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30));
KubernetesDeployWithPostgresTests.cs (1)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
KubernetesDeployWithProjectPersistentVolumeTests.cs (12)
40var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 151await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 156await auto.WaitUntilTextAsync("PVC_BOUND_OK", timeout: TimeSpan.FromMinutes(2)); 157await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 161await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 165await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 184await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 188await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(4)); 214await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 218await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 234await auto.WaitUntilTextAsync("VERIFY_OK", timeout: TimeSpan.FromMinutes(4)); 235await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30));
KubernetesDeployWithRabbitMQTests.cs (1)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
KubernetesDeployWithRedisTests.cs (1)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
KubernetesDeployWithSqlServerTests.cs (1)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
KubernetesDeployWithValkeyTests.cs (1)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
KubernetesPublishRequiresExternalEndpointTests.cs (6)
60var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 83await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 121TimeSpan.FromMinutes(5), 128await auto.WaitUntilTextAsync("WithExternalHttpEndpoints", timeout: TimeSpan.FromSeconds(30)); 129await auto.WaitUntilTextAsync("'api'", timeout: TimeSpan.FromSeconds(30)); 130await auto.WaitUntilTextAsync("'public'", timeout: TimeSpan.FromSeconds(30));
KubernetesPublishTests.cs (17)
45var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 66await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 75await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 98await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 102await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 129await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 173await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 204await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 216await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 220await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 234await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 253await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(4)); 268await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 290await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 325var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 338await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 391TimeSpan.FromMinutes(5));
LaunchProfileTests.cs (1)
32var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
ListStepsTests.cs (5)
26var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 45timeout: TimeSpan.FromMinutes(3), 54timeout: TimeSpan.FromMinutes(3), 63timeout: TimeSpan.FromMinutes(3), 72timeout: TimeSpan.FromMinutes(3),
LocalConfigMigrationTests.cs (10)
50var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 60await auto.WaitUntilTextAsync("Which language would you like to use?", timeout: TimeSpan.FromSeconds(30)); 62await auto.WaitUntilTextAsync("> TypeScript (Node.js)", timeout: TimeSpan.FromSeconds(5)); 64await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 93await Task.Delay(TimeSpan.FromSeconds(1), TestContext.Current.CancellationToken); 98await auto.WaitForAnyPromptAsync(counter, timeout: TimeSpan.FromSeconds(30)); 123var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 140await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromMinutes(3)); 153await Task.Delay(TimeSpan.FromSeconds(1), TestContext.Current.CancellationToken); 162await auto.WaitForAnyPromptAsync(counter, timeout: TimeSpan.FromMinutes(1));
LogLevelTests.cs (4)
28var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 46await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromMinutes(3)); 64TimeSpan.FromSeconds(10)); 70TimeSpan.FromSeconds(10));
LogsCommandTests.cs (5)
27var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 45await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 66await auto.WaitUntilTextAsync("[apiservice]", timeout: TimeSpan.FromSeconds(10)); 77await auto.WaitUntilTextAsync("\"resourceName\":", timeout: TimeSpan.FromSeconds(10)); 83await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1));
MultipleAppHostTests.cs (4)
26var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 61await auto.WaitUntilTextAsync("JSON_VALID", timeout: TimeSpan.FromSeconds(30)); 83var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 114await auto.WaitUntilTextAsync("JSON_VALID", timeout: TimeSpan.FromSeconds(30));
NewChannelNuGetConfigTests.cs (1)
54var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
NewWithAgentInitTests.cs (10)
40var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 64timeout: TimeSpan.FromSeconds(60), 71timeout: TimeSpan.FromSeconds(10), 79timeout: TimeSpan.FromSeconds(10), 86timeout: TimeSpan.FromSeconds(10), 93timeout: TimeSpan.FromSeconds(10), 100timeout: TimeSpan.FromSeconds(10), 107timeout: TimeSpan.FromSeconds(120), 125}, timeout: TimeSpan.FromMinutes(5), description: "agent init configuration complete (no provenance errors)"); 136await auto.WaitUntilTextAsync("SKILL.md", timeout: TimeSpan.FromSeconds(10));
OllamaIntegrationTests.cs (4)
31var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 46await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromMinutes(2)); 81await auto.AspireStartAsync(counter, startTimeout: TimeSpan.FromMinutes(5)); 90await auto.WaitUntilTextAsync("is up (running).", timeout: TimeSpan.FromMinutes(6));
OtelLogsTests.cs (4)
36var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 56await auto.WaitUntilTextAsync("is up (running).", timeout: TimeSpan.FromMinutes(6)); 72await auto.WaitUntilTextAsync("STRUCTURED_LOGS_PRESENT", timeout: TimeSpan.FromSeconds(10)); 83await auto.WaitUntilTextAsync("JSON_STRUCTURED_LOGS_PRESENT", timeout: TimeSpan.FromSeconds(10));
PersistentContainerEndToEndTests.cs (6)
28var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 141await auto.AspireStartAsync(counter, TimeSpan.FromMinutes(5)); 145await auto.AspireStartAsync(counter, TimeSpan.FromMinutes(5)); 161await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 165await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 169await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2));
PlaywrightCliInstallTests.cs (7)
35var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 61await auto.WaitUntilTextAsync("configuration complete", timeout: TimeSpan.FromMinutes(3)); 72await auto.WaitUntilTextAsync("SKILL.md", timeout: TimeSpan.FromSeconds(10)); 94var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 116await auto.WaitUntilTextAsync("configuration complete", timeout: TimeSpan.FromMinutes(3)); 122await auto.WaitUntilTextAsync("SKILL.md", timeout: TimeSpan.FromSeconds(10)); 128await auto.WaitUntilTextAsync("NO_STRAY_FILES", timeout: TimeSpan.FromSeconds(10));
PodmanDeploymentTests.cs (5)
30var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 41await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 60await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 99await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 109await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30));
ProjectReferenceTests.cs (8)
30var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 40await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 153}, timeout: TimeSpan.FromMinutes(2), description: "waiting for apphost start success or failure"); 159await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 164await auto.WaitUntilTextAsync("addMyService", timeout: TimeSpan.FromSeconds(5)); 170await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(90)); 175await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(15)); 178await auto.WaitUntilTextAsync("my-svc", timeout: TimeSpan.FromSeconds(5));
PsCommandTests.cs (8)
27var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 45await auto.WaitUntilTextAsync(SharedCommandStrings.AppHostNotRunning, timeout: TimeSpan.FromSeconds(30)); 51await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 57await auto.WaitUntilTextAsync("AspirePsTestApp.AppHost", timeout: TimeSpan.FromSeconds(30)); 63await auto.WaitUntilTextAsync("\"appHostPath\":", timeout: TimeSpan.FromSeconds(30)); 69await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 75await auto.WaitUntilTextAsync(SharedCommandStrings.AppHostNotRunning, timeout: TimeSpan.FromSeconds(30)); 89var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
PythonReactTemplateTests.cs (2)
26var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 47await auto.RunCommandAsync("npm run build", counter, TimeSpan.FromMinutes(2));
RadiusDeployTests.cs (8)
74var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 106await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 142await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 156await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 170await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(15)); 181await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(4)); 216await auto.WaitUntilTextAsync("VERIFY_OK", timeout: TimeSpan.FromMinutes(3)); 217await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30));
RadiusPublishTests.cs (3)
41var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 68await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 106await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5));
ResourceCommandTests.cs (35)
30var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 58await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 63await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 67await auto.WaitUntilTextAsync("ValueMissing", timeout: TimeSpan.FromSeconds(10)); 72await auto.WaitUntilTextAsync("Resource 'greeting' set successfully.", timeout: TimeSpan.FromSeconds(30)); 73await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 77await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 81await auto.WaitUntilTextAsync("Running", timeout: TimeSpan.FromSeconds(10)); 86await auto.WaitUntilTextAsync("Hello world", timeout: TimeSpan.FromSeconds(10)); 91await auto.WaitUntilTextAsync("Resource 'greeting' deleted successfully.", timeout: TimeSpan.FromSeconds(30)); 92await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 96await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 100await auto.WaitUntilTextAsync("ValueMissing", timeout: TimeSpan.FromSeconds(10)); 105await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 123var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 188await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 193await auto.WaitUntilTextAsync("Failed to execute command 'needs-interaction' on resource 'test-resource'", timeout: TimeSpan.FromSeconds(30)); 194await auto.WaitUntilTextAsync("InteractionService is not available", timeout: TimeSpan.FromSeconds(30)); 195await auto.WaitUntilTextAsync("See logs at", timeout: TimeSpan.FromSeconds(30)); 196await auto.WaitUntilTextAsync("See AppHost logs at", timeout: TimeSpan.FromSeconds(30)); 197await auto.WaitForAnyPromptAsync(counter, timeout: TimeSpan.FromSeconds(30)); 201await auto.WaitUntilTextAsync("RESOURCE_CMD_EXIT_CODE_CORRECT", timeout: TimeSpan.FromSeconds(10)); 206await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 223var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 270await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 277await auto.WaitForAnyPromptAsync(counter, timeout: TimeSpan.FromSeconds(30)); 281await auto.WaitUntilTextAsync("RESOURCE_CMD_EXIT_CODE_CORRECT", timeout: TimeSpan.FromSeconds(10)); 302TimeSpan.FromSeconds(10)); 309TimeSpan.FromSeconds(10)); 314await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 331var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 370await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 376await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 386await auto.WaitUntilTextAsync("healthy", timeout: TimeSpan.FromSeconds(10)); 396await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1));
SdkExportTests.cs (2)
56var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 67await auto.RunCommandAsync("bash run-sdk-export.sh", counter, TimeSpan.FromMinutes(5));
SecretDotNetAppHostTests.cs (7)
24var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 42await auto.WaitUntilTextAsync("set successfully", timeout: TimeSpan.FromSeconds(60)); 47await auto.WaitUntilTextAsync("set successfully", timeout: TimeSpan.FromSeconds(30)); 53await auto.WaitUntilTextAsync("eastus2", timeout: TimeSpan.FromSeconds(30)); 59await auto.WaitUntilTextAsync("db-password", timeout: TimeSpan.FromSeconds(30)); 65await auto.WaitUntilTextAsync("deleted successfully", timeout: TimeSpan.FromSeconds(30)); 71await auto.WaitUntilTextAsync("db-password", timeout: TimeSpan.FromSeconds(30));
SecretTypeScriptAppHostTests.cs (10)
24var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 34await auto.WaitUntilTextAsync("> C#", timeout: TimeSpan.FromSeconds(30)); 36await auto.WaitUntilTextAsync("> TypeScript (Node.js)", timeout: TimeSpan.FromSeconds(5)); 38await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 44await auto.WaitUntilTextAsync("set successfully", timeout: TimeSpan.FromSeconds(30)); 49await auto.WaitUntilTextAsync("set successfully", timeout: TimeSpan.FromSeconds(30)); 55await auto.WaitUntilTextAsync("test-key-123", timeout: TimeSpan.FromSeconds(30)); 61await auto.WaitUntilTextAsync("ConnectionStrings:Db", timeout: TimeSpan.FromSeconds(30)); 67await auto.WaitUntilTextAsync("deleted successfully", timeout: TimeSpan.FromSeconds(30)); 73await auto.WaitUntilTextAsync("ConnectionStrings:Db", timeout: TimeSpan.FromSeconds(30));
SelfUpdateChannelPersistenceTests.cs (4)
30var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 45timeout: TimeSpan.FromMinutes(5)); 74timeout: TimeSpan.FromMinutes(10)); 84timeout: TimeSpan.FromMinutes(10));
SingleFileAppHostInitDotnetRunTests.cs (5)
43var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 56timeout: TimeSpan.FromSeconds(30), 60await auto.WaitUntilTextAsync("Created aspire.config.json", timeout: TimeSpan.FromMinutes(2)); 100timeout: TimeSpan.FromMinutes(1)); 104await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromMinutes(1));
SmokeTests.cs (4)
31var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 79var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 121var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 157var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500));
StagingChannelTests.cs (6)
26var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 56await auto.WaitUntilTextAsync("stagingPinToCliVersion", timeout: TimeSpan.FromSeconds(10)); 63await auto.WaitUntilTextAsync("staging", timeout: TimeSpan.FromSeconds(10)); 81await auto.WaitUntilTextAsync("stable", timeout: TimeSpan.FromSeconds(10)); 93await auto.WaitUntilTextAsync("staging", timeout: TimeSpan.FromSeconds(10)); 100await auto.WaitUntilTextAsync("Prerelease", timeout: TimeSpan.FromSeconds(10));
StartStopTests.cs (27)
35var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 60await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 66await auto.ExecuteCommandUntilOutputAsync(counter, $"docker network ls --format json | grep -i -- '{projectName}' | wc -l", "0", timeout: TimeSpan.FromMinutes(5)); 80var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 121var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 154TimeSpan.FromMinutes(1)); 174TimeSpan.FromMinutes(1)); 186TimeSpan.FromMinutes(1)); 236var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 287await auto.RunCommandAsync("aspire start --format json > /tmp/aspire-start.json", counter, TimeSpan.FromMinutes(2)); 299timeout: TimeSpan.FromSeconds(30), 301await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromSeconds(30)); 305await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 320var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 347await auto.WaitUntilTextAsync("was added successfully.", timeout: TimeSpan.FromMinutes(3)); 355await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromMinutes(1)); 369var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 396await auto.WaitUntilTextAsync(AddCommandStrings.SelectAnIntegrationToAdd, timeout: TimeSpan.FromMinutes(1)); 404}, timeout: TimeSpan.FromSeconds(30), description: "version prompt or add success"); 411await auto.WaitUntilTextAsync("was added successfully.", timeout: TimeSpan.FromMinutes(2)); 419await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromMinutes(1)); 438TimeSpan.FromMinutes(3)); 447TimeSpan.FromMinutes(3)); 458timeout: TimeSpan.FromSeconds(30), 459retryInterval: TimeSpan.FromSeconds(1)); 474timeout: TimeSpan.FromMinutes(5), 475retryInterval: TimeSpan.FromSeconds(8));
StopForceTests.cs (6)
35var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 65await auto.AspireStartAsync(counter, TimeSpan.FromMinutes(5), skipDashboardCheck: true); 69await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 73await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 74await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 78await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2));
StopNonInteractiveTests.cs (23)
30var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 47await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 62await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 71await auto.WaitUntilTextAsync(SharedCommandStrings.AppHostNotRunning, timeout: TimeSpan.FromSeconds(30)); 72await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromSeconds(30)); 85var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 103await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 112await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 121await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 130await auto.WaitUntilTextAsync(SharedCommandStrings.AppHostNotRunning, timeout: TimeSpan.FromSeconds(30)); 131await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromSeconds(30)); 145var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 163await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 172await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 186await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1)); 195await auto.WaitUntilTextAsync(SharedCommandStrings.AppHostNotRunning, timeout: TimeSpan.FromSeconds(30)); 196await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromSeconds(30)); 210var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 228await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 237await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 253timeout: TimeSpan.FromSeconds(30)); 254await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromSeconds(30)); 262await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1));
TerminalCommandTests.cs (5)
26var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 60TimeSpan.FromMinutes(3)); 66await auto.WaitUntilTextAsync("Ctrl+B D", timeout: TimeSpan.FromSeconds(30)); 73timeout: TimeSpan.FromSeconds(30), 80await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromSeconds(30));
tests\Shared\Hex1bAutomatorTestHelpers.cs (47)
24TimeSpan? timeout = null) 26var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 53TimeSpan? timeout = null, 54TimeSpan? retryInterval = null) 61var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(30); 62var effectiveRetryInterval = retryInterval ?? TimeSpan.FromSeconds(5); 76var remaining = effectiveTimeout - stopwatch.Elapsed; 77if (remaining <= TimeSpan.Zero) 82var waitThisAttempt = remaining < effectiveRetryInterval ? remaining : effectiveRetryInterval; 118var promptGrace = TimeSpan.FromSeconds(1); 140if (remaining <= TimeSpan.Zero) 145var delayBeforeRetry = remaining < effectiveRetryInterval ? remaining : effectiveRetryInterval; 146if (delayBeforeRetry > TimeSpan.FromMilliseconds(1)) 225TimeSpan? timeout = null) 227var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 270TimeSpan? timeout = null) 284TimeSpan? timeout = null) 286var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(30); 317TimeSpan.FromSeconds(30)); 344TimeSpan.FromSeconds(30)); 357TimeSpan.FromSeconds(30)); 366TimeSpan? timeout = null) 368var effectiveTimeout = timeout ?? TimeSpan.FromMinutes(2); 417TimeSpan? timeout = null) 419var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 484var templateTimeout = TimeSpan.FromSeconds(60); 505timeout: TimeSpan.FromSeconds(5), 515timeout: TimeSpan.FromSeconds(5), 526timeout: TimeSpan.FromSeconds(5), 538timeout: TimeSpan.FromSeconds(5), 552timeout: TimeSpan.FromSeconds(10), 563timeout: TimeSpan.FromSeconds(10), 613timeout: TimeSpan.FromSeconds(10), 631timeout: TimeSpan.FromSeconds(10), 700}, timeout: TimeSpan.FromMinutes(2), description: "NuGet.config prompt, URLs prompt, agent init prompt, or init completion"); 728TimeSpan? timeout = null) 730var effectiveTimeout = timeout ?? TimeSpan.FromMinutes(5);
tests\Shared\Hex1bTestHelpers.cs (33)
158TimeSpan? timeout = null) 160var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 181TimeSpan? timeout = null) 183var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 212TimeSpan? timeout = null) 214var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 239}, TimeSpan.FromSeconds(1)); 257}, TimeSpan.FromSeconds(1)); 273TimeSpan? timeout = null) 279.WaitUntil(s => agentInitPrompt.Search(s).Count > 0, timeout ?? TimeSpan.FromSeconds(120)) 298TimeSpan? timeout = null) 300var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 340}, TimeSpan.FromSeconds(1)); 364var templateTimeout = TimeSpan.FromSeconds(60); 399.WaitUntil(s => jsReactSelected.Search(s).Count > 0, TimeSpan.FromSeconds(5)) 408.WaitUntil(s => expressReactSelected.Search(s).Count > 0, TimeSpan.FromSeconds(5)) 418.WaitUntil(s => pythonReactSelected.Search(s).Count > 0, TimeSpan.FromSeconds(5)) 425.WaitUntil(s => waitingForAppHostLanguagePrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 432.WaitUntil(s => waitingForAppHostLanguagePrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 440.WaitUntil(s => waitingForAppHostLanguagePrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 447builder.WaitUntil(s => waitingForProjectNamePrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 452builder.WaitUntil(s => waitingForOutputPathPrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 456builder.WaitUntil(s => waitingForUrlsPrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 464builder.WaitUntil(s => waitingForRedisPrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)); 481builder.WaitUntil(s => waitingForTestPrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 510|| waitingForInitComplete.Search(s).Count > 0, TimeSpan.FromMinutes(2)) 512.WaitUntil(s => waitingForInitComplete.Search(s).Count > 0, TimeSpan.FromMinutes(2)) 514.WaitForSuccessPrompt(counter, TimeSpan.FromMinutes(2));
TypeScriptBlazorGatewayTests.cs (5)
47var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 61TimeSpan.FromMinutes(2)); 70await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromMinutes(2)); 75TimeSpan.FromMinutes(2)); 135TimeSpan.FromMinutes(10));
TypeScriptCodegenValidationTests.cs (23)
38var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 50await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 67await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 71await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 76await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 90await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 146var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 156await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 161await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 193await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 199await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 249await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 273var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 281await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 286await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 321await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 328await auto.WaitUntilTextAsync("hello-from-typescript-e2e", timeout: TimeSpan.FromSeconds(30)); 329await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 350var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 358await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 363await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 368await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 402await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2));
TypeScriptEmptyAppHostTemplateTests.cs (6)
29var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 65await auto.RunCommandAsync("npm run build", counter, TimeSpan.FromMinutes(2)); 84var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 96await auto.RunCommandAsync("aspire restore --non-interactive", counter, TimeSpan.FromMinutes(3)); 97await auto.RunCommandAsync("npm run build", counter, TimeSpan.FromMinutes(2)); 99await auto.AspireStartAsync(counter, startTimeout: TimeSpan.FromMinutes(2));
TypeScriptLegacyAppHostTests.cs (5)
43var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 55await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 65await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 74await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 84await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2));
TypeScriptMigrateAppHostTests.cs (6)
44var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 55await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 64await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 71await auto.WaitUntilTextAsync("Migrated 'apphost.ts' to 'apphost.mts'", timeout: TimeSpan.FromMinutes(3)); 72await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 80await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2));
TypeScriptPolyglotApphostDirectoryTests.cs (7)
41var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 56await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 68await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 72await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 76await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 98await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 111await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1));
TypeScriptPolyglotTests.cs (23)
46var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 58await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 78await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 86await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 93await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 116await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 135await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 150}, timeout: TimeSpan.FromMinutes(3), description: "Press CTRL+C message (aspire run started)"); 173var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 181await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 193await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 200await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 204await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 222await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 241await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 259var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 267await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 279await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 292timeout: TimeSpan.FromMinutes(2), 322var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 349await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 375await auto.WaitUntilTextAsync("Created aspire-apphost/apphost.mts", timeout: TimeSpan.FromMinutes(2)); 462}, timeout: TimeSpan.FromMinutes(3), description: "Press CTRL+C message (aspire run started)");
TypeScriptPublishTests.cs (26)
29var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 40await auto.WaitUntilTextAsync("Which language would you like to use?", timeout: TimeSpan.FromSeconds(30)); 42await auto.WaitUntilTextAsync("> TypeScript (Node.js)", timeout: TimeSpan.FromSeconds(5)); 44await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 49await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 54await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 59await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 88await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromMinutes(5)); 111var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 120await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 130await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 134await auto.WaitForAspireAddSuccessAsync(counter, TimeSpan.FromMinutes(2)); 145await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromMinutes(5)); 205var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 216await auto.WaitUntilTextAsync("Which language would you like to use?", timeout: TimeSpan.FromSeconds(30)); 218await auto.WaitUntilTextAsync("> TypeScript (Node.js)", timeout: TimeSpan.FromSeconds(5)); 220await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 225await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 230await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 235await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 264await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromMinutes(5)); 289var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 300await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 305await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 310await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 342await auto.WaitForSuccessPromptAsync(counter, timeout: TimeSpan.FromMinutes(5));
TypeScriptReusablePackageTests.cs (6)
25var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 49await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 66await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 75await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 83await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 88await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2));
TypeScriptSqlServerNativeAssetsBundleTests.cs (5)
33var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 41await auto.WaitUntilTextAsync("Created apphost.mts", timeout: TimeSpan.FromMinutes(2)); 46await auto.WaitUntilTextAsync("The package Aspire.Hosting.", timeout: TimeSpan.FromMinutes(2)); 51await auto.WaitUntilTextAsync("SDK code restored successfully", timeout: TimeSpan.FromMinutes(3)); 67await auto.AspireStartAsync(counter, TimeSpan.FromMinutes(4));
TypeScriptStarterSmokeTests.cs (2)
38var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 86await auto.RunCommandAsync("npm run build", counter, TimeSpan.FromMinutes(2));
TypeScriptStarterTemplateTests.cs (2)
27var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 57await auto.RunCommandAsync("npm run build", counter, TimeSpan.FromMinutes(2));
UpdateChannelNuGetConfigOrderingTests.cs (6)
75var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 92await auto.WaitUntilTextAsync("Created aspire.config.json", timeout: TimeSpan.FromMinutes(2)); 149await auto.WaitUntilTextAsync("Perform updates?", timeout: TimeSpan.FromMinutes(2)); 154await auto.WaitUntilTextAsync("Apply these changes to NuGet.config?", timeout: TimeSpan.FromMinutes(1)); 161await auto.WaitUntilTextAsync("Update successful!", timeout: TimeSpan.FromMinutes(3)); 200await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromSeconds(30));
WaitCommandTests.cs (4)
29var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 49await auto.WaitUntilTextAsync(RunCommandStrings.AppHostStartedSuccessfully, timeout: TimeSpan.FromMinutes(3)); 56await auto.WaitUntilTextAsync("is up (running).", timeout: TimeSpan.FromMinutes(6)); 62await auto.WaitUntilAppHostStoppedSuccessfullyAsync(timeout: TimeSpan.FromMinutes(1));
Aspire.Cli.Tests (322)
Acquisition\PeerInstallProbeTests.cs (7)
61=> new(TimeSpan.FromSeconds(30), ProbeLogger); 361var fakeSleep = TimeSpan.FromSeconds(30); 366var probe = new PeerInstallProbe(TimeSpan.FromMilliseconds(300), ProbeLogger); 395var probe = new PeerInstallProbe(TimeSpan.FromSeconds(30), ProbeLogger); 422var probe = new PeerInstallProbe(TimeSpan.FromSeconds(30), ProbeLogger); 446var deadline = DateTimeOffset.UtcNow + TimeSpan.FromSeconds(5);
Agents\AspireSkillsInstallerTests.cs (9)
117var completedTask = await Task.WhenAny(cleanupRetryBudgetExceeded.Task, installTask).WaitAsync(TimeSpan.FromSeconds(10)); 123var result = await installTask.WaitAsync(TimeSpan.FromSeconds(10)); 727await retryObserved.Task.WaitAsync(TimeSpan.FromSeconds(10)); 730var result = await installTask.WaitAsync(TimeSpan.FromSeconds(10)); 787var result = await installer.InstallAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(10)); 924await retryObserved.Task.WaitAsync(TimeSpan.FromSeconds(10)); 1014await verificationStarted.Task.WaitAsync(TimeSpan.FromSeconds(10)); 1033var firstResult = await firstInstallTask.WaitAsync(TimeSpan.FromSeconds(10)); 1044await firstInstallTask.WaitAsync(TimeSpan.FromSeconds(10));
Agents\TelemetryHookScriptTests.cs (1)
525using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(30));
Backchannel\AppHostCliBackchannelTests.cs (1)
75using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100));
Caching\DiskCacheTests.cs (1)
55await Task.Delay(TimeSpan.FromSeconds(2)).DefaultTimeout();
Certificates\UnixCertificateManagerTests.cs (2)
57Assert.True(ProcessTestHelpers.WaitForProcessExit(parentPid, TimeSpan.FromSeconds(10)), $"Expected certutil process {parentPid} to exit."); 58Assert.True(ProcessTestHelpers.WaitForProcessExit(childPid, TimeSpan.FromSeconds(10)), $"Expected child process {childPid} to exit.");
Commands\AgentMcpCommandTests.cs (2)
444using var timeoutCts = new CancellationTokenSource(TimeSpan.FromMilliseconds(200)); 618await serverRunTask.WaitAsync(TimeSpan.FromSeconds(2));
Commands\AppHostLauncherTests.cs (8)
62var now = new DateTimeOffset(2026, 02, 12, 18, 00, 00, TimeSpan.Zero); 152TimeSpan.FromSeconds(120), 167TimeSpan.FromMilliseconds(1), 201Assert.NotSame(launchTask, await Task.WhenAny(launchTask, Task.Delay(TimeSpan.FromMilliseconds(100))).DefaultTimeout()); 479Assert.NotSame(launchTask, await Task.WhenAny(launchTask, Task.Delay(TimeSpan.FromMilliseconds(100))).DefaultTimeout()); 510TimeSpan.FromSeconds(120), 542TimeSpan.FromSeconds(120), 1302StartedProcess.WaitForExit(TimeSpan.FromSeconds(10));
Commands\AppHostStartupTimeoutTests.cs (8)
22var timeout = AppHostStartupTimeout.GetBackchannelConnectionTimeout(configuration); 24Assert.Equal(TimeSpan.FromSeconds(86400), timeout); 32var timeout = AppHostStartupTimeout.GetBackchannelConnectionTimeout(configuration); 34Assert.Equal(TimeSpan.FromSeconds(120), timeout); 48var timeout = AppHostStartupTimeout.GetBackchannelConnectionTimeout(configuration); 50Assert.Equal(TimeSpan.FromSeconds(5), timeout); 66var timeout = AppHostStartupTimeout.GetBackchannelConnectionTimeout(configuration); 68Assert.Equal(TimeSpan.FromSeconds(180), timeout);
Commands\InstallationInfoOutputTests.cs (1)
43TimeSpan.FromMilliseconds(100),
Commands\LsCommandTests.cs (2)
653timeProvider.Advance(TimeSpan.FromMilliseconds(999)); 657timeProvider.Advance(TimeSpan.FromMilliseconds(1));
Commands\RunCommandTests.cs (19)
391await Task.Delay(TimeSpan.FromSeconds(30), CancellationToken.None); 419Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(3), $"Expected prompt exit after Ctrl+C, but took {stopwatch.Elapsed}."); 498await runCancellationObserved.Task.WaitAsync(TimeSpan.FromSeconds(30)); 594await dashboardRequested.Task.WaitAsync(TimeSpan.FromSeconds(30)); 602timeProvider.Advance(TimeSpan.FromSeconds(5)); 605await appHostReady.Task.WaitAsync(TimeSpan.FromSeconds(30)); 691await startupReached.Task.WaitAsync(TimeSpan.FromSeconds(30)); 693await teardownStarted.Task.WaitAsync(TimeSpan.FromSeconds(30)); 723timeProvider.Advance(TimeSpan.FromSeconds(2)); 2173var completedTask = await Task.WhenAny(dashboardUrlsDisplayed.Task, Task.Delay(TimeSpan.FromSeconds(1))).DefaultTimeout(); 2965cts.CancelAfter(TimeSpan.FromSeconds(2)); 3024cts.CancelAfter(TimeSpan.FromSeconds(2)); 3136cts.CancelAfter(TimeSpan.FromSeconds(2)); 3195cts.CancelAfter(TimeSpan.FromSeconds(2)); 3602cts.CancelAfter(TimeSpan.FromSeconds(2)); 3779Timestamp = new DateTimeOffset(2026, 3, 16, 12, 0, 0, TimeSpan.Zero), 3787Timestamp = new DateTimeOffset(2026, 3, 16, 12, 0, 1, TimeSpan.Zero), 3795Timestamp = new DateTimeOffset(2026, 3, 16, 12, 0, 2, TimeSpan.Zero), 3858Timestamp = new DateTimeOffset(2026, 3, 16, 12, 0, 0, TimeSpan.Zero),
Commands\TelemetryCommandTests.cs (2)
122var result = OtlpHelpers.CalculateDuration(start, end); 124Assert.Equal(TimeSpan.FromMilliseconds(1500), result);
Commands\TelemetryTestHelper.cs (1)
31var timeSinceEpoch = dateTime.ToUniversalTime() - unixEpoch;
ConsoleCancellationManagerTests.cs (37)
14using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 16Assert.Throws<ArgumentOutOfRangeException>(() => manager.ConfigureForCommand(TimeSpan.FromMilliseconds(-1))); 22using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 34using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 47using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(30)); 71using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(30)); 72manager.ConfigureForCommand(TimeSpan.FromMilliseconds(200)); 91using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(30)); 93manager.ConfigureForCommand(TimeSpan.FromSeconds(30)); 120using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(30)); 122manager.ConfigureForCommand(TimeSpan.FromSeconds(30)); 141using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 158using var manager = new ConsoleCancellationManager(TimeSpan.FromMilliseconds(50)); 172using var manager = new ConsoleCancellationManager(TimeSpan.FromMilliseconds(50)); 184using var manager = new ConsoleCancellationManager(TimeSpan.FromMilliseconds(50)); 185manager.ConfigureForCommand(TimeSpan.FromMilliseconds(50)); 198using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(30)); 199manager.ConfigureForCommand(TimeSpan.FromSeconds(30)); 214using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(30)); 222await Task.Delay(TimeSpan.FromMinutes(5), gracefulToken); 243var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 253var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 264using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 272using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 282using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 294var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 305var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 316using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 324using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 326manager.ConfigureForCommand(TimeSpan.FromSeconds(5)); 334using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 336manager.ConfigureForCommand(TimeSpan.Zero); 344using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 363using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 364manager.ConfigureForCommand(TimeSpan.FromMilliseconds(50)); 385using var manager = new ConsoleCancellationManager(TimeSpan.FromSeconds(5)); 386manager.ConfigureForCommand(TimeSpan.FromMilliseconds(50));
DotNet\DotNetCliRunnerTests.cs (1)
1032var completedTask = await Task.WhenAny(runTask, Task.Delay(TimeSpan.FromMilliseconds(100), TestContext.Current.CancellationToken));
DotNet\ProcessExecutionDetachedTests.cs (13)
122await detachedProcess.WaitForExitAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 172await WaitForFileAsync(startedPath).WaitAsync(TimeSpan.FromSeconds(5)); 175Assert.True(await startTask.WaitAsync(TimeSpan.FromSeconds(5))); 186await startTask.WaitAsync(TimeSpan.FromSeconds(5)); 199await detachedProcess.WaitForExitAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 244await detachedProcess.WaitForExitAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 296await detachedProcess.WaitForExitAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 350await detachedProcess.WaitForExitAsync(CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 452await bundleService.AcquisitionStarted.WaitAsync(TimeSpan.FromSeconds(5)); 455await Task.Delay(TimeSpan.FromMilliseconds(200)); 460Assert.True(await startTask.WaitAsync(TimeSpan.FromSeconds(5))); 461await disposeTask.WaitAsync(TimeSpan.FromSeconds(5)); 476await Task.Delay(TimeSpan.FromMilliseconds(50));
DotNet\ProcessExecutionTests.cs (14)
52await firstLineSeen.Task.WaitAsync(TimeSpan.FromSeconds(10)); 54await Task.Delay(TimeSpan.FromMilliseconds(500)); 70if (!releaseCallback.Task.Wait(TimeSpan.FromSeconds(20))) 84await releaseTask.WaitAsync(TimeSpan.FromSeconds(1)); 112await firstLineSeen.Task.WaitAsync(TimeSpan.FromSeconds(10)); 114await Task.Delay(TimeSpan.FromMilliseconds(6500)); 130if (!releaseCallback.Task.Wait(TimeSpan.FromSeconds(20))) 142await releaseTask.WaitAsync(TimeSpan.FromSeconds(1)); 175Assert.True(WaitForProcessExit(execution.ProcessId, TimeSpan.FromSeconds(10)), $"Expected process {execution.ProcessId} to exit after cancellation."); 205Assert.True(WaitForProcessExit(execution.ProcessId, TimeSpan.FromSeconds(10)), $"Expected process {execution.ProcessId} to exit after graceful signal."); 233await signaled.Task.WaitAsync(TimeSpan.FromSeconds(10)); 237await waitTask.WaitAsync(TimeSpan.FromSeconds(30)); 240Assert.True(WaitForProcessExit(execution.ProcessId, TimeSpan.FromSeconds(10)), $"Expected process {execution.ProcessId} to be killed after graceful expiration."); 266Assert.True(WaitForProcessExit(execution.ProcessId, TimeSpan.FromSeconds(10)), $"Expected process {execution.ProcessId} to be killed after signaler failure.");
DotNetSdkInstallerTests.cs (2)
75Assert.True(ProcessTestHelpers.WaitForProcessExit(parentPid, TimeSpan.FromSeconds(10)), $"Expected dotnet process {parentPid} to exit."); 76Assert.True(ProcessTestHelpers.WaitForProcessExit(childPid, TimeSpan.FromSeconds(10)), $"Expected child process {childPid} to exit.");
Mcp\Docs\DocsIndexServiceTests.cs (2)
823var fetcher = new DelayingDocsFetcher("# Doc\nContent.", TimeSpan.FromSeconds(10)); 1689private sealed class DelayingDocsFetcher(string? content, TimeSpan delay) : IDocsFetcher
NuGet\BundleNuGetServiceTests.cs (1)
362await firstRestoreStarted.Task.WaitAsync(TimeSpan.FromSeconds(10));
NuGet\NuGetPackagePrefetcherTests.cs (1)
385timeProvider.Advance(TimeSpan.FromMilliseconds(1500));
Processes\IsolatedProcessTests.cs (11)
38await Task.WhenAll(child.StandardOutputClosed, child.StandardErrorClosed).WaitAsync(TimeSpan.FromSeconds(10)); 39await child.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(10)); 70await Task.WhenAll(child.StandardOutputClosed, child.StandardErrorClosed).WaitAsync(TimeSpan.FromSeconds(10)); 71await child.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(10)); 108async () => await child.StandardOutputClosed.WaitAsync(TimeSpan.FromSeconds(10))); 111await child.StandardErrorClosed.WaitAsync(TimeSpan.FromSeconds(10)); 112await child.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(10)); 147await callbackEntered.Task.WaitAsync(TimeSpan.FromSeconds(10)); 148await child.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(10)); 151await child.DisposeAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(1)); 156await child.StandardOutputClosed.WaitAsync(TimeSpan.FromSeconds(10));
Processes\LauncherLivenessMonitorTests.cs (4)
14private static readonly TimeSpan s_observationTimeout = TimeSpan.FromSeconds(15); 67await Task.Delay(TimeSpan.FromSeconds(3)); 91await Task.Delay(TimeSpan.FromSeconds(3));
Processes\ParentProcessLivenessMonitorTests.cs (4)
11private static readonly TimeSpan s_observationTimeout = TimeSpan.FromSeconds(15); 82await Task.Delay(TimeSpan.FromSeconds(3)); 111await Task.Delay(TimeSpan.FromSeconds(3));
Processes\ProcessTreeGracefulShutdownServiceTests.cs (8)
180CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 227CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(2)); 230await cliProcess.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(2)); 266CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(2)); 269await cliProcess.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(2)); 305CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(5)); 308await appHostProcess.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(2)); 391await process.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(5));
Processes\WindowsConsoleProcessJobTests.cs (2)
43await spawnedProcess.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(15)); 61await spawnedProcess.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(15));
ProfileCaptureOptionsTests.cs (4)
52Assert.Equal(TimeSpan.FromSeconds(7), options.StartupDelay); 67Assert.Equal(TimeSpan.FromSeconds(RootCommand.DefaultCaptureProfileDelaySeconds), options.StartupDelay); 159StartupDelay: TimeSpan.FromSeconds(3)); 190StartupDelay: TimeSpan.FromSeconds(3));
ProfileCaptureServiceTests.cs (17)
31private static readonly TimeSpan s_testTimeout = TimeSpan.FromSeconds(10); 32private static readonly TimeSpan s_testPollInterval = TimeSpan.FromSeconds(1); 199timeProvider.Advance(s_testTimeout + TimeSpan.FromTicks(1)); 233await session.WaitForDashboardAsync(s_testTimeout, TimeSpan.Zero, CancellationToken.None); 263timeProvider.Advance(s_testTimeout + TimeSpan.FromTicks(1)); 306timeProvider.Advance(TimeSpan.FromSeconds(1)); 310await disposeTask.WaitAsync(TimeSpan.FromSeconds(10)); 330profileDataTimeout: TimeSpan.FromSeconds(1), 331profileDataPollInterval: TimeSpan.Zero, 366profileDataTimeout: TimeSpan.FromSeconds(1), 367profileDataPollInterval: TimeSpan.Zero, 526TimeSpan? profileDataTimeout = null, 527TimeSpan? profileDataPollInterval = null, 593timeoutTimeProvider?.Advance(s_testTimeout + TimeSpan.FromTicks(1)); 691TimeSpan.Zero);
Projects\AppHostServerSessionTests.cs (11)
144WaitForProcessExit(project.StartedExecution!.ProcessId, TimeSpan.FromSeconds(30)), 153Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(5), 203var exitCode = await completion.WaitAsync(TimeSpan.FromSeconds(30)); 248await completion.WaitAsync(TimeSpan.FromSeconds(30)); 294await signaled.Task.WaitAsync(TimeSpan.FromSeconds(10)); 298await completion.WaitAsync(TimeSpan.FromSeconds(30)); 332await completion.WaitAsync(TimeSpan.FromSeconds(30)); 367await session.DisposeAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(30)); 373Assert.True(WaitForProcessExit(pid, TimeSpan.FromSeconds(5)), $"Process {pid} should be exited after DisposeAsync."); 386var exitCode = await session.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(30)); 495private static bool WaitForProcessExit(int pid, TimeSpan timeout)
Projects\GuestAppHostProjectTests.cs (1)
1116using var cancellationSource = new CancellationTokenSource(TimeSpan.FromSeconds(1));
Projects\GuestRuntimeTests.cs (2)
854using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); 939Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(15),
Projects\ProcessGuestLauncherTests.cs (11)
79var (exitCode, _) = await launchTask.WaitAsync(TimeSpan.FromSeconds(30)); 83Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(15), 133var (exitCode, _) = await launchTask.WaitAsync(TimeSpan.FromSeconds(30)); 186var (exitCode, _) = await launchTask.WaitAsync(TimeSpan.FromSeconds(10)); 192Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(5), 245await signaled.Task.WaitAsync(TimeSpan.FromSeconds(10)); 250var (exitCode, _) = await launchTask.WaitAsync(TimeSpan.FromSeconds(30)); 254Assert.True(WaitForProcessExit(descendantPid, TimeSpan.FromSeconds(10)), $"Expected descendant process {descendantPid} to be killed with the root process tree."); 255Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(15), 303var (exitCode, _) = await launchTask.WaitAsync(TimeSpan.FromSeconds(30)); 308Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(15),
Telemetry\InternalMicrosoftDetectorTests.cs (25)
22var now = new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero); 61var now = new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero); 99new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 135new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 149await Task.Delay(TimeSpan.FromMinutes(5), cancellationToken); 178new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 192await Task.Delay(TimeSpan.FromMinutes(5), cancellationToken); 218new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 238new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 269new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 303new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 332new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 355new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 379new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 403new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 426new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 458new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 475await Task.Delay(TimeSpan.FromMinutes(1), cancellationToken); 484new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 488gitHubCandidateTimeout: TimeSpan.FromMilliseconds(100), 506Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(10), $"Elapsed {stopwatch.Elapsed} exceeded the overall candidate timeout budget."); 534new DateTimeOffset(2026, 6, 16, 12, 0, 0, TimeSpan.Zero), 541using var safetyTimeout = new CancellationTokenSource(TimeSpan.FromSeconds(30)); 569TimeSpan? gitHubCandidateTimeout = null, 570TimeSpan? gitHubHttpTimeout = null)
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
tests\Shared\TestProcesses.cs (2)
21private static readonly TimeSpan s_maxLifetime = TimeSpan.FromMinutes(5);
TestServices\ProcessTestHelpers.cs (1)
36public static bool WaitForProcessExit(int pid, TimeSpan timeout)
TestServices\TestAppHostCliBackchannel.cs (1)
84using var timer = new PeriodicTimer(TimeSpan.FromSeconds(1));
Utils\CliPathHelperTests.cs (8)
404File.SetLastWriteTimeUtc(staleFile, fakeTime.GetUtcNow().UtcDateTime - TimeSpan.FromHours(48)); 405File.SetLastWriteTimeUtc(freshFile, fakeTime.GetUtcNow().UtcDateTime - TimeSpan.FromMinutes(5)); 408var deleted = CliPathHelper.CleanupStaleCliSockets(socketDirectory, TimeSpan.FromHours(24), fakeTime); 433File.SetLastWriteTimeUtc(matching, fakeTime.GetUtcNow().UtcDateTime - TimeSpan.FromHours(48)); 434File.SetLastWriteTimeUtc(unrelated, fakeTime.GetUtcNow().UtcDateTime - TimeSpan.FromHours(48)); 437var deleted = CliPathHelper.CleanupStaleCliSockets(socketDirectory, TimeSpan.FromHours(24), fakeTime); 457var deleted = CliPathHelper.CleanupStaleCliSockets(missingDir, TimeSpan.FromHours(24)); 468var deleted = CliPathHelper.CleanupStaleCliSockets(tempDir.FullName, TimeSpan.FromHours(24));
Utils\CliTestHelper.cs (1)
208finalDrainBudget: TimeSpan.FromSeconds(5)));
Utils\ConsoleActivityLoggerTests.cs (48)
220new ConsoleActivityLogger.StepDurationRecord("step1", "Test Step", ConsoleActivityLogger.ActivityState.Failure, TimeSpan.FromSeconds(1.5), "Error: Type[[T]] is invalid [[details]]") 248new ConsoleActivityLogger.StepDurationRecord("step1", "Test Step", ConsoleActivityLogger.ActivityState.Failure, TimeSpan.FromSeconds(1.5), "Failed to provision [bold]storage-roles[/]: Deployment failed") 271new ConsoleActivityLogger.StepDurationRecord("root", "Prepare", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(10), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromSeconds(10)), 272new ConsoleActivityLogger.StepDurationRecord("child-a", "Build", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(3), null, "root", 1, 2, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(4)), 273new ConsoleActivityLogger.StepDurationRecord("grandchild", "Package", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(1), null, "child-a", 2, 3, TimeSpan.FromSeconds(1.5), TimeSpan.FromSeconds(2.5)), 274new ConsoleActivityLogger.StepDurationRecord("child-b", "Publish", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(2), null, "root", 1, 4, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(7)), 275new ConsoleActivityLogger.StepDurationRecord("finalize", "Finalize", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(1), null, null, 0, 5, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(11)), 305new ConsoleActivityLogger.StepDurationRecord("root", "Prepare", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(8), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromSeconds(8)), 306new ConsoleActivityLogger.StepDurationRecord("child", "Publish", ConsoleActivityLogger.ActivityState.Warning, TimeSpan.FromSeconds(2), null, "root", 1, 2, TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(6)), 334new ConsoleActivityLogger.StepDurationRecord("root", "Prepare", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromMilliseconds(8), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromMilliseconds(8)), 335new ConsoleActivityLogger.StepDurationRecord("child", "Publish", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromMilliseconds(2), null, "root", 1, 2, TimeSpan.FromMilliseconds(4), TimeSpan.FromMilliseconds(6)), 358new ConsoleActivityLogger.StepDurationRecord("root", "Prepare", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromMilliseconds(100), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromMilliseconds(100)), 359new ConsoleActivityLogger.StepDurationRecord("tiny", "Package", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromMilliseconds(0.1), null, "root", 1, 2, TimeSpan.FromMilliseconds(10), TimeSpan.FromMilliseconds(10.1)), 380new ConsoleActivityLogger.StepDurationRecord("root", "Prepare", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(8), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromSeconds(8)), 381new ConsoleActivityLogger.StepDurationRecord("zero", "Zero event", ConsoleActivityLogger.ActivityState.Success, TimeSpan.Zero, null, "root", 1, 2, TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(4)), 416new ConsoleActivityLogger.StepDurationRecord("root", "Prepare", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(8), null, null, 0, 1, TimeSpan.Zero, TimeSpan.FromSeconds(8)), 417new ConsoleActivityLogger.StepDurationRecord("deep", "Publish", ConsoleActivityLogger.ActivityState.Success, TimeSpan.FromSeconds(2), null, "root", 12, 2, TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(6)), 482while (console.MoveLeftCallCount == 0 && sw.Elapsed < TimeSpan.FromSeconds(10))
Utils\DcpConnectionHealthCheckTests.cs (1)
193Task DelayAsync(TimeSpan _, CancellationToken cancellationToken)
Utils\DevCertsCheckTests.cs (1)
633await Task.Delay(TimeSpan.FromSeconds(30), cancellationToken);
Utils\EnvironmentCheckerTests.cs (6)
38checkTimeout: TimeSpan.FromMilliseconds(100), 39totalTimeout: TimeSpan.FromSeconds(5)); 82checkTimeout: TimeSpan.FromSeconds(5), 83totalTimeout: TimeSpan.FromMilliseconds(100)); 100checkTimeout: TimeSpan.FromSeconds(5), 101totalTimeout: TimeSpan.FromSeconds(10));
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)
56service.Flush(TimeSpan.FromMilliseconds(1000));
ProducerExtensions.cs (1)
12while (producer.Flush(TimeSpan.FromMilliseconds(100)) != 0)
Aspire.Dashboard (156)
Components\Controls\ApplicationName.razor.cs (1)
38timeoutCts.CancelAfter(TimeSpan.FromSeconds(2));
Components\Controls\Chart\ChartBase.cs (5)
25private TimeSpan _tickDuration; 35protected virtual TimeSpan UpdateInterval => TimeSpan.FromSeconds(0.2); 58public required TimeSpan Duration { get; set; } 265return TimeProvider.GetUtcNow().Subtract(TimeSpan.FromSeconds(1));
Components\Controls\Chart\ChartContainer.razor.cs (11)
18private static readonly TimeSpan s_chartUpdateInterval = TimeSpan.FromSeconds(0.2); 19private static readonly TimeSpan s_dataFetchInterval = TimeSpan.FromSeconds(1); 28private (ResourceKey ResourceKey, string MeterName, string InstrumentName, TimeSpan Duration)? _instrumentRequestKey; 44public required TimeSpan Duration { get; set; } 264var duration = Duration; 295var dataPointInterval = MetricDataPointInterval.Get(duration); 299var historyDuration = TimeSpan.FromTicks(Math.Max(TimeSpan.FromSeconds(30).Ticks, dataPointInterval.Ticks));
Components\Controls\Chart\ChartDataCalculator.cs (11)
16private readonly TimeSpan _duration; 18public ChartDataCalculator(int pointCount, TimeSpan duration) 26var pointDuration = _duration / _pointCount; 70var pointDuration = _duration / _pointCount; 148var metricStart = new DateTimeOffset(metric.Start, TimeSpan.Zero); 149var metricEnd = new DateTimeOffset(metric.End, TimeSpan.Zero); 193start = start.Subtract(TimeSpan.FromSeconds(1)); 194end = end.Add(TimeSpan.FromSeconds(1)); 204var metricStart = new DateTimeOffset(metric.Start, TimeSpan.Zero); 297internal static DateTimeOffset CalcOffset(int pointIndex, DateTimeOffset now, TimeSpan pointDuration) 328var exemplarStart = toLocal(new DateTimeOffset(exemplar.Start, TimeSpan.Zero));
Components\Controls\Chart\MetricDataPointInterval.cs (17)
14public static TimeSpan Get(TimeSpan duration) 16if (duration <= TimeSpan.FromMinutes(5)) 18return TimeSpan.FromSeconds(1); 21if (duration <= TimeSpan.FromMinutes(15)) 23return TimeSpan.FromSeconds(2); 26if (duration <= TimeSpan.FromMinutes(30)) 28return TimeSpan.FromSeconds(5); 31if (duration <= TimeSpan.FromHours(1)) 33return TimeSpan.FromSeconds(10); 36if (duration <= TimeSpan.FromHours(3)) 38return TimeSpan.FromSeconds(30); 41if (duration <= TimeSpan.FromHours(6)) 43return TimeSpan.FromMinutes(1); 46if (duration <= TimeSpan.FromHours(12)) 48return TimeSpan.FromMinutes(2); 51return TimeSpan.FromMinutes(5);
Components\Controls\Chart\MetricInstrumentDataCache.cs (4)
12public static List<MetricDimensionCursor> CreateCursors(OtlpInstrumentData data, TimeSpan refreshLookback, TimeSpan dataPointInterval) 14ArgumentOutOfRangeException.ThrowIfLessThan(refreshLookback, TimeSpan.Zero); 15ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(dataPointInterval, TimeSpan.Zero);
Components\Controls\Chart\MetricTable.razor.cs (2)
32protected override TimeSpan UpdateInterval => TimeSpan.FromSeconds(1);
Components\Controls\ResourceDetails.razor.cs (3)
482var duration = DateTime.UtcNow.Subtract(context.LastRunAtTimeStamp.Value); 485var roundedDuration = TimeSpan.FromSeconds(Math.Round(duration.TotalSeconds));
Components\Dialogs\FilterDialog.razor.cs (1)
390return dateTime.Ticks % TimeSpan.TicksPerSecond == 0
Components\Pages\ConsoleLogs.razor.cs (5)
30private static readonly TimeSpan s_noLogsMessageDelay = TimeSpan.FromSeconds(1.5); 69public TimeSpan GetCancelElapsedTime() => Stopwatch.GetElapsedTime(_cancelTimestamp); 251await loadingTcs.Task.WaitAsync(TimeSpan.FromSeconds(5), _resourceSubscriptionToken); 368await foreach (var batch in _logEntryChannel.GetBatchesAsync(minReadInterval: TimeSpan.FromMilliseconds(100), cancellationToken: _resourceSubscriptionToken))
Components\Pages\Metrics.razor.cs (13)
22private List<SelectViewModel<TimeSpan>> _durations = null!; 23private static readonly TimeSpan s_defaultDuration = TimeSpan.FromMinutes(5); 89_durations = new List<SelectViewModel<TimeSpan>> 91new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastOneMinute)], Id = TimeSpan.FromMinutes(1) }, 92new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastFiveMinutes)], Id = TimeSpan.FromMinutes(5) }, 93new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastFifteenMinutes)], Id = TimeSpan.FromMinutes(15) }, 94new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastThirtyMinutes)], Id = TimeSpan.FromMinutes(30) }, 95new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastHour)], Id = TimeSpan.FromHours(1) }, 96new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastThreeHours)], Id = TimeSpan.FromHours(3) }, 97new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastSixHours)], Id = TimeSpan.FromHours(6) }, 98new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastTwelveHours)], Id = TimeSpan.FromHours(12) }, 266public SelectViewModel<TimeSpan> SelectedDuration { get; set; } = null!;
DashboardWebApplication.cs (1)
909options.ExpireTimeSpan = TimeSpan.FromDays(3);
Model\DashboardCommandExecutor.cs (1)
79await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
Model\Otlp\SpanWaterfallViewModel.cs (2)
186var relativeStart = span.StartTime - traceStart; 206var logRelativeStart = log.TimeStamp - traceStart;
Model\Otlp\TelemetryFilter.cs (1)
187var filterMs = filterDate.ToUniversalTime().Ticks / TimeSpan.TicksPerMillisecond;
Model\TraceLinkHelpers.cs (1)
80await Task.Delay(TimeSpan.FromSeconds(0.5), cts.Token).ConfigureAwait(false);
Model\TracesViewModel.cs (1)
32public TimeSpan MaxDuration { get; private set; }
Otlp\Model\OtlpLogEntry.cs (1)
73KnownStructuredLogFields.TimestampField => (log.TimeStamp.ToUniversalTime().Ticks / TimeSpan.TicksPerMillisecond).ToString(CultureInfo.InvariantCulture),
Otlp\Model\OtlpSpan.cs (2)
46public TimeSpan Duration => EndTime - StartTime; 244KnownTraceFields.TimestampField => (span.StartTime.ToUniversalTime().Ticks / TimeSpan.TicksPerMillisecond).ToString(CultureInfo.InvariantCulture),
Otlp\Model\OtlpTrace.cs (3)
12private TimeSpan? _duration; 22public TimeSpan Duration => _duration ??= CalculateDuration(); 154private TimeSpan CalculateDuration()
Otlp\Storage\GetInstrumentRequest.cs (1)
49public TimeSpan? DataPointInterval { get; init; }
Otlp\Storage\GetTracesResponse.cs (1)
11public required TimeSpan MaxDuration { get; init; }
Otlp\Storage\GetTraceSummariesResponse.cs (1)
12public required TimeSpan MaxDuration { get; init; }
Otlp\Storage\SqliteTelemetryRepository.Logs.cs (3)
588parameters.Add(parameterName, timestamp.ToUniversalTime().Ticks / TimeSpan.TicksPerMillisecond); 589return BuildNumericPredicate($"l.timestamp_ticks / {TimeSpan.TicksPerMillisecond}", filter.Condition, parameterName); 612KnownStructuredLogFields.TimestampField => $"CAST(l.timestamp_ticks / {TimeSpan.TicksPerMillisecond} AS TEXT)",
Otlp\Storage\SqliteTelemetryRepository.Metrics.Reads.cs (3)
167TimeSpan? dataPointInterval, 173if (dataPointInterval is { } interval && interval <= TimeSpan.Zero) 411TimeSpan? dataPointInterval,
Otlp\Storage\SqliteTelemetryRepository.Runtime.cs (2)
23private TimeSpan _subscriptionMinExecuteInterval = CallbackThrottler.DefaultMinExecuteInterval; 29internal TimeSpan SubscriptionMinExecuteInterval
Otlp\Storage\SqliteTelemetryRepository.Traces.Reads.cs (6)
53MaxDuration = TimeSpan.FromTicks(aggregate.MaxDurationTicks) 150Duration = TimeSpan.FromTicks(trace.DurationTicks!.Value), 171MaxDuration = TimeSpan.FromTicks(firstRecord.MaxDurationTicks) 323return BuildNumericPredicate($"(CAST(t.duration_ticks AS REAL) / {TimeSpan.TicksPerMillisecond})", filter.Condition, parameterName); 365parameters.Add(parameterName, date.ToUniversalTime().Ticks / TimeSpan.TicksPerMillisecond); 479sql.Append(BuildNumericPredicate($"(CAST(s.end_time_ticks - s.start_time_ticks AS REAL) / {TimeSpan.TicksPerMillisecond})", fieldFilter.Condition, parameterName));
Otlp\Storage\Subscription.cs (1)
27public Subscription(string name, ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback, Action unsubscribe, ExecutionContext? executionContext, ILogger logger, TimeSpan minExecuteInterval)
Otlp\Storage\TraceSummary.cs (1)
16public required TimeSpan Duration { get; init; }
ServiceClient\DashboardClient.cs (10)
146KeepAlivePingDelay = TimeSpan.FromSeconds(20), 147KeepAlivePingTimeout = TimeSpan.FromSeconds(10), 179InitialBackoff = TimeSpan.FromSeconds(1), 180MaxBackoff = TimeSpan.FromSeconds(5), 391var delay = TimeSpan.FromSeconds(Math.Min(Math.Pow(2, errorCount - 1), 15)); 482var delay = ExponentialBackOff(retryContext.ErrorCount, maxSeconds: 15); 544static TimeSpan ExponentialBackOff(int errorCount, double maxSeconds) 546return TimeSpan.FromSeconds(Math.Min(Math.Pow(2, errorCount - 1), maxSeconds)); 871await foreach (var batch in channel.GetBatchesAsync(minReadInterval: TimeSpan.FromMilliseconds(100), cancellationToken: enumeratorCancellationToken).ConfigureAwait(false))
src\Shared\ChannelExtensions.cs (3)
27TimeSpan? minReadInterval = null, 40var s = lastRead.Value.Add(minReadInterval.Value) - DateTime.UtcNow; 41if (s > TimeSpan.Zero)
src\Shared\DurationFormatter.cs (14)
37new UnitStep { Unit = "d", Ticks = TimeSpan.TicksPerDay, Threshold = TimeSpan.TicksPerDay }, 38new UnitStep { Unit = "h", Ticks = TimeSpan.TicksPerHour, Threshold = TimeSpan.TicksPerHour }, 39new UnitStep { Unit = "m", Ticks = TimeSpan.TicksPerMinute, Threshold = TimeSpan.TicksPerMinute }, 40new UnitStep { Unit = "s", Ticks = TimeSpan.TicksPerSecond, Threshold = TimeSpan.TicksPerSecond / 10, IsDecimal = true }, 41new UnitStep { Unit = "ms", Ticks = TimeSpan.TicksPerMillisecond, Threshold = TimeSpan.TicksPerMillisecond / 100, IsDecimal = true }, 42new UnitStep { Unit = "μs", Ticks = TimeSpan.TicksPerMicrosecond, Threshold = TimeSpan.TicksPerMicrosecond, IsDecimal = true }, 45public static string FormatDuration(TimeSpan duration, CultureInfo? culture = null, DecimalDurationDisplay decimalDisplay = DecimalDurationDisplay.Optional) 71public static string GetUnit(TimeSpan duration)
src\Shared\FileLock.cs (7)
32private static readonly TimeSpan s_defaultRetryDelay = TimeSpan.FromMilliseconds(10); 33private static readonly TimeSpan s_defaultTimeout = TimeSpan.FromMinutes(5); 69/// Uses <see cref="Task.Delay(TimeSpan, CancellationToken)"/> between retries to avoid blocking the thread pool. 76public static async Task<FileLock> AcquireAsync(string lockPath, CancellationToken cancellationToken = default, TimeSpan? timeout = null) 78var effectiveTimeout = timeout ?? s_defaultTimeout;
src\Shared\Otlp\OtlpHelpers.cs (7)
57var timeSinceEpoch = dateTime.ToUniversalTime() - DateTime.UnixEpoch; 58return (ulong)timeSinceEpoch.Ticks * TimeSpan.NanosecondsPerTick; 66return (long)(nanoseconds / TimeSpan.NanosecondsPerTick); 72public static TimeSpan NanosecondsToTimeSpan(ulong nanoseconds) 74return TimeSpan.FromTicks(NanosecondsToTicks(nanoseconds)); 80public static TimeSpan CalculateDuration(ulong? startNano, ulong? endNano) 86return TimeSpan.Zero;
Utils\CallbackThrottler.cs (7)
12public static readonly TimeSpan DefaultMinExecuteInterval = TimeSpan.FromMilliseconds(500); 17public CallbackThrottler(string name, ILogger logger, TimeSpan minExecuteInterval, Func<Task> callback, ExecutionContext? executionContext) 31private readonly TimeSpan _minExecuteInterval; 51var minExecuteInterval = _minExecuteInterval; 52var s = lastExecute.Value.Add(minExecuteInterval) - DateTime.UtcNow; 53if (s > TimeSpan.Zero)
Utils\DashboardUIHelpers.cs (3)
52public static readonly TimeSpan ToastTimeout = TimeSpan.FromMilliseconds(5000); 125public static int SafeConvertToMilliseconds(TimeSpan duration)
Aspire.Dashboard.Components.Tests (45)
Controls\PlotlyChartTests.cs (1)
91builder.Add(p => p.Duration, TimeSpan.FromSeconds(1));
Layout\MainLayoutTests.cs (10)
396StartedAtUtc: new DateTimeOffset(2025, 1, 2, 12, 30, 0, TimeSpan.Zero), 397EndedAtUtc: new DateTimeOffset(2025, 1, 2, 13, 30, 0, TimeSpan.Zero), 697new DashboardRunDescriptor("unpinned-b", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 12, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false), 698new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 11, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false), 699new DashboardRunDescriptor("unpinned-a", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 9, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false), 700new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 10, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false) 797StartedAtUtc: new DateTimeOffset(2025, 1, 2, 12, 30, 0, TimeSpan.Zero), 798EndedAtUtc: new DateTimeOffset(2025, 1, 2, 13, 30, 0, TimeSpan.Zero), 910StartedAtUtc: new DateTimeOffset(2025, 1, 2, 12, 30, 0, TimeSpan.Zero), 911EndedAtUtc: new DateTimeOffset(2025, 1, 2, 13, 30, 0, TimeSpan.Zero),
Pages\ConsoleLogsTests.cs (1)
435var emptyMessage = cut.WaitForElement(".console-empty-message", TimeSpan.FromSeconds(3));
Pages\MetricsTests.cs (10)
114builder.Add(component => component.Duration, TimeSpan.FromMinutes(5)); 171cut.SetParametersAndRender(builder => builder.Add(component => component.Duration, TimeSpan.FromMinutes(5))); 175cut.SetParametersAndRender(builder => builder.Add(component => component.Duration, TimeSpan.FromMinutes(1))); 228builder.Add(component => component.Duration, TimeSpan.FromMinutes(5)); 316builder.Add(component => component.Duration, TimeSpan.FromSeconds(1)); 324timeProvider.Advance(TimeSpan.FromSeconds(1)); 339timeProvider.Advance(TimeSpan.FromSeconds(10)); 769Assert.Equal(TimeSpan.FromMinutes(720), viewModel.SelectedDuration.Id); 776public override ITimer CreateTimer(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
Pages\ResourcesTests.cs (1)
307await showContextMenuTask.WaitAsync(TimeSpan.FromSeconds(1));
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
308var timeSinceEpoch = dateTime.ToUniversalTime() - unixEpoch;
Aspire.Dashboard.Tests (174)
ChannelExtensionsTests.cs (6)
108var minReadInterval = TimeSpan.FromMilliseconds(500); 138var elapsed = stopwatch.Elapsed; 152var minReadInterval = TimeSpan.FromMilliseconds(50000); 191var elapsed = stopwatch.Elapsed;
ChartDataCalculatorTests.cs (30)
18private static readonly DateTimeOffset s_startTime = new(2025, 6, 15, 12, 0, 0, TimeSpan.Zero); 30var duration = TimeSpan.FromSeconds(10); 33Assert.Equal(now.Subtract(TimeSpan.FromSeconds(10)), ChartDataCalculator.CalcOffset(1, now, duration)); 34Assert.Equal(now.Subtract(TimeSpan.FromSeconds(30)), ChartDataCalculator.CalcOffset(3, now, duration)); 35Assert.Equal(now.Add(TimeSpan.FromSeconds(10)), ChartDataCalculator.CalcOffset(-1, now, duration)); 100var start = new DateTimeOffset(2025, 6, 15, 12, 0, 0, TimeSpan.Zero); 101var end = new DateTimeOffset(2025, 6, 15, 12, 0, 10, TimeSpan.Zero); 122var metricStart = new DateTimeOffset(2025, 6, 15, 11, 0, 0, TimeSpan.Zero); 123var metricEnd = new DateTimeOffset(2025, 6, 15, 11, 0, 10, TimeSpan.Zero); 133var queryStart = new DateTimeOffset(2025, 6, 15, 12, 0, 0, TimeSpan.Zero); 134var queryEnd = new DateTimeOffset(2025, 6, 15, 12, 0, 10, TimeSpan.Zero); 148var start = new DateTimeOffset(2025, 6, 15, 12, 0, 0, TimeSpan.Zero); 149var end = new DateTimeOffset(2025, 6, 15, 12, 0, 10, TimeSpan.Zero); 177var start = new DateTimeOffset(2025, 6, 15, 12, 0, 0, TimeSpan.Zero); 210var start = new DateTimeOffset(2025, 6, 15, 12, 0, 0, TimeSpan.Zero); 211var end = new DateTimeOffset(2025, 6, 15, 12, 0, 10, TimeSpan.Zero); 247var calculator = new ChartDataCalculator(pointCount: 30, duration: TimeSpan.FromMinutes(5)); 278var calculator = new ChartDataCalculator(pointCount: 10, duration: TimeSpan.FromSeconds(100)); 291var calculator = new ChartDataCalculator(pointCount: 5, duration: TimeSpan.FromSeconds(50)); 317var calculator = new ChartDataCalculator(pointCount: 5, duration: TimeSpan.FromSeconds(50)); 342var start = new DateTimeOffset(2025, 6, 15, 12, 0, 0, TimeSpan.Zero); 408var calculator = new ChartDataCalculator(pointCount: 10, duration: TimeSpan.FromSeconds(100)); 431var offset = TimeSpan.FromHours(5); 434var calculator = new ChartDataCalculator(pointCount: 5, duration: TimeSpan.FromSeconds(50)); 490var cursors = MetricInstrumentDataCache.CreateCursors(cached, TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(1)); 521Assert.Equal(TimeSpan.FromSeconds(expectedSeconds), MetricDataPointInterval.Get(TimeSpan.FromMinutes(durationMinutes)));
CustomAssert.cs (5)
10public static void AssertExceedsMinInterval(TimeSpan duration, TimeSpan minInterval) 14var tolerance = TimeSpan.FromMilliseconds(200); 15var effectiveMinInterval = minInterval.Subtract(tolerance);
DashboardUIHelpersTests.cs (12)
29var duration = TimeSpan.FromMilliseconds(milliseconds); 42var duration = TimeSpan.FromMilliseconds((double)int.MaxValue + 1000); 55var duration = TimeSpan.FromMilliseconds(int.MaxValue); 68var duration = TimeSpan.FromMilliseconds((double)int.MinValue - 1000); 82var duration = TimeSpan.MaxValue; 95var duration = TimeSpan.MinValue;
DurationFormatterTests.cs (40)
26Assert.Equal(unit, DurationFormatter.GetUnit(TimeSpan.FromTicks(ticks))); 32Assert.Equal("1μs", DurationFormatter.FormatDuration(TimeSpan.FromTicks(1 * TimeSpan.TicksPerMicrosecond), CultureInfo.CurrentCulture)); 38var input = 10 * TimeSpan.TicksPerDay + 13 * TimeSpan.TicksPerHour + 30 * TimeSpan.TicksPerMinute; 39Assert.Equal("10d 14h", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture)); 45var input = 2 * TimeSpan.TicksPerDay + 5 * TimeSpan.TicksPerMinute; 46Assert.Equal("2d", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture)); 52var input = 2 * TimeSpan.TicksPerMillisecond + 357 * TimeSpan.TicksPerMicrosecond; 53Assert.Equal(2.36m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture)); 59var input = 2 * TimeSpan.TicksPerSecond + 357 * TimeSpan.TicksPerMillisecond; 60Assert.Equal(2.36m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture)); 66var input = 2 * TimeSpan.TicksPerMinute + 30 * TimeSpan.TicksPerSecond + 555 * TimeSpan.TicksPerMillisecond; 67Assert.Equal("2m 31s", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture)); 73var input = 2 * TimeSpan.TicksPerHour + 30 * TimeSpan.TicksPerMinute + 30 * TimeSpan.TicksPerSecond; 74Assert.Equal("2h 31m", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture)); 81Assert.Equal(0.92m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture)); 87var input = 915 * TimeSpan.TicksPerMillisecond; 88Assert.Equal(0.92m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture)); 94var input = (double)TimeSpan.TicksPerMicrosecond / 10; 95Assert.Equal(0.1m.ToString("0.##μs", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks((long)input), CultureInfo.CurrentCulture)); 102Assert.Equal("0μs", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture)); 115var result = DurationFormatter.FormatDuration(TimeSpan.FromSeconds(seconds), CultureInfo.InvariantCulture); 128var result = DurationFormatter.FormatDuration(TimeSpan.FromSeconds(oneDayInSeconds)); 138var duration = TimeSpan.FromMinutes(2) + TimeSpan.FromSeconds(30) + TimeSpan.FromMilliseconds(555); 158TimeSpan.FromSeconds(seconds), 178TimeSpan.FromSeconds(seconds), 190var duration = TimeSpan.FromSeconds(1.0);
FormatHelpersTests.cs (1)
183var provider = new FixedTimeProvider(new DateTimeOffset(2025, 12, 20, 23, 59, 59, TimeSpan.Zero));
Integration\IntegrationTestHelpers.cs (2)
170InitialBackoff = TimeSpan.FromSeconds(1), 171MaxBackoff = TimeSpan.FromSeconds(5),
Integration\OtlpHttpJsonTests.cs (1)
547Assert.Equal(TimeSpan.FromSeconds(1), span.Duration);
Integration\TelemetryApiTests.cs (2)
354using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2)); 385using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2));
Model\DashboardCommandExecutorTests.cs (6)
44var commandToken = await commandStartedTcs.Task.WaitAsync(TimeSpan.FromSeconds(10)); 63await executeTask.WaitAsync(TimeSpan.FromSeconds(10)); 89var commandToken = await commandStartedTcs.Task.WaitAsync(TimeSpan.FromSeconds(10)); 108await executeTask.WaitAsync(TimeSpan.FromSeconds(10)); 130await commandStartedTcs.Task.WaitAsync(TimeSpan.FromSeconds(10)); 137await executeTask.WaitAsync(TimeSpan.FromSeconds(10));
Model\DashboardDataSourceTests.cs (10)
84var timeProvider = new FixedTimeProvider(new DateTimeOffset(2026, 7, 20, 12, 34, 56, 789, TimeSpan.Zero)); 96var timeProvider = new FixedTimeProvider(new DateTimeOffset(2026, 7, 20, 12, 34, 56, 789, TimeSpan.Zero)); 138var startedAt = new DateTimeOffset(2026, 7, 29, 12, 0, 0, TimeSpan.Zero); 602var startedAt = new DateTimeOffset(2026, 8, 5, 12, 34, 56, TimeSpan.Zero); 627var startedAt = new DateTimeOffset(2026, 8, 5, 12, 34, 56, TimeSpan.Zero); 671var startedAt = new DateTimeOffset(2025, 1, 1, 12, 0, 0, TimeSpan.Zero); 720var startedAt = new DateTimeOffset(2026, 8, 5, 12, 34, 56, TimeSpan.Zero); 746var startedAt = new DateTimeOffset(2026, 7, 26, 12, 34, 56, TimeSpan.Zero); 876var startedAt = new DateTimeOffset(2026, 8, 5, 12, 34, 56, TimeSpan.Zero); 1189var historicalRunTime = new DateTimeOffset(2026, 7, 20, 12, 34, 56, TimeSpan.Zero);
Model\SqliteResourceRepositoryTests.cs (2)
48using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); 72using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
ResourceOutgoingPeerResolverTests.cs (3)
282Assert.Equal(TimeSpan.FromMilliseconds(500), CallbackThrottler.DefaultMinExecuteInterval); 349var elapsed = Stopwatch.GetElapsedTime(startTimestamp, endTimestamp); 350Assert.True(elapsed >= CallbackThrottler.DefaultMinExecuteInterval - TimeSpan.FromMilliseconds(50), $"Callbacks executed too quickly: {elapsed}.");
TelemetryApiServiceTests.cs (2)
25var repository = CreateRepository(subscriptionMinExecuteInterval: TimeSpan.Zero); 46var repository = CreateRepository(subscriptionMinExecuteInterval: TimeSpan.Zero);
TelemetryRepositoryTests\LogTests.cs (2)
959var minExecuteInterval = CallbackThrottler.DefaultMinExecuteInterval; 1027var elapsed = stopwatch.Elapsed;
TelemetryRepositoryTests\MetricsTests.cs (5)
2007DataPointInterval = TimeSpan.FromSeconds(1) 2031var cursors = MetricInstrumentDataCache.CreateCursors(initialInstrument, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1)); 2073DataPointInterval = TimeSpan.FromMinutes(1), 2128DataPointInterval = TimeSpan.FromMinutes(1)
TelemetryRepositoryTests\TelemetryRepositoryTestBase.cs (1)
24TimeSpan? subscriptionMinExecuteInterval = null,
TelemetryRepositoryTests\TelemetryRepositoryTests.cs (12)
155minExecuteInterval: TimeSpan.FromMilliseconds(100)); 192minExecuteInterval: TimeSpan.FromMilliseconds(100)); 387using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 505using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 806using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2)); 881using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2)); 912using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2)); 971using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 1062using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 1145using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 1248using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 1345using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
TelemetryRepositoryTests\TraceTests.cs (5)
184Assert.Equal(TimeSpan.FromMinutes(5), summary.Duration); 232Assert.Equal(TimeSpan.FromMinutes(5), emptyPage.MaxDuration); 1873Assert.Equal(TimeSpan.FromMilliseconds(50), traces.MaxDuration); 1878Assert.Equal(TimeSpan.FromMilliseconds(40), trace.Duration); 4748Assert.Equal(TimeSpan.FromMinutes(1), summary.Duration);
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
tests\Shared\Telemetry\InMemoryTelemetryRepository.cs (5)
38internal TimeSpan _subscriptionMinExecuteInterval = CallbackThrottler.DefaultMinExecuteInterval; 733MaxDuration = TimeSpan.Zero 756var maxDuration = default(TimeSpan); 782var duration = trace.Duration;
tests\Shared\Telemetry\TelemetryTestHelpers.cs (2)
257TimeSpan? subscriptionMinExecuteInterval = null, 308var timeSinceEpoch = dateTime.ToUniversalTime() - unixEpoch;
tests\Shared\TestCertificateLoader.cs (2)
12private static readonly TimeSpan s_mutexTimeout = TimeSpan.FromSeconds(120);
Aspire.Deployment.EndToEnd.Tests (777)
AcaCompactNamingDeploymentTests.cs (12)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 83var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 146await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 147await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 162await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 174var duration = DateTime.UtcNow - startTime; 237var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 294await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 295await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 308await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 318var duration = DateTime.UtcNow - startTime;
AcaCompactNamingUpgradeDeploymentTests.cs (20)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(60); 81var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 150}, timeout: TimeSpan.FromMinutes(2), description: "language prompt, template version prompt, agent init prompt, or init success prompt"); 177}, timeout: TimeSpan.FromMinutes(2), description: "template version prompt, agent init prompt, or init success prompt"); 199}, timeout: TimeSpan.FromMinutes(2), description: "agent init prompt or init success prompt"); 215await auto.WaitUntilTextAsync("(based on NuGet.config)", timeout: TimeSpan.FromSeconds(60)); 217await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(180)); 256await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 257await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 265await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 315await auto.WaitUntilTextAsync("Perform updates?", timeout: TimeSpan.FromMinutes(2)); 317await auto.WaitUntilTextAsync("NuGet.config file?", timeout: TimeSpan.FromMinutes(2)); 319await auto.WaitUntilTextAsync("Apply these changes", timeout: TimeSpan.FromMinutes(2)); 321await auto.WaitUntilTextAsync("Update successful", timeout: TimeSpan.FromMinutes(2)); 322await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 341await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 342await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 356await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 368var duration = DateTime.UtcNow - startTime;
AcaCustomRegistryDeploymentTests.cs (9)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 70var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 141await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(35)); 142await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 166await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 184await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 192var duration = DateTime.UtcNow - startTime; 205var duration = DateTime.UtcNow - startTime;
AcaDeploymentErrorOutputTests.cs (7)
21private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 73var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 124await auto.WaitUntilTextAsync(ConsoleActivityLoggerStrings.PipelineFailed, timeout: TimeSpan.FromMinutes(30)); 125await auto.WaitForAnyPromptAsync(counter, TimeSpan.FromMinutes(2)); 155var duration = DateTime.UtcNow - startTime; 160var duration = DateTime.UtcNow - startTime;
AcaExistingRegistryDeploymentTests.cs (12)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 82var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 95await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 99await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 103await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 176await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(35)); 177await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 200await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 216await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 224var duration = DateTime.UtcNow - startTime; 237var duration = DateTime.UtcNow - startTime;
AcaManagedRedisDeploymentTests.cs (13)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 70var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 83await auto.RunCommandAsync("az provider register --namespace Microsoft.Cache --wait", counter, TimeSpan.FromMinutes(5)); 100await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 106await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromSeconds(180)); 114TimeSpan.FromSeconds(120)); 176await auto.WaitForPipelineSuccessAsync(TimeSpan.FromMinutes(35)); 178await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 202TimeSpan.FromMinutes(5)); 220TimeSpan.FromMinutes(5)); 227var duration = DateTime.UtcNow - startTime; 241var duration = DateTime.UtcNow - startTime;
AcaStarterDeploymentTests.cs (8)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 71var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 143await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 144await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 169await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 177var duration = DateTime.UtcNow - startTime; 191var duration = DateTime.UtcNow - startTime;
AcrPurgeTaskDeploymentTests.cs (14)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(30); 70var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 102await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(180)); 140await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 141await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 156await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 178await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 179await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 193await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 202await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 221await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 229var duration = DateTime.UtcNow - startTime; 242var duration = DateTime.UtcNow - startTime;
AksAzureKubernetesEnvironmentCertManagerDeploymentTests.cs (18)
29private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(75); 84var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 199await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(40)); 200await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 207await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 212await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 220await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 233await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 240await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 254await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(16)); 269await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(11)); 292await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 306await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(4)); 318await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(20)); 319await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 329var duration = DateTime.UtcNow - startTime; 342var duration = DateTime.UtcNow - startTime;
AksAzureKubernetesEnvironmentCertManagerTypeScriptDeploymentTests.cs (20)
32private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(75); 86var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 116await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(180)); 213await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(40)); 214await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 221await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 226await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 234await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 244await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 251await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 262await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 272await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(16)); 285await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(11)); 306await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 322await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(4)); 334await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(20)); 335await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 345var duration = DateTime.UtcNow - startTime; 358var duration = DateTime.UtcNow - startTime;
AksAzureKubernetesEnvironmentGatewayDeploymentTests.cs (17)
23private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(60); 74var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 198await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(35)); 199await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 206await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 213await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 217await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 224await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 236await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(16)); 252await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(4)); 259await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 263await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 273await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 277await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 288var duration = DateTime.UtcNow - startTime; 301var duration = DateTime.UtcNow - startTime;
AksBlazorRedisDeploymentTests.cs (16)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 70var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 145await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 146await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 153await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 159await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 164await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 170await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 178await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 183await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 188await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 196await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 201await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 213var duration = DateTime.UtcNow - startTime; 227var duration = DateTime.UtcNow - startTime;
AksMultipleNodePoolsDeploymentTests.cs (16)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 70var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 150await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 151await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 158await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 164await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 172await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 178await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 184await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 196await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 202await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 207await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 212await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 223var duration = DateTime.UtcNow - startTime; 237var duration = DateTime.UtcNow - startTime;
AksPersistentVolumeDeploymentTests.cs (18)
14private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(60); 60var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 89TimeSpan.FromMinutes(5)); 109TimeSpan.FromMinutes(2)); 113TimeSpan.FromMinutes(2)); 119TimeSpan.FromMinutes(2)); 149TimeSpan.FromMinutes(11)); 153TimeSpan.FromMinutes(6)); 185var duration = DateTime.UtcNow - startTime; 194var duration = DateTime.UtcNow - startTime; 331TimeSpan.FromMinutes(2)); 342TimeSpan.FromMinutes(6)); 346TimeSpan.FromMinutes(6)); 382await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 383await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 390await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(30)); 431TimeSpan.FromMinutes(3));
AksStarterDeploymentTests.cs (29)
16private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 78var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 93await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 99await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 105await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 113await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 128await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(20)); 135await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 141await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 147await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 153await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 220await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 232await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 240await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 251await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(10)); 257await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 265await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 274await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(12)); 281await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 287await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 293await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 300await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 303await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 309await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 312await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 318await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 330var duration = DateTime.UtcNow - startTime; 349var duration = DateTime.UtcNow - startTime;
AksStarterWithRedisHelmDeploymentTests.cs (32)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 80var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 95await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 101await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 107await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 115await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 129await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(20)); 136await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 142await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 148await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 154await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 220await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 232await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 240await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 251await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(10)); 257await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 265await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 282await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(12)); 291await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(16)); 297await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 303await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 309await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 315await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 321await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 324await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 330await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 333await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 342await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 348await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 360var duration = DateTime.UtcNow - startTime; 379var duration = DateTime.UtcNow - startTime;
AksVnetInfraDeploymentTests.cs (10)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 65var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 138await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 139await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 145await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 151await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 158await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 163await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 175var duration = DateTime.UtcNow - startTime;
AksVnetWithAzureResourcesDeploymentTests.cs (20)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 70var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 114await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 119await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 237await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 238await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 245await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 251await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 256await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 262await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 269await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 276await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 282await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 287await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 293await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 299await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 304await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 316var duration = DateTime.UtcNow - startTime; 330var duration = DateTime.UtcNow - startTime;
AksWithAzureResourcesDeploymentTests.cs (19)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 70var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 111await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 117await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 225await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 226await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 233await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 239await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 244await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 251await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 257await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 265await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 270await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 275await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 280await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 285await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 297var duration = DateTime.UtcNow - startTime; 311var duration = DateTime.UtcNow - startTime;
AksWithHelmChartDeploymentTests.cs (20)
24private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 75var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 156await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 157await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 164await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 170await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 174await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 185await auto.WaitUntilTextAsync("VERIFY_OK", timeout: TimeSpan.FromMinutes(3)); 186await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 192await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 198await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 202await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 211await auto.WaitUntilTextAsync("VERIFY_OK", timeout: TimeSpan.FromSeconds(120)); 212await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 216await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 229await auto.WaitUntilTextAsync("VERIFY_OK", timeout: TimeSpan.FromMinutes(2)); 230await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 238var duration = DateTime.UtcNow - startTime; 251var duration = DateTime.UtcNow - startTime;
AppServicePythonDeploymentTests.cs (9)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 72var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 106await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(180)); 145await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 146await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 171await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 179var duration = DateTime.UtcNow - startTime; 193var duration = DateTime.UtcNow - startTime;
AppServiceReactDeploymentTests.cs (12)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(85); 72var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 164await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 165await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 198await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 199await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 210await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(7)); 222var duration = DateTime.UtcNow - startTime; 236var duration = DateTime.UtcNow - startTime; 374await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 410await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3));
AppServiceStoragePrivateEndpointDeploymentTests.cs (9)
15private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(55); 64var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 97await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 212await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(35)); 213await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 219TimeSpan.FromMinutes(4)); 225TimeSpan.FromMinutes(8)); 231var duration = DateTime.UtcNow - startTime;
AzureAppConfigDeploymentTests.cs (8)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(30); 66var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 87await auto.WaitUntilTextAsync("Select an integration to add:", timeout: TimeSpan.FromSeconds(60)); 132await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(20)); 133await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 139await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 151var duration = DateTime.UtcNow - startTime;
AzureContainerRegistryDeploymentTests.cs (7)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(30); 66var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 115await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(20)); 116await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 122await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 134var duration = DateTime.UtcNow - startTime;
AzureEventHubsDeploymentTests.cs (8)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(30); 66var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 87await auto.WaitUntilTextAsync("Select an integration to add:", timeout: TimeSpan.FromSeconds(60)); 132await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(20)); 133await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 139await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 151var duration = DateTime.UtcNow - startTime;
AzureKeyVaultDeploymentTests.cs (8)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(30); 66var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 87await auto.WaitUntilTextAsync("Select an integration to add:", timeout: TimeSpan.FromSeconds(60)); 132await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(20)); 133await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 139await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 151var duration = DateTime.UtcNow - startTime;
AzureLogAnalyticsDeploymentTests.cs (7)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(30); 66var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 115await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(20)); 116await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 122await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 134var duration = DateTime.UtcNow - startTime;
AzureResourceScopeDeploymentTests.cs (8)
15private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 69var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 84await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(10)); 127await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(25)); 128await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 135await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 145var duration = DateTime.UtcNow - startTime;
AzureRoleAssignmentRunModeTests.cs (10)
28private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(30); 74var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 170await auto.RunCommandAsync("aspire start --non-interactive --format Json", counter, TimeSpan.FromMinutes(20)); 177await auto.RunCommandAsync("aspire wait storage-roles --status up --timeout 1500 --non-interactive", counter, TimeSpan.FromMinutes(26)); 183await auto.RunCommandAsync("aspire wait storage --status up --timeout 1500 --non-interactive", counter, TimeSpan.FromMinutes(26)); 190await auto.RunCommandAsync($"az deployment group show --subscription {subscriptionId} --resource-group {resourceGroupName} --name storage-roles -o json > roles-deployment.json", counter, TimeSpan.FromMinutes(2)); 191await auto.RunCommandAsync($"az account show --subscription {subscriptionId} -o json > az-account.json", counter, TimeSpan.FromMinutes(1)); 194await auto.RunCommandAsync($"python3 validate-role-assignment.py roles-deployment.json az-account.json {requireServicePrincipal}", counter, TimeSpan.FromSeconds(30)); 196var duration = DateTime.UtcNow - startTime;
AzureServiceBusDeploymentTests.cs (8)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(30); 66var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 87await auto.WaitUntilTextAsync("Select an integration to add:", timeout: TimeSpan.FromSeconds(60)); 134await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(20)); 135await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 141await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 153var duration = DateTime.UtcNow - startTime;
AzureStorageDeploymentTests.cs (13)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(30); 77var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 98await auto.WaitUntilTextAsync("Select an integration to add:", timeout: TimeSpan.FromSeconds(60)); 148await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(20)); 149await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 155await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 167var duration = DateTime.UtcNow - startTime; 233var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 312await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(25)); 313await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 318await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 328var duration = DateTime.UtcNow - startTime;
AzureStorageRunModeTests.cs (12)
16private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(30); 62var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 153await auto.RunCommandAsync("aspire start --non-interactive --format Json", counter, TimeSpan.FromMinutes(20)); 158await auto.RunCommandAsync("aspire wait storage --status up --timeout 1500 --non-interactive", counter, TimeSpan.FromMinutes(26)); 161await auto.RunCommandAsync("aspire resource storage get-azure-resource --non-interactive > get-resource.json", counter, TimeSpan.FromMinutes(2)); 162await auto.RunCommandAsync("python3 validate-get-resource.py get-resource.json storage-resource-id.txt storage-deployment-id.txt", counter, TimeSpan.FromSeconds(30)); 165await auto.RunCommandAsync("az resource show --ids \"$(cat storage-resource-id.txt)\" --query \"properties.provisioningState\" -o tsv | grep '^Succeeded$'", counter, TimeSpan.FromMinutes(1)); 166await auto.RunCommandAsync("az resource show --ids \"$(cat storage-deployment-id.txt)\" --query \"properties.provisioningState\" -o tsv | grep '^Succeeded$'", counter, TimeSpan.FromMinutes(1)); 169await auto.RunCommandAsync("aspire resource azure-environment delete-azure-resources --non-interactive", counter, TimeSpan.FromMinutes(10)); 174await auto.RunCommandAsync($"az group exists --subscription {subscriptionId} --name {resourceGroupName} -o tsv | grep '^false$'", counter, TimeSpan.FromSeconds(30)); 176var duration = DateTime.UtcNow - startTime;
FoundryHostedAgentDeploymentTests.cs (10)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 72var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 221await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 225await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 275await auto.WaitUntilTextAsync(ConsoleActivityLoggerStrings.PipelineSucceeded, timeout: TimeSpan.FromMinutes(35)); 276await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 289await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 297var duration = DateTime.UtcNow - startTime; 311var duration = DateTime.UtcNow - startTime;
FrontDoorDeploymentTests.cs (10)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 70var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 102await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromMinutes(3)); 107await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromMinutes(3)); 151await auto.WaitUntilTextAsync(ConsoleActivityLoggerStrings.PipelineSucceeded, timeout: TimeSpan.FromMinutes(30)); 152await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 192await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(15)); 200var duration = DateTime.UtcNow - startTime; 213var duration = DateTime.UtcNow - startTime;
Helpers\DeploymentE2EAutomatorHelpers.cs (8)
22await auto.PrepareBashEnvironmentAsync(workspace.WorkspaceRoot.FullName, counter, TimeSpan.FromSeconds(10)); 59TimeSpan.FromSeconds(300)); 66TimeSpan.FromSeconds(300)); 77TimeSpan.FromSeconds(120)); 85TimeSpan.FromSeconds(300)); 168TimeSpan? timeout = null) 170timeout ??= TimeSpan.FromMinutes(5); 174await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2));
Helpers\DeploymentE2ETestHelpers.cs (1)
162using var timeout = new CancellationTokenSource(TimeSpan.FromMinutes(2));
Helpers\DeploymentReporter.cs (1)
25TimeSpan duration)
KubernetesGatewayTlsDeploymentTests.cs (32)
23private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(60); 86var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 102await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 109await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 113await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 119await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 125await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 130await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 151await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(20)); 156await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 171await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(10)); 182await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 196await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 204await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 213await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 238await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 242await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(15)); 331await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 346await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(15)); 347await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 355await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 368await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 376await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 387await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(12)); 400await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 406await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 410await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 418await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 422await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 434var duration = DateTime.UtcNow - startTime; 452var duration = DateTime.UtcNow - startTime;
KubernetesHelmChartDeploymentTests.cs (24)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(45); 81var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 93await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 98await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 103await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 107await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 121await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(20)); 126await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 130await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 199await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 212await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(15)); 213await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 220await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 235await auto.WaitUntilTextAsync("VERIFY_OK", timeout: TimeSpan.FromMinutes(3)); 236await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 241await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 247await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 251await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 260await auto.WaitUntilTextAsync("VERIFY_OK", timeout: TimeSpan.FromSeconds(60)); 261await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 265await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 277var duration = DateTime.UtcNow - startTime; 295var duration = DateTime.UtcNow - startTime;
NspStorageKeyVaultDeploymentTests.cs (10)
18private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 69var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 119await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 125await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 264await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 265await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 304await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(8)); 312var duration = DateTime.UtcNow - startTime; 325var duration = DateTime.UtcNow - startTime;
PythonFastApiDeploymentTests.cs (9)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 72var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 107await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(180)); 148await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 149await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 173await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 181var duration = DateTime.UtcNow - startTime; 195var duration = DateTime.UtcNow - startTime;
RadiusAzureResourcesDeploymentTests.cs (6)
39using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(8)); 51var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 65await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 69await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 130timeout: TimeSpan.FromMinutes(3), 132await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30));
RadiusStarterDeploymentTests.cs (43)
30private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(55); 100var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 164await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 207await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 213await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 218await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 223await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 232await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 249await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(20)); 254await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 260await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 265await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 278await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(10)); 291await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 296await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 312await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 405await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 414await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 422await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 436await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 448timeout: TimeSpan.FromSeconds(30), 450await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 455await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(3)); 473await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(17)); 489await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 498await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 502await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 508await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(6)); 516await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 526await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 529await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 552await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 555await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 560await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 569await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(30)); 574await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 579await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 584await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(10)); 592var duration = DateTime.UtcNow - startTime; 611var duration = DateTime.UtcNow - startTime; 650using var waitCts = new CancellationTokenSource(TimeSpan.FromMinutes(2)); 666using var killCts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
tests\Shared\Hex1bAutomatorTestHelpers.cs (47)
24TimeSpan? timeout = null) 26var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 53TimeSpan? timeout = null, 54TimeSpan? retryInterval = null) 61var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(30); 62var effectiveRetryInterval = retryInterval ?? TimeSpan.FromSeconds(5); 76var remaining = effectiveTimeout - stopwatch.Elapsed; 77if (remaining <= TimeSpan.Zero) 82var waitThisAttempt = remaining < effectiveRetryInterval ? remaining : effectiveRetryInterval; 118var promptGrace = TimeSpan.FromSeconds(1); 140if (remaining <= TimeSpan.Zero) 145var delayBeforeRetry = remaining < effectiveRetryInterval ? remaining : effectiveRetryInterval; 146if (delayBeforeRetry > TimeSpan.FromMilliseconds(1)) 225TimeSpan? timeout = null) 227var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 270TimeSpan? timeout = null) 284TimeSpan? timeout = null) 286var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(30); 317TimeSpan.FromSeconds(30)); 344TimeSpan.FromSeconds(30)); 357TimeSpan.FromSeconds(30)); 366TimeSpan? timeout = null) 368var effectiveTimeout = timeout ?? TimeSpan.FromMinutes(2); 417TimeSpan? timeout = null) 419var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 484var templateTimeout = TimeSpan.FromSeconds(60); 505timeout: TimeSpan.FromSeconds(5), 515timeout: TimeSpan.FromSeconds(5), 526timeout: TimeSpan.FromSeconds(5), 538timeout: TimeSpan.FromSeconds(5), 552timeout: TimeSpan.FromSeconds(10), 563timeout: TimeSpan.FromSeconds(10), 613timeout: TimeSpan.FromSeconds(10), 631timeout: TimeSpan.FromSeconds(10), 700}, timeout: TimeSpan.FromMinutes(2), description: "NuGet.config prompt, URLs prompt, agent init prompt, or init completion"); 728TimeSpan? timeout = null) 730var effectiveTimeout = timeout ?? TimeSpan.FromMinutes(5);
tests\Shared\Hex1bTestHelpers.cs (33)
158TimeSpan? timeout = null) 160var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 181TimeSpan? timeout = null) 183var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 212TimeSpan? timeout = null) 214var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 239}, TimeSpan.FromSeconds(1)); 257}, TimeSpan.FromSeconds(1)); 273TimeSpan? timeout = null) 279.WaitUntil(s => agentInitPrompt.Search(s).Count > 0, timeout ?? TimeSpan.FromSeconds(120)) 298TimeSpan? timeout = null) 300var effectiveTimeout = timeout ?? TimeSpan.FromSeconds(500); 340}, TimeSpan.FromSeconds(1)); 364var templateTimeout = TimeSpan.FromSeconds(60); 399.WaitUntil(s => jsReactSelected.Search(s).Count > 0, TimeSpan.FromSeconds(5)) 408.WaitUntil(s => expressReactSelected.Search(s).Count > 0, TimeSpan.FromSeconds(5)) 418.WaitUntil(s => pythonReactSelected.Search(s).Count > 0, TimeSpan.FromSeconds(5)) 425.WaitUntil(s => waitingForAppHostLanguagePrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 432.WaitUntil(s => waitingForAppHostLanguagePrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 440.WaitUntil(s => waitingForAppHostLanguagePrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 447builder.WaitUntil(s => waitingForProjectNamePrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 452builder.WaitUntil(s => waitingForOutputPathPrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 456builder.WaitUntil(s => waitingForUrlsPrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 464builder.WaitUntil(s => waitingForRedisPrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)); 481builder.WaitUntil(s => waitingForTestPrompt.Search(s).Count > 0, TimeSpan.FromSeconds(10)) 510|| waitingForInitComplete.Search(s).Count > 0, TimeSpan.FromMinutes(2)) 512.WaitUntil(s => waitingForInitComplete.Search(s).Count > 0, TimeSpan.FromMinutes(2)) 514.WaitForSuccessPrompt(counter, TimeSpan.FromMinutes(2));
TypeScriptAzureContainerAppJobDeploymentTests.cs (10)
15private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(35); 61var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 66await auto.RunCommandAsync("aspire init --language typescript --non-interactive", counter, TimeSpan.FromMinutes(2)); 75await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(25)); 76await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 78await auto.RunCommandAsync(BuildJobVerificationCommand(resourceGroupName), counter, TimeSpan.FromMinutes(5)); 84var duration = DateTime.UtcNow - startTime; 93var duration = DateTime.UtcNow - startTime; 116await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromMinutes(3));
TypeScriptExpressDeploymentTests.cs (9)
16private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 68var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 102await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(180)); 139await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 140await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 162await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 170var duration = DateTime.UtcNow - startTime; 183var duration = DateTime.UtcNow - startTime;
TypeScriptJavaScriptHostingDeploymentTests.cs (10)
15private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 61var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 66await auto.RunCommandAsync("aspire init --language typescript --non-interactive", counter, TimeSpan.FromMinutes(2)); 77await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 78await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 80await auto.RunCommandAsync(BuildEndpointVerificationCommand(resourceGroupName), counter, TimeSpan.FromMinutes(10)); 86var duration = DateTime.UtcNow - startTime; 95var duration = DateTime.UtcNow - startTime; 118await auto.WaitForAspireAddCompletionAsync(counter, TimeSpan.FromMinutes(3));
TypeScriptVnetSqlServerInfraDeploymentTests.cs (13)
17private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 65var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 107}, timeout: TimeSpan.FromMinutes(2), description: "template version prompt, agent init prompt, or init success prompt"); 122}, timeout: TimeSpan.FromMinutes(2), description: "agent init prompt or init success prompt"); 145await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(180)); 159await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(180)); 173await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(180)); 221await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(25)); 222await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 230await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 238var duration = DateTime.UtcNow - startTime; 251var duration = DateTime.UtcNow - startTime;
VnetKeyVaultConnectivityDeploymentTests.cs (10)
16private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 67var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 109await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 188await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 189await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 196await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 216await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 224var duration = DateTime.UtcNow - startTime; 237var duration = DateTime.UtcNow - startTime;
VnetKeyVaultInfraDeploymentTests.cs (7)
16private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 64var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 141await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(25)); 142await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 150await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 162var duration = DateTime.UtcNow - startTime;
VnetSqlServerConnectivityDeploymentTests.cs (11)
21private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(50); 72var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 114await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 234await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 235await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 242await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 262await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 283await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(8)); 291var duration = DateTime.UtcNow - startTime; 304var duration = DateTime.UtcNow - startTime;
VnetSqlServerInfraDeploymentTests.cs (7)
16private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 64var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 142await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(25)); 143await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 151await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 163var duration = DateTime.UtcNow - startTime;
VnetStorageBlobConnectivityDeploymentTests.cs (10)
16private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 67var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 111await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(120)); 195await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(30)); 196await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 203await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 223await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(5)); 231var duration = DateTime.UtcNow - startTime; 244var duration = DateTime.UtcNow - startTime;
VnetStorageBlobInfraDeploymentTests.cs (7)
16private static readonly TimeSpan s_testTimeout = TimeSpan.FromMinutes(40); 64var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); 143await auto.WaitForPipelineSuccessAsync(timeout: TimeSpan.FromMinutes(25)); 144await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromMinutes(2)); 152await auto.WaitForSuccessPromptAsync(counter, TimeSpan.FromSeconds(60)); 164var duration = DateTime.UtcNow - startTime;
Aspire.EndToEnd.Tests (15)
tests\Shared\TemplatesTesting\AspireProject.cs (12)
116.WithTimeout(TimeSpan.FromMinutes(5)); 277var startupTimeoutTask = Task.Delay(TimeSpan.FromSeconds(AppStartupWaitTimeoutSecs), token); 300var allOutputCompleteTimeoutTask = Task.Delay(TimeSpan.FromSeconds(5), token); 368cts.CancelAfter(TimeSpan.FromSeconds(DashboardAvailabilityTimeoutSecs)); 386Delay = TimeSpan.FromSeconds(1) 476.WithTimeout(TimeSpan.FromSeconds(30)); 489.WithTimeout(TimeSpan.FromSeconds(30)); 517handler.PooledConnectionLifetime = TimeSpan.FromSeconds(5); 518handler.ConnectTimeout = TimeSpan.FromSeconds(5); 524options.AttemptTimeout.Timeout = TimeSpan.FromMinutes(2); 525options.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(5); // needs to be at least double the AttemptTimeout to pass options validation 526options.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 (102)
ApplicationModel\CommandsConfigurationExtensions.cs (1)
274buildTimeoutCts.CancelAfter(TimeSpan.FromMinutes(10));
Backchannel\AuxiliaryBackchannelRpcTarget.cs (4)
34private static readonly TimeSpan s_mcpDiscoveryTimeout = TimeSpan.FromSeconds(5); 511totalTimeout: TimeSpan.FromSeconds(3), 646using var timeoutCts = new CancellationTokenSource(TimeSpan.FromSeconds(request.TimeoutSeconds));
Backchannel\TerminalHostControlClient.cs (3)
28private static readonly TimeSpan s_defaultRetryDelay = TimeSpan.FromMilliseconds(150); 38TimeSpan totalTimeout,
Cli\CliOrphanDetector.cs (1)
61using var periodic = new PeriodicTimer(TimeSpan.FromSeconds(1), timeProvider);
Dashboard\DashboardServiceHost.cs (2)
249var elapsed = Stopwatch.GetElapsedTime(startTime); 251if (elapsed > TimeSpan.FromSeconds(2))
Dashboard\ResourcePublisher.cs (1)
64await foreach (var batch in channel.GetBatchesAsync(cancellationToken: linked.Token, minReadInterval: TimeSpan.FromMilliseconds(100)).ConfigureAwait(false))
Dcp\ContainerCreator.cs (2)
573await factory.UpdateWithEffectiveAddressInfo(serviceObjects, cancellationToken, TimeSpan.FromMinutes(1)).ConfigureAwait(false); 606TimeSpan.FromMinutes(10),
Dcp\DcpDependencyCheck.cs (1)
79processResult = await task.WaitAsync(TimeSpan.FromSeconds(_dcpOptions.DependencyCheckTimeout), cancellationToken).ConfigureAwait(false);
Dcp\DcpExecutor.cs (6)
45private static readonly TimeSpan s_disposeTimeout = TimeSpan.FromSeconds(10); 205await UpdateWithEffectiveAddressInfo(proxiedWithNoAddress, ct, TimeSpan.FromMinutes(1)).ConfigureAwait(false); 386Task IDcpObjectFactory.UpdateWithEffectiveAddressInfo(IEnumerable<Service> services, CancellationToken cancellationToken, TimeSpan? timeout) 472private async Task UpdateWithEffectiveAddressInfo(IEnumerable<Service> services, CancellationToken cancellationToken, TimeSpan? timeout = null) 553TimeSpan timeout,
Dcp\DcpHost.cs (3)
103bool requireContainerRuntimeInitialization = _dcpOptions.ContainerRuntimeInitializationTimeout > TimeSpan.Zero; 113await Task.Delay(TimeSpan.FromSeconds(2), timeoutCancellation.Token).ConfigureAwait(false); 596using var timer = new PeriodicTimer(TimeSpan.FromSeconds(5), _timeProvider);
Dcp\DcpOptions.cs (3)
104public TimeSpan ContainerRuntimeInitializationTimeout { get; set; } 106public TimeSpan ServiceStartupWatchTimeout { get; set; } = TimeSpan.FromSeconds(10);
Dcp\DcpPipelineBuilder.cs (5)
18Delay = TimeSpan.FromMilliseconds(200), 21MaxDelay = TimeSpan.FromSeconds(3), 34public static ResiliencePipeline BuildObjectWatchRetryPipeline(DcpOptions dcpOptions, ILogger logger, TimeSpan? timeout = null) 44MaxDelay = TimeSpan.FromSeconds(1), 72MaxDelay = TimeSpan.FromSeconds(30),
Dcp\DcpResourceWatcher.cs (6)
27private static readonly TimeSpan s_defaultTerminalLogFlushTimeout = TimeSpan.FromSeconds(5); 35private TimeSpan _terminalLogFlushTimeout = s_defaultTerminalLogFlushTimeout; 107internal TimeSpan TerminalLogFlushTimeout 112_terminalLogFlushTimeout = value > TimeSpan.Zero ? value : s_defaultTerminalLogFlushTimeout; 267using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
Dcp\IDcpObjectFactory.cs (2)
42Task UpdateWithEffectiveAddressInfo(IEnumerable<Service> services, CancellationToken cancellationToken, TimeSpan? timeout = null); 56TimeSpan timeout,
Dcp\KubernetesService.cs (12)
86private static readonly TimeSpan s_initialRetryDelay = TimeSpan.FromMilliseconds(100); 94public TimeSpan MaxRetryDuration { get; set; } = TimeSpan.FromSeconds(20); 95public TimeSpan KubernetesConfigInitializationTimeout { get; set; } = TimeSpan.FromSeconds(60); 301await foreach (var item in PeriodicRestartAsyncEnumerable.CreateAsync(innerWatchFactory, restartInterval: TimeSpan.FromMinutes(5), cancellationToken: cancellationToken).ConfigureAwait(false)) 426MaxDelay = TimeSpan.FromSeconds(1), 522TimeSpan retryDuration, 543MaxDelay = TimeSpan.FromSeconds(5), 566MaxDelay = TimeSpan.FromMilliseconds(dcpOptions.Value.KubernetesConfigReadRetryIntervalMilliseconds), 627await Task.Delay(TimeSpan.FromMilliseconds(dcpOptions.Value.KubernetesConfigReadRetryIntervalMilliseconds), cancellationToken).ConfigureAwait(false);
Dcp\Model\ModelCommon.cs (3)
383public TimeSpan? Interval { get; set; } 389public TimeSpan? Timeout { get; set; } 395public TimeSpan? InitialDelay { get; set; }
Dcp\Process\ProcessUtil.cs (2)
20private static readonly TimeSpan s_processExitTimeout = TimeSpan.FromSeconds(5);
Devcontainers\DevcontainerSettingsWriter.cs (2)
24private static readonly TimeSpan s_portForwardLogDelay = TimeSpan.FromSeconds(5);
Diagnostics\ProfilingTelemetry.cs (2)
749return new DateTimeOffset(Process.GetCurrentProcess().StartTime.ToUniversalTime(), TimeSpan.Zero); 814public void AddKubernetesApiRetry(int attemptNumber, TimeSpan retryDelay, Exception? exception)
DistributedApplication.cs (3)
276var timeout = TimeSpan.FromSeconds(30); 280timeout = TimeSpan.FromSeconds(timeoutSeconds);
ExternalServiceBuilderExtensions.cs (2)
312private static readonly TimeSpan s_defaultHttpTimeout = TimeSpan.FromSeconds(10);
Health\ResourceHealthCheckService.cs (9)
19internal TimeSpan HealthyHealthCheckInterval { get; set; } = TimeSpan.FromSeconds(30); 20internal TimeSpan NonHealthyHealthCheckStepInterval { get; set; } = TimeSpan.FromSeconds(1); 148if (lastDelayInterrupted && TimeSpan.FromSeconds(1) - timeProvider.GetElapsedTime(lastHealthCheckTimestamp) is { Ticks: > 0 } delay) 168report = new HealthReport(registrationKeysToCheck.ToDictionary(k => k, k => new HealthReportEntry(HealthStatus.Unhealthy, "Error calling HealthCheckService.", TimeSpan.Zero, ex, data: null)), TimeSpan.Zero); 224var delayInterval = nonHealthyReportCount == 0 366internal async Task<bool> DelayAsync(ResourceEvent? currentEvent, TimeSpan delay, CancellationToken cancellationToken)
Lifecycle\TerminalHostOrphanCleanupService.cs (4)
17private static readonly TimeSpan s_shutdownCleanupTimeout = TimeSpan.FromSeconds(2); 35internal static TimeSpan InvalidMetadataRetentionPeriod { get; } = TimeSpan.FromDays(7);
Pipelines\DistributedApplicationPipeline.cs (2)
194waitCts.CancelAfter(TimeSpan.FromMinutes(5)); 200await Task.Delay(TimeSpan.FromSeconds(2), timeProvider, waitCts.Token).ConfigureAwait(false);
src\Shared\ChannelExtensions.cs (3)
27TimeSpan? minReadInterval = null, 40var s = lastRead.Value.Add(minReadInterval.Value) - DateTime.UtcNow; 41if (s > TimeSpan.Zero)
src\Shared\ContainerRuntimeDetector.cs (2)
89private static readonly TimeSpan s_processTimeout = TimeSpan.FromSeconds(10);
src\Shared\ProcessSignaler.cs (2)
25public static void RequestGracefulShutdownWithRuntimeStartTime(int pid, DateTimeOffset expectedStartTime, TimeSpan tolerance, ILogger logger) 130public static Process? TryGetRunningProcessWithRuntimeStartTime(int pid, DateTimeOffset expectedStartTime, TimeSpan tolerance, ILogger logger)
src\Shared\ProcessStartTimeHelper.cs (9)
26public static readonly TimeSpan LegacyStartTimeMatchTolerance = TimeSpan.FromSeconds(1); 37public static readonly TimeSpan StableStartTimeMatchTolerance = TimeSpan.FromMilliseconds(20); 144TimeSpan? tolerance = null, 160TimeSpan? tolerance, 233public static bool IsProcessRunningWithRuntimeStartTime(int pid, long expectedStartTimeUnixSeconds, TimeSpan? tolerance = null) 281public static bool AreClose(long expectedStartTimeUnixSeconds, long actualStartTimeUnixSeconds, TimeSpan? tolerance = null) 296public static bool AreCloseMilliseconds(long expectedStartTimeUnixMilliseconds, long actualStartTimeUnixMilliseconds, TimeSpan? tolerance = null)
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 (3)
20private static readonly TimeSpan s_checkInterval = TimeSpan.FromDays(2); 91var intervalSinceLastCheck = now - checkDate;
Aspire.Hosting.Azure (29)
AcrLoginService.cs (5)
26private static readonly TimeSpan s_loginRetryDelay = TimeSpan.FromSeconds(2); 27private static readonly TimeSpan s_maxLoginRetryDuration = TimeSpan.FromMinutes(1); 149httpClient.Timeout = TimeSpan.FromSeconds(30);
AzureDeploymentOperationDetails.cs (1)
49TimeSpan? Duration,
AzureProvisioningController.cs (2)
145internal TimeSpan DriftCheckInterval { get; set; } = TimeSpan.FromSeconds(30);
Provisioning\Internal\DefaultArmClientProvider.cs (8)
28private static readonly TimeSpan s_keyVaultPurgePollInterval = TimeSpan.FromSeconds(5); 29private static readonly TimeSpan s_keyVaultPurgeTimeout = TimeSpan.FromMinutes(10); 30private static readonly TimeSpan s_keyVaultDeletePollInterval = TimeSpan.FromSeconds(5); 31private static readonly TimeSpan s_keyVaultDeleteTimeout = TimeSpan.FromMinutes(1);
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 (7)
54? TimeSpan.FromSeconds(timeoutSeconds) 55: (TimeSpan?)null; 82private static AzureCliCredentialOptions CreateAzureCliOptions(string? tenantId, TimeSpan? processTimeout) 92private static AzurePowerShellCredentialOptions CreateAzurePowerShellOptions(string? tenantId, TimeSpan? processTimeout) 102private static VisualStudioCredentialOptions CreateVisualStudioOptions(string? tenantId, TimeSpan? processTimeout) 112private static AzureDeveloperCliCredentialOptions CreateAzureDeveloperCliOptions(string? tenantId, TimeSpan? processTimeout) 122private static DefaultAzureCredential CreateDefaultAzureCredential(string? tenantId, TimeSpan? processTimeout)
Provisioning\Provisioners\BicepProvisioner.cs (2)
48private static readonly TimeSpan s_deploymentOperationPollingInterval = TimeSpan.FromSeconds(2);
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (2)
20private static readonly TimeSpan s_processExitTimeout = TimeSpan.FromSeconds(5);
Aspire.Hosting.Azure.ContainerRegistry (6)
AzureContainerRegistryExtensions.cs (6)
158TimeSpan? ago = null, 183var purgeAgo = FormatAgo(ago ?? TimeSpan.Zero); 316/// Formats a <see cref="TimeSpan"/> into a Go-style duration string compatible with <c>acr purge --ago</c>. 326private static string FormatAgo(TimeSpan ago) 328if (ago.TotalMinutes < 1 && ago != TimeSpan.Zero) 333if (ago == TimeSpan.Zero)
Aspire.Hosting.Azure.Kubernetes (6)
AzureKubernetesEnvironmentResource.AksPipeline.cs (4)
388kubeConfigPath, context.Logger, TimeSpan.FromMinutes(10), 504TimeSpan timeout, 508var pollInterval = TimeSpan.FromSeconds(10);
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (2)
20private static readonly TimeSpan s_processExitTimeout = TimeSpan.FromSeconds(5);
Aspire.Hosting.Azure.Kusto (2)
AzureKustoEmulatorResiliencePipelines.cs (1)
21Delay = TimeSpan.FromMilliseconds(100),
AzureKustoHealthCheck.cs (1)
75clientRequestProps.SetOption("client_timeout", TimeSpan.FromSeconds(30));
Aspire.Hosting.Azure.Kusto.Tests (19)
KustoFunctionalTests.cs (1)
35Delay = TimeSpan.FromSeconds(2),
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Azure.ServiceBus (7)
AzureServiceBusQueueResource.cs (3)
61public TimeSpan? DefaultMessageTimeToLive { get; set; } 67public TimeSpan? DuplicateDetectionHistoryTimeWindow { get; set; } 84public TimeSpan? LockDuration { get; set; }
AzureServiceBusSubscriptionResource.cs (2)
61public TimeSpan? DefaultMessageTimeToLive { get; set; } 78public TimeSpan? LockDuration { get; set; }
AzureServiceBusTopicResource.cs (2)
55public TimeSpan? DefaultMessageTimeToLive { get; set; } 61public TimeSpan? DuplicateDetectionHistoryTimeWindow { get; set; }
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
285RetentionInterval = TimeSpan.FromHours(1),
Aspire.Hosting.Azure.Tests (113)
AcrLoginServiceTests.cs (6)
150public override ITimer CreateTimer(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period) 184public override ITimer CreateTimer(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period) 203public bool Change(TimeSpan dueTime, TimeSpan period) => true;
AzureBicepProvisionerTests.cs (16)
62var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 494Duration: TimeSpan.FromSeconds(15), 574await allLookupsStarted.Task.WaitAsync(TimeSpan.FromSeconds(5), cancellationToken).ConfigureAwait(false); 632Duration: TimeSpan.FromSeconds(15), 1052Duration: TimeSpan.FromSeconds(15), 1063Duration: TimeSpan.FromSeconds(14), 1077Duration: TimeSpan.FromSeconds(5), 1750using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 1841public override ITimer CreateTimer(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period) 1850public bool Change(TimeSpan dueTime, TimeSpan period) => true; 1979public override ValueTask<Response<ArmDeploymentResource>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => 1985public override Response<ArmDeploymentResource> WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => 2079public override ValueTask<Response<ArmDeploymentResource>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => 2085public override Response<ArmDeploymentResource> WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) =>
AzureContainerRegistryTests.cs (3)
238.WithPurgeTask("0 1 * * *", ago: TimeSpan.FromDays(7), keep: 5); 252.WithPurgeTask("0 2 * * 0", filter: "app2:.*", ago: TimeSpan.FromDays(30), keep: 10); 317Assert.Throws<ArgumentOutOfRangeException>(() => acr.WithPurgeTask("0 1 * * *", ago: TimeSpan.Parse(ago)));
AzureCosmosDBEmulatorFunctionalTests.cs (6)
28var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 69var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 74Delay = TimeSpan.FromSeconds(10), 141var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 146Delay = TimeSpan.FromSeconds(10), 275var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10));
AzureDeployerTests.cs (10)
126await runTask.WaitAsync(TimeSpan.FromSeconds(10)); 771await runTask.WaitAsync(TimeSpan.FromSeconds(10)); 845await runTask.WaitAsync(TimeSpan.FromSeconds(10)); 1034await runTask.WaitAsync(TimeSpan.FromSeconds(10)); 1079await runTask.WaitAsync(TimeSpan.FromSeconds(10)); 1416await app.RunAsync().WaitAsync(TimeSpan.FromSeconds(5)); 1438await app.RunAsync().WaitAsync(TimeSpan.FromSeconds(5)); 1862await runTask.WaitAsync(TimeSpan.FromSeconds(10)); 1901using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 1905await Task.Delay(TimeSpan.FromSeconds(1));
AzureEnvironmentResourceExtensionsTests.cs (4)
2683var operationStartedAt = new DateTimeOffset(2026, 6, 22, 12, 34, 56, TimeSpan.Zero); 5122private static readonly TimeSpan s_testSynchronizationTimeout = TimeSpan.FromSeconds(30); 5166await Task.Delay(TimeSpan.FromMilliseconds(20), watchdog.Token).ConfigureAwait(false);
AzureEventHubsExtensionsTests.cs (4)
27var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 68var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 105await foreach (var partitionEvent in consumerClient.ReadEventsAsync(new ReadEventOptions { MaximumWaitTime = TimeSpan.FromSeconds(5) })) 120var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10));
AzureResourcePreparerTests.cs (1)
337await app.RunAsync().WaitAsync(TimeSpan.FromSeconds(30));
AzureServiceBusExtensionsTests.cs (27)
29.WithProperties(queue => queue.DefaultMessageTimeToLive = TimeSpan.FromSeconds(1)); 33topic.DefaultMessageTimeToLive = TimeSpan.FromSeconds(1); 76var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 119var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 213queue.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 214queue.DuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(20); 216queue.LockDuration = TimeSpan.FromMinutes(5); 225topic.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 226topic.DuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(20); 233sub.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 234sub.LockDuration = TimeSpan.FromMinutes(5); 273Assert.Equal(TimeSpan.FromMinutes(1), queue.DefaultMessageTimeToLive.Value); 274Assert.Equal(TimeSpan.FromSeconds(20), queue.DuplicateDetectionHistoryTimeWindow.Value); 276Assert.Equal(TimeSpan.FromMinutes(5), queue.LockDuration.Value); 283Assert.Equal(TimeSpan.FromMinutes(1), topic.DefaultMessageTimeToLive.Value); 284Assert.Equal(TimeSpan.FromSeconds(20), topic.DuplicateDetectionHistoryTimeWindow.Value); 290Assert.Equal(TimeSpan.FromMinutes(1), subscription.DefaultMessageTimeToLive.Value); 291Assert.Equal(TimeSpan.FromMinutes(5), subscription.LockDuration.Value); 321queue.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 322queue.DuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(20); 324queue.LockDuration = TimeSpan.FromMinutes(5); 333topic.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 334topic.DuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(20); 341sub.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 342sub.LockDuration = TimeSpan.FromMinutes(5); 461queue.DefaultMessageTimeToLive = TimeSpan.FromMinutes(1); 811var 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)
23var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 72var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 115var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 158var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 214var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 254var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
DefaultArmClientProviderTests.cs (19)
25private static readonly TimeSpan s_keyVaultPollInterval = TimeSpan.FromSeconds(5); 26private static readonly TimeSpan s_keyVaultDeleteTimeout = TimeSpan.FromMinutes(1); 27private static readonly TimeSpan s_keyVaultPurgeTimeout = TimeSpan.FromMinutes(10); 398=> _keyVaultDeletePollStarted.Task.WaitAsync(TimeSpan.FromSeconds(5)); 401=> _deletedKeyVaultPurgePollStarted.Task.WaitAsync(TimeSpan.FromSeconds(5)); 574await _nestedDeploymentOperationRequestsStarted.Task.WaitAsync(TimeSpan.FromSeconds(5)).ConfigureAwait(false); 753public override ITimer CreateTimer(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period) 767public async Task WaitForTimerAsync(TimeSpan dueTime) 782await timerCreatedTask.WaitAsync(TimeSpan.FromSeconds(5)).ConfigureAwait(false); 786public void FireTimer(TimeSpan dueTime) 805private sealed class ManualTimer(TimerCallback callback, object? state, TimeSpan dueTime) : ITimer 808private TimeSpan _dueTime = dueTime; 812public bool IsActiveFor(TimeSpan dueTime) 835public bool Change(TimeSpan dueTime, TimeSpan period)
FoundryExtensionsTests.cs (5)
74var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 332using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); 361using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); 402using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); 443using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
ProvisioningTestHelpers.cs (3)
821public override ValueTask<Response<T>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => new ValueTask<Response<T>>(Response.FromValue(Value, new MockResponse(200))); 823public override Response<T> WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => Response.FromValue(Value, new MockResponse(200)); 835public override ValueTask<Response> WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => ValueTask.FromResult<Response>(new MockResponse(200));
Aspire.Hosting.Blazor.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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Browsers (26)
BrowserEndpointDiscovery.cs (3)
27private static readonly TimeSpan s_probeHttpClientTimeout = Timeout.InfiniteTimeSpan; 30private static readonly TimeSpan s_probeTimeout = TimeSpan.FromSeconds(2);
BrowserLogsCdpConnection.cs (13)
40private static readonly TimeSpan s_closeTimeout = TimeSpan.FromSeconds(3); 41private static readonly TimeSpan s_commandTimeout = TimeSpan.FromSeconds(30); 45private static readonly TimeSpan s_screenshotCommandTimeout = TimeSpan.FromSeconds(30); 46private static readonly TimeSpan s_keepAliveInterval = TimeSpan.FromSeconds(15); 231TimeSpan? commandTimeout = null) 391void SetKeepAliveInterval(TimeSpan interval); 404public void SetKeepAliveInterval(TimeSpan interval) 445internal sealed class BrowserLogsWebSocketCdpTransport(WebSocket webSocket, TimeSpan closeTimeout) : IBrowserLogsCdpTransport 447private readonly TimeSpan _closeTimeout = closeTimeout;
BrowserLogsPipeBrowserProcessLauncher.cs (2)
16private static readonly TimeSpan s_processExitTimeout = TimeSpan.FromSeconds(5);
BrowserPageSession.cs (6)
23private static readonly TimeSpan s_connectionRecoveryDelay = TimeSpan.FromMilliseconds(200); 24private static readonly TimeSpan s_connectionRecoveryTimeout = TimeSpan.FromSeconds(5); 25private static readonly TimeSpan s_closeTargetTimeout = TimeSpan.FromSeconds(3);
IBrowserHost.cs (2)
86private static readonly TimeSpan s_releaseTimeout = TimeSpan.FromSeconds(60);
Aspire.Hosting.Browsers.Tests (60)
BrowserLogsBuilderExtensionsTests.cs (1)
774new DateTimeOffset(2026, 4, 27, 12, 0, 0, TimeSpan.Zero)))
BrowserLogsCdpConnectionTests.cs (7)
32Assert.Equal(TimeSpan.FromSeconds(15), connector.KeepAliveInterval); 481public TimeSpan? KeepAliveInterval { get; private set; } 483public void SetKeepAliveInterval(TimeSpan interval) 508public TimeSpan? KeepAliveInterval { get; private set; } 510public void SetKeepAliveInterval(TimeSpan interval) 540ClientSocket = WebSocket.CreateFromStream(clientStream, isServer: false, subProtocol: null, keepAliveInterval: TimeSpan.FromSeconds(15)); 541ServerSocket = WebSocket.CreateFromStream(serverStream, isServer: true, subProtocol: null, keepAliveInterval: TimeSpan.FromSeconds(15));
BrowserLogsSessionManagerTests.cs (2)
197await serverTask.WaitAsync(TimeSpan.FromSeconds(5)); 367await serverTask.WaitAsync(TimeSpan.FromSeconds(5));
BrowserPageSessionTests.cs (3)
216var timeProvider = new FakeTimeProvider(new DateTimeOffset(2026, 4, 26, 0, 0, 0, TimeSpan.Zero)); 279var timeProvider = new FakeTimeProvider(new DateTimeOffset(2026, 4, 26, 0, 0, 0, TimeSpan.Zero)); 320timeProvider.Advance(TimeSpan.FromSeconds(1));
ConsoleLoggingTestHelpers.cs (3)
11private static readonly TimeSpan s_defaultTimeout = TimeSpan.FromSeconds(30); 69return new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero);
src\Aspire.Hosting.Browsers\BrowserEndpointDiscovery.cs (3)
27private static readonly TimeSpan s_probeHttpClientTimeout = Timeout.InfiniteTimeSpan; 30private static readonly TimeSpan s_probeTimeout = TimeSpan.FromSeconds(2);
src\Aspire.Hosting.Browsers\BrowserLogsCdpConnection.cs (13)
40private static readonly TimeSpan s_closeTimeout = TimeSpan.FromSeconds(3); 41private static readonly TimeSpan s_commandTimeout = TimeSpan.FromSeconds(30); 45private static readonly TimeSpan s_screenshotCommandTimeout = TimeSpan.FromSeconds(30); 46private static readonly TimeSpan s_keepAliveInterval = TimeSpan.FromSeconds(15); 231TimeSpan? commandTimeout = null) 391void SetKeepAliveInterval(TimeSpan interval); 404public void SetKeepAliveInterval(TimeSpan interval) 445internal sealed class BrowserLogsWebSocketCdpTransport(WebSocket webSocket, TimeSpan closeTimeout) : IBrowserLogsCdpTransport 447private readonly TimeSpan _closeTimeout = closeTimeout;
src\Aspire.Hosting.Browsers\BrowserLogsPipeBrowserProcessLauncher.cs (2)
16private static readonly TimeSpan s_processExitTimeout = TimeSpan.FromSeconds(5);
src\Aspire.Hosting.Browsers\BrowserPageSession.cs (6)
23private static readonly TimeSpan s_connectionRecoveryDelay = TimeSpan.FromMilliseconds(200); 24private static readonly TimeSpan s_connectionRecoveryTimeout = TimeSpan.FromSeconds(5); 25private static readonly TimeSpan s_closeTargetTimeout = TimeSpan.FromSeconds(3);
src\Aspire.Hosting.Browsers\IBrowserHost.cs (2)
86private static readonly TimeSpan s_releaseTimeout = 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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.CodeGeneration.Go.Tests (3)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (3)
324TimeSpan expiry) 334TimeSpan? expiry = null) 734TimeSpan timeout,
Aspire.Hosting.CodeGeneration.Java.Tests (3)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (3)
324TimeSpan expiry) 334TimeSpan? expiry = null) 734TimeSpan timeout,
Aspire.Hosting.CodeGeneration.Python.Tests (3)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (3)
324TimeSpan expiry) 334TimeSpan? expiry = null) 734TimeSpan timeout,
Aspire.Hosting.CodeGeneration.Rust.Tests (3)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (3)
324TimeSpan expiry) 334TimeSpan? expiry = null) 734TimeSpan timeout,
Aspire.Hosting.CodeGeneration.TypeScript.Tests (3)
TestTypes\TestExtensions.cs (3)
324TimeSpan expiry) 334TimeSpan? expiry = null) 734TimeSpan timeout,
Aspire.Hosting.Containers.Tests (21)
DockerSocketBindMountTests.cs (1)
39using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
WithDockerfileTests.cs (2)
776private static async Task WaitForResourceAsync(DistributedApplication app, string resourceName, string resourceState, TimeSpan? timeout = null) 778await app.ResourceNotifications.WaitForResourceAsync(resourceName, resourceState).WaitAsync(timeout ?? TimeSpan.FromMinutes(3));
Aspire.Hosting.DevTunnels (2)
DevTunnelCliClient.cs (2)
14private readonly TimeSpan _cliRetryOnErrorDelay = TimeSpan.FromSeconds(2);
Aspire.Hosting.DevTunnels.Tests (19)
DevTunnelResourceBuilderExtensionsTests.cs (1)
594using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(2));
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Docker (2)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (2)
20private static readonly TimeSpan s_processExitTimeout = TimeSpan.FromSeconds(5);
Aspire.Hosting.Docker.Tests (1)
DockerComposePublisherTests.cs (1)
163await app.RunAsync().WaitAsync(TimeSpan.FromSeconds(60));
Aspire.Hosting.Dotnet.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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.DotnetTool.Tests (20)
DotnetToolFunctionalTests.cs.cs (2)
14var cts = new CancellationTokenSource(TimeSpan.FromMinutes(2)); 35var cts = new CancellationTokenSource(TimeSpan.FromMinutes(2));
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.EntityFrameworkCore (1)
EFCoreOperationExecutor.cs (1)
331await logTask.WaitAsync(TimeSpan.FromSeconds(5), _cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Foundry (8)
FoundryLocalService.cs (6)
17private static readonly TimeSpan s_serviceStartTimeout = TimeSpan.FromSeconds(30); 18private static readonly TimeSpan s_serviceStopTimeout = TimeSpan.FromSeconds(10); 99var stopTimeout = cancellationToken.IsCancellationRequested ? TimeSpan.FromSeconds(2) : s_serviceStopTimeout;
PromptAgent\AzurePromptAgentResource.cs (2)
37private static readonly TimeSpan s_projectEndpointReadinessDelay = TimeSpan.FromSeconds(5);
Aspire.Hosting.Foundry.Tests (19)
PromptAgentTests.cs (1)
114}).WaitAsync(TimeSpan.FromSeconds(10));
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Garnet (7)
GarnetBuilderExtensions.cs (7)
161var interval = (persistenceAnnotation.Interval ?? TimeSpan.FromSeconds(60)).TotalMilliseconds.ToString(CultureInfo.InvariantCulture); 194/// Use <see cref="WithPersistence(IResourceBuilder{GarnetResource}, TimeSpan?)"/> to adjust Garnet persistence configuration, e.g.: 232/// Use <see cref="WithPersistence(IResourceBuilder{GarnetResource}, TimeSpan?)"/> to adjust Garnet persistence configuration, e.g.: 283TimeSpan? interval, long keysChangedThreshold) 307TimeSpan? interval = null) 314private sealed class PersistenceAnnotation(TimeSpan? interval) : IResourceAnnotation 316public TimeSpan? Interval => interval;
Aspire.Hosting.Garnet.Tests (8)
AddGarnetTests.cs (2)
307.WithPersistence(TimeSpan.FromSeconds(10)); 324.WithPersistence(TimeSpan.FromSeconds(60));
GarnetFunctionalTests.cs (5)
23var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 61var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 63.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(3) }) 106var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 108.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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.JavaScript.Tests (21)
BunAppFixture.cs (2)
46using var startCts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 49using var readinessCts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
NodeAppFixture.cs (1)
41using 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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Kafka.Tests (23)
KafkaFunctionalTests.cs (5)
64var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 93.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<ProduceException<string, string>>() }) 122var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 180.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<ProduceException<string, string>>() }) 234.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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Kubernetes (1)
KubernetesEnvironmentResource.cs (1)
1667Delay = TimeSpan.FromSeconds(5),
Aspire.Hosting.Kubernetes.Tests (2)
KubernetesPublisherTests.cs (2)
1357context.EnvironmentVariables["DATETIMEOFFSET_VALUE"] = new DateTimeOffset(2024, 1, 2, 3, 4, 5, TimeSpan.Zero); 1358context.EnvironmentVariables["TIMESPAN_VALUE"] = TimeSpan.FromMinutes(90);
Aspire.Hosting.Maui (7)
Lifecycle\MauiBuildQueueEventSubscriber.cs (5)
38internal TimeSpan BuildTimeout { get; set; } = TimeSpan.FromMinutes(10); 81if (!await semaphore.WaitAsync(TimeSpan.Zero, CancellationToken.None).ConfigureAwait(false)) 289cts.CancelAfter(TimeSpan.FromMinutes(5)); 399using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
Utilities\MauiEnvironmentHelper.cs (2)
150var expiration = DateTimeOffset.UtcNow - TimeSpan.FromDays(1); 308var expiration = DateTimeOffset.UtcNow - TimeSpan.FromDays(1);
Aspire.Hosting.Maui.Tests (36)
MauiBuildQueueTests.cs (36)
64await eventTask.WaitAsync(TimeSpan.FromSeconds(5)); 103await task1.WaitAsync(TimeSpan.FromSeconds(5)); 107await task2.WaitAsync(TimeSpan.FromSeconds(5)); 122using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 140var result = await queuedSeen.Task.WaitAsync(TimeSpan.FromSeconds(5)); 145await task1.WaitAsync(TimeSpan.FromSeconds(5)); 147await task2.WaitAsync(TimeSpan.FromSeconds(5)); 156using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 174var result = await buildingSeen.Task.WaitAsync(TimeSpan.FromSeconds(5)); 178await eventTask.WaitAsync(TimeSpan.FromSeconds(5)); 207await Task.WhenAll(task1, task2).WaitAsync(TimeSpan.FromSeconds(5)); 248() => task2.WaitAsync(TimeSpan.FromSeconds(5))); 252await task1.WaitAsync(TimeSpan.FromSeconds(5)); 258await task3.WaitAsync(TimeSpan.FromSeconds(5)); 304await task1.WaitAsync(TimeSpan.FromSeconds(5)); 311var macTask = env.Subscriber.WaitForBuildStartedAsync(env.MacCatalyst, TimeSpan.FromSeconds(30)); 312var iosTask = env.Subscriber.WaitForBuildStartedAsync(env.IOSSimulator, TimeSpan.FromSeconds(30)); 320await task2.WaitAsync(TimeSpan.FromSeconds(5)); 324await task3.WaitAsync(TimeSpan.FromSeconds(5)); 329await task3.WaitAsync(TimeSpan.FromSeconds(5)); 333await task2.WaitAsync(TimeSpan.FromSeconds(5)); 359await parentTask.WaitAsync(TimeSpan.FromSeconds(2)); 362await task1.WaitAsync(TimeSpan.FromSeconds(5)); 535() => task2.WaitAsync(TimeSpan.FromSeconds(5))); 545await task1.WaitAsync(TimeSpan.FromSeconds(5)); 570() => eventTask.WaitAsync(TimeSpan.FromSeconds(5))); 578await exitedSeen.WaitAsync(TimeSpan.FromSeconds(5)); 627() => task1.WaitAsync(TimeSpan.FromSeconds(5))); 663await releaseTask.WaitAsync(TimeSpan.FromSeconds(5)); 697() => task2.WaitAsync(TimeSpan.FromSeconds(5))); 701await task1.WaitAsync(TimeSpan.FromSeconds(5)); 708await task3.WaitAsync(TimeSpan.FromSeconds(5)); 717env.Subscriber.BuildTimeout = TimeSpan.FromMilliseconds(100); 786using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 818public Task WaitForBuildStartedAsync(IResource resource, TimeSpan? timeout = null) 820return GetOrCreateStarted(resource.Name).Task.WaitAsync(timeout ?? TimeSpan.FromSeconds(30));
Aspire.Hosting.MongoDB.Tests (9)
MongoDbFunctionalTests.cs (9)
35var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 72var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 74.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1) }) 111var cts = new CancellationTokenSource(TimeSpan.FromMinutes(6)); 113.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1) }) 258var cts = new CancellationTokenSource(TimeSpan.FromMinutes(6)); 260.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 365var cts = new CancellationTokenSource(TimeSpan.FromMinutes(6)); 367.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) })
Aspire.Hosting.MySql.Tests (29)
MySqlFunctionalTests.cs (11)
72.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() }) 127.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 308.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() }) 403.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() }) 485.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<MySqlException>() }) 628var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 630.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 710var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 712.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 786var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 837var 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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Nats.Tests (3)
NatsFunctionalTests.cs (3)
70var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 113var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 330var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
Aspire.Hosting.OpenAI (4)
OpenAIExtensions.cs (1)
59return new OpenAIHealthCheck(httpFactory, resource, "OpenAIHealthCheck", TimeSpan.FromSeconds(5));
OpenAIHealthCheck.cs (3)
20private readonly TimeSpan _timeout; 33TimeSpan? timeout = null) 38_timeout = timeout ?? TimeSpan.FromSeconds(5);
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Oracle.Tests (8)
OracleFunctionalTests.cs (8)
34var cts = new CancellationTokenSource(TimeSpan.FromMinutes(15)); 83var cts = new CancellationTokenSource(TimeSpan.FromMinutes(15)); 90Delay = TimeSpan.FromSeconds(2) 257var cts = new CancellationTokenSource(TimeSpan.FromMinutes(15)); 264Delay = TimeSpan.FromSeconds(2) 355var cts = new CancellationTokenSource(TimeSpan.FromMinutes(15)); 362Delay = TimeSpan.FromSeconds(2) 448var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
Aspire.Hosting.PostgreSQL.Tests (33)
PostgresFunctionalTests.cs (15)
101var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 103.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<NpgsqlException>() }) 197var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 199.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<NpgsqlException>() }) 366var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 368.AddRetry(new() { MaxRetryAttempts = 3, Delay = TimeSpan.FromSeconds(2) }) 462var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 464.AddRetry(new() { MaxRetryAttempts = 3, Delay = TimeSpan.FromSeconds(2) }) 544var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 580await app.StopAsync(cts.Token).WaitAsync(TimeSpan.FromMinutes(1), cts.Token); 603var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 656var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 702var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 704.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 780var 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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Python.Tests (4)
AddPythonAppTests.cs (4)
113var timeout = TimeSpan.FromSeconds(PlatformDetection.IsRunningOnCI ? 180 : 45); 317var createVirtualEnvironmentProcessResult = createVirtualEnvironmentProcess!.WaitForExit(TimeSpan.FromMinutes(2)); 347var installRequirementsProcessResult = installRequirementsProcess!.WaitForExit(TimeSpan.FromMinutes(2));
Aspire.Hosting.Qdrant.Tests (5)
QdrantFunctionalTests.cs (5)
29var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 31.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<RpcException>() }) 94var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 96.AddRetry(new() { MaxRetryAttempts = 10, Delay = TimeSpan.FromSeconds(1), ShouldHandle = new PredicateBuilder().Handle<RpcException>() }) 259var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
Aspire.Hosting.RabbitMQ.Tests (19)
RabbitMQFunctionalTests.cs (1)
100var 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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.Hosting.Radius (15)
Publishing\SealedSecretApplyStep.cs (11)
36private static readonly TimeSpan s_pollInterval = TimeSpan.FromSeconds(2); 266TimeSpan timeout, 267TimeSpan interval, 300var remaining = RemainingBudget(deadline); 301if (remaining <= TimeSpan.Zero) 319TimeSpan remaining, 323if (remaining <= TimeSpan.Zero) 341private static TimeSpan RemainingBudget(DateTimeOffset deadline) => deadline - DateTimeOffset.UtcNow; 348TimeSpan timeout) => 366TimeSpan timeout) =>
Secrets\RadiusSecretStoreExtensions.cs (2)
275TimeSpan timeout) 284if (timeout <= TimeSpan.Zero || timeout.TotalMilliseconds > int.MaxValue)
Secrets\RadiusSecretStoreResource.cs (2)
59public TimeSpan MaterializationTimeout { get; internal set; } = TimeSpan.FromSeconds(120);
Aspire.Hosting.Radius.Tests (37)
Secrets\AddRadiusSecretStoreTests.cs (5)
338Assert.Throws<ArgumentOutOfRangeException>(() => store.WithMaterializationTimeout(TimeSpan.FromSeconds(seconds))); 349Assert.Throws<ArgumentOutOfRangeException>(() => store.WithMaterializationTimeout(TimeSpan.MaxValue)); 351store.WithMaterializationTimeout(TimeSpan.FromMilliseconds((double)int.MaxValue + 1))); 359var max = TimeSpan.FromMilliseconds(int.MaxValue);
Secrets\SealedSecretApplyStepTests.cs (31)
223deadline: DateTimeOffset.UtcNow + TimeSpan.FromSeconds(5), 224timeout: TimeSpan.FromSeconds(5), 225interval: TimeSpan.FromMilliseconds(1), 395deadline: DateTimeOffset.UtcNow + TimeSpan.FromSeconds(5), 396timeout: TimeSpan.FromSeconds(5), 397interval: TimeSpan.FromMilliseconds(1), 425deadline: DateTimeOffset.UtcNow + TimeSpan.FromSeconds(5), 426timeout: TimeSpan.FromSeconds(5), 427interval: TimeSpan.FromMilliseconds(1), 445deadline: DateTimeOffset.UtcNow + TimeSpan.FromMilliseconds(10), 446timeout: TimeSpan.FromMilliseconds(10), 447interval: TimeSpan.FromMilliseconds(1), 467deadline: DateTimeOffset.UtcNow + TimeSpan.FromSeconds(5), 468timeout: TimeSpan.FromSeconds(5), 469interval: TimeSpan.FromMilliseconds(1), 492deadline: DateTimeOffset.UtcNow + TimeSpan.FromMilliseconds(250), 493timeout: TimeSpan.FromMilliseconds(250), 494interval: TimeSpan.FromMilliseconds(1), 523deadline: DateTimeOffset.UtcNow + TimeSpan.FromMilliseconds(50), 524timeout: TimeSpan.FromMilliseconds(50), 525interval: TimeSpan.FromMilliseconds(1), 536Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(5)); 548deadline: DateTimeOffset.UtcNow + TimeSpan.FromSeconds(5), 549timeout: TimeSpan.FromSeconds(5), 550interval: TimeSpan.FromMilliseconds(1), 806remaining: TimeSpan.FromMilliseconds(50), 809"db-creds", "app", "db-creds", "apply", TimeSpan.FromMilliseconds(50)))); 814Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(5)); 832remaining: TimeSpan.FromSeconds(5), 835"db-creds", "app", "db-creds", "verify", TimeSpan.FromSeconds(5)))); 842"db-creds", "app", "db-creds", "verify", TimeSpan.FromSeconds(30));
Secrets\SecretStoreValidationTests.cs (1)
314.WithMaterializationTimeout(TimeSpan.FromSeconds(30));
Aspire.Hosting.Redis (6)
RedisBuilderExtensions.cs (6)
125var interval = (persistenceAnnotation.Interval ?? TimeSpan.FromSeconds(60)).TotalSeconds.ToString(CultureInfo.InvariantCulture); 439/// Use <see cref="WithPersistence(IResourceBuilder{RedisResource}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.: 472/// Use <see cref="WithPersistence(IResourceBuilder{RedisResource}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.: 521public static IResourceBuilder<RedisResource> WithPersistence(this IResourceBuilder<RedisResource> builder, TimeSpan? interval = null, long keysChangedThreshold = 1) 529private sealed class PersistenceAnnotation(TimeSpan? interval, long keysChangedThreshold) : IResourceAnnotation 531public TimeSpan? Interval => interval;
Aspire.Hosting.Redis.Tests (10)
AddRedisTests.cs (3)
649.WithPersistence(TimeSpan.FromSeconds(10), 2); 721.WithPersistence(TimeSpan.FromSeconds(60)); 904var args = await ArgumentEvaluator.GetArgumentListAsync(redis.Resource, app.Services).AsTask().WaitAsync(TimeSpan.FromSeconds(60));
RedisFunctionalTests.cs (7)
34var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 139var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 174var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 226var cts2 = new CancellationTokenSource(TimeSpan.FromSeconds(2)); 484var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 597.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 663var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
Aspire.Hosting.RemoteHost (19)
Ats\AtsMarshaller.cs (6)
91typeof(TimeSpan), 208if (type == typeof(TimeSpan)) 210return JsonValue.Create(((TimeSpan)value).TotalMilliseconds); 921if (underlyingType == typeof(TimeSpan)) 925return TimeSpan.FromMilliseconds(ms); 930return TimeSpan.Parse(str, System.Globalization.CultureInfo.InvariantCulture);
AtsCapabilityScanner.cs (1)
2541if (type == typeof(TimeSpan))
JsonRpcCallbackInvoker.cs (2)
14private static readonly TimeSpan s_callbackTimeout = TimeSpan.FromSeconds(60);
OrphanDetector.cs (1)
74using var periodic = new PeriodicTimer(TimeSpan.FromSeconds(1), TimeProvider.System);
src\Shared\ProcessStartTimeHelper.cs (9)
26public static readonly TimeSpan LegacyStartTimeMatchTolerance = TimeSpan.FromSeconds(1); 37public static readonly TimeSpan StableStartTimeMatchTolerance = TimeSpan.FromMilliseconds(20); 144TimeSpan? tolerance = null, 160TimeSpan? tolerance, 233public static bool IsProcessRunningWithRuntimeStartTime(int pid, long expectedStartTimeUnixSeconds, TimeSpan? tolerance = null) 281public static bool AreClose(long expectedStartTimeUnixSeconds, long actualStartTimeUnixSeconds, TimeSpan? tolerance = null) 296public static bool AreCloseMilliseconds(long expectedStartTimeUnixMilliseconds, long actualStartTimeUnixMilliseconds, TimeSpan? tolerance = null)
Aspire.Hosting.RemoteHost.Tests (10)
AtsMarshallerTests.cs (6)
177var result = marshaller.MarshalToJson(TimeSpan.FromSeconds(1.5)); 313var result = AtsMarshaller.ConvertPrimitive(value!, typeof(TimeSpan)); 315Assert.Equal(TimeSpan.FromMilliseconds(1500), result); 443[InlineData(typeof(TimeSpan))] 664var result = AtsMarshaller.ConvertPrimitive(value!, typeof(TimeSpan)); 666Assert.Equal(TimeSpan.FromHours(1.5), result);
JsonRpcAuthenticationTests.cs (2)
140var completedTask = await Task.WhenAny(client.Completion, Task.Delay(TimeSpan.FromSeconds(5))); 187using var timeoutCts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
OrphanDetectorTests.cs (2)
13private static readonly TimeSpan s_timeout = TimeSpan.FromSeconds(10);
Aspire.Hosting.Rust (2)
CargoMetadataReader.cs (2)
40private static readonly TimeSpan s_timeout = TimeSpan.FromMinutes(2);
Aspire.Hosting.Rust.Tests (1)
RustPublicApiTests.cs (1)
517await cargoStarted.WaitAsync(TimeSpan.FromSeconds(30));
Aspire.Hosting.Sdk.Tests (9)
AppHostSdkTargetsTests.cs (9)
825TimeSpan.FromSeconds(30)); 883TimeSpan.FromSeconds(5), 886TimeSpan.FromSeconds(10), 907await process.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(5)); 913_ = await executionTask.WaitAsync(TimeSpan.FromSeconds(5)); 1647TimeSpan.FromSeconds(30)); 1826using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 1845=> RunProcessWithArgumentsAsync("dotnet", workingDirectory, arguments, environment, TimeSpan.FromMinutes(3)); 1852TimeSpan timeout)
Aspire.Hosting.SqlServer.Tests (12)
SqlServerFunctionalTests.cs (12)
27var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3)); 67var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 69.AddRetry(new() { MaxRetryAttempts = int.MaxValue, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 133var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10)); 135.AddRetry(new() { MaxRetryAttempts = int.MaxValue, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 343var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 345.AddRetry(new() { MaxRetryAttempts = 10, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 417var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 419.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 471var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)); 473.AddRetry(new() { MaxRetryAttempts = 3, BackoffType = DelayBackoffType.Linear, Delay = TimeSpan.FromSeconds(2) }) 548var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
Aspire.Hosting.Testing (5)
DistributedApplicationFactory.cs (5)
29private TimeSpan _shutdownTimeout = TimeSpan.FromSeconds(10); 420static TimeSpan GetConfiguredTimeout() 430return TimeSpan.FromSeconds((int)timeoutInSeconds); 433return TimeSpan.FromMinutes(5);
Aspire.Hosting.Testing.Tests (46)
DashboardTestingBuilderTests.cs (1)
172await probe.Exited.WaitAsync(TimeSpan.FromSeconds(10));
DashboardUrlTests.cs (1)
341await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationTokenSource.Token);
ResourceLoggerForwarderServiceTests.cs (3)
59await subscribedTcs.Task.WaitAsync(TimeSpan.FromSeconds(15)); 109await subscribedTcs.Task.WaitAsync(TimeSpan.FromSeconds(15)); 123await expectedLogCountTcs.Task.WaitAsync(TimeSpan.FromSeconds(15));
TestingBuilderTests.cs (16)
25private static readonly TimeSpan s_appAliveCheckTimeout = TimeSpan.FromMinutes(1); 188await app.WaitForTextAsync("Application started.", "mywebapp1").WaitAsync(TimeSpan.FromMinutes(1)); 248await app.WaitForTextAsync("Application started.", "mywebapp1").WaitAsync(TimeSpan.FromMinutes(1)); 287await app.WaitForTextAsync("Application started.", "mywebapp1").WaitAsync(TimeSpan.FromMinutes(1)); 331await app.WaitForTextAsync("Application started.", "mywebapp1").WaitAsync(TimeSpan.FromMinutes(1)); 382await app.WaitForTextAsync("Application started.", "mywebapp1").WaitAsync(TimeSpan.FromMinutes(1)); 432await app.WaitForTextAsync("Application started.", "mywebapp1").WaitAsync(TimeSpan.FromMinutes(1)); 457var timeout = TimeSpan.FromMinutes(5); 502var timeout = TimeSpan.FromMinutes(5); 510await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(10)); 523var timeout = TimeSpan.FromMinutes(5); 549await 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\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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (3)
8private static readonly TimeSpan s_defaultTimeout = TimeSpan.FromSeconds(30); 88return new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero);
Aspire.Hosting.Tests (185)
ApplicationModel\Docker\DockerfileBuilderCallbackAnnotationTests.cs (2)
71var delay = TimeSpan.FromMilliseconds(10);
ApplicationModel\McpServerEndpointAnnotationTests.cs (1)
171using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100));
ApplicationModel\ResourceAnnotationCollectionTests.cs (1)
183using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
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\AppHostRpcTargetCancellationTests.cs (26)
26await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 38await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 46await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 63await iterationTask.WaitAsync(TimeSpan.FromSeconds(10)); 65await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 73await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 87await iterationTask.WaitAsync(TimeSpan.FromSeconds(10)); 89await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 101await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 112await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 120await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 135await iterationTask.WaitAsync(TimeSpan.FromSeconds(10)); 137await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 145await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 158await iterationTask.WaitAsync(TimeSpan.FromSeconds(10)); 160await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 172await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 183await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 191await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 206await iterationTask.WaitAsync(TimeSpan.FromSeconds(10)); 208await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 216await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 229await iterationTask.WaitAsync(TimeSpan.FromSeconds(10)); 231await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60)); 247await app.StartAsync().WaitAsync(TimeSpan.FromSeconds(60)); 252await app.StopAsync().WaitAsync(TimeSpan.FromSeconds(60));
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (2)
1630public override DateTimeOffset GetUtcNow() => new(2000, 12, 29, 20, 59, 59, TimeSpan.Zero); 2849TimeSpan.FromSeconds(1)));
Backchannel\GetTerminalInfoAsyncTests.cs (5)
68new GetTerminalInfoRequest { ResourceName = "myapp" }).DefaultTimeout(TimeSpan.FromSeconds(15)); 128new GetTerminalInfoRequest { ResourceName = "myapp" }).DefaultTimeout(TimeSpan.FromSeconds(10)); 186new GetTerminalInfoRequest { ResourceName = "myapp" }).DefaultTimeout(TimeSpan.FromSeconds(15)); 212new ListTerminalsRequest()).DefaultTimeout(TimeSpan.FromSeconds(15)); 247new ListTerminalsRequest()).DefaultTimeout(TimeSpan.FromSeconds(15));
Cli\CliOrphanDetectorTests.cs (7)
163fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 167fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 238fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 241fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 244fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 247fakeTimeProvider.Advance(TimeSpan.FromSeconds(1)); 291timeProvider ??= new FakeTimeProvider(new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero));
Cli\ProcessStartTimeHelperTests.cs (2)
172Assert.Equal(expectedResult, ProcessStartTimeHelper.AreClose(expected, actual, TimeSpan.FromSeconds(1))); 189Assert.Equal(TimeSpan.FromMilliseconds(20), ProcessStartTimeHelper.StableStartTimeMatchTolerance);
Codespaces\CodespacesUrlRewriterTests.cs (2)
29var abortToken = new CancellationTokenSource(TimeSpan.FromSeconds(60)); 65var abortToken = new CancellationTokenSource(TimeSpan.FromSeconds(60));
Dcp\DcpExecutorTests.cs (7)
1951appExecutor.ResourceWatcher.TerminalLogFlushTimeout = TimeSpan.FromMilliseconds(100); 2033appExecutor.ResourceWatcher.TerminalLogFlushTimeout = TimeSpan.FromMilliseconds(100); 5275Assert.Equal(parentProcessIdentity.Timestamp, container.Spec.MonitorTimestamp.Value, TimeSpan.FromMicroseconds(1)); 5286Assert.Equal(parentProcessIdentity.Timestamp, exe.Spec.MonitorTimestamp.Value, TimeSpan.FromMicroseconds(1)); 10221Delay = TimeSpan.FromMilliseconds(200), 10222MaxDelay = TimeSpan.FromSeconds(2), 10226.AddTimeout(TimeSpan.FromMilliseconds(timeoutMilliseconds))
Dcp\DcpHostNotificationTests.cs (16)
110using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 154using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 208using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); 267using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); 325using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 380using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 399timeProvider.Advance(TimeSpan.FromSeconds(5)); 402using (var testTimeoutCts = new CancellationTokenSource(TimeSpan.FromSeconds(5))) 451using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 465await Task.Delay(TimeSpan.FromMilliseconds(100)); 785using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); 835using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); 894using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); 946using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); 1004using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); 1068using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
Dcp\DcpLogParserTests.cs (2)
42Assert.Equal(new DateTimeOffset(2024, 8, 19, 6, 10, 1, TimeSpan.Zero), timestamp); 54Assert.Equal(new DateTimeOffset(2023, 9, 19, 20, 40, 50, 509, TimeSpan.FromHours(-7)), timestamp);
Dcp\KubernetesServiceTests.cs (13)
27using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(60)); 50using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(20)); 53maxRetryDuration: TimeSpan.FromSeconds(1)); 61await Task.Delay(TimeSpan.FromSeconds(2), cts.Token); 73using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(20)); 76maxRetryDuration: TimeSpan.FromMilliseconds(500), 77kubernetesConfigInitializationTimeout: TimeSpan.FromSeconds(5)); 86await Task.Delay(TimeSpan.FromSeconds(1), cts.Token); 98using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(60)); 122TimeSpan? maxRetryDuration = null, 123TimeSpan? kubernetesConfigInitializationTimeout = null) 143MaxRetryDuration = maxRetryDuration ?? TimeSpan.FromSeconds(30), 144KubernetesConfigInitializationTimeout = kubernetesConfigInitializationTimeout ?? TimeSpan.FromSeconds(60),
Dcp\ProcessUtilTests.cs (8)
31await callbackStarted.Task.WaitAsync(TimeSpan.FromSeconds(30)); 38var result = await pendingProcessResult.WaitAsync(TimeSpan.FromSeconds(30)); 51var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => pendingProcessResult).WaitAsync(TimeSpan.FromSeconds(30)); 74var processResult = await pendingProcessResult.WaitAsync(TimeSpan.FromSeconds(30)); 100var result = await pendingProcessResult.WaitAsync(TimeSpan.FromSeconds(30)); 124var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => pendingProcessResult).WaitAsync(TimeSpan.FromSeconds(30)); 160var result = await pendingProcessResult.WaitAsync(TimeSpan.FromSeconds(30)); 192var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => pendingProcessResult).WaitAsync(TimeSpan.FromSeconds(30));
DistributedApplicationTests.cs (7)
78cts.CancelAfter(TimeSpan.FromMinutes(1)); 123cts.CancelAfter(TimeSpan.FromMinutes(1)); 1736ConnectTimeout = TimeSpan.FromSeconds(2) 2058Assert.InRange((dcpContainer.Spec.MonitorTimestamp.Value - parentProcessIdentity.Timestamp).Duration(), TimeSpan.Zero, TimeSpan.FromMilliseconds(1)); 2067Assert.InRange((dcpExecutable.Spec.MonitorTimestamp.Value - parentProcessIdentity.Timestamp).Duration(), TimeSpan.Zero, TimeSpan.FromMilliseconds(1));
EndpointReferenceTests.cs (1)
408).WaitAsync(TimeSpan.FromSeconds(10));
Eventing\DistributedApplicationBuilderEventingTests.cs (4)
222var fired = countdownEvent.Wait(TimeSpan.FromSeconds(10)); 265TimeSpan.FromSeconds(10) 384var fired = eventFired.Wait(TimeSpan.FromSeconds(10)); 407var fired = eventFired.Wait(TimeSpan.FromSeconds(10));
ExpressionResolverTests.cs (1)
312_ = await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(consumer.Resource, DistributedApplicationOperation.Run, TestServiceProvider.Instance).AsTask().TimeoutAfter(TimeSpan.FromSeconds(2));
Health\FriendlyHealthCheckErrorMessagesTests.cs (2)
36var cts = new CancellationTokenSource(TimeSpan.FromSeconds(3)); 76var cts = new CancellationTokenSource(TimeSpan.FromSeconds(3));
Health\ResourceHealthCheckServiceTests.cs (6)
264rhcs.NonHealthyHealthCheckStepInterval = TimeSpan.FromMilliseconds(10); 320timeProvider.Advance(TimeSpan.FromSeconds(5)); 323timeProvider.Advance(TimeSpan.FromSeconds(5)); 329var duration = thirdCheck - firstCheck; 330Assert.Equal(TimeSpan.FromSeconds(10), duration); 484rhcs.HealthyHealthCheckInterval = TimeSpan.FromSeconds(1);
Lifecycle\TerminalHostFailureDiagnosticServiceTests.cs (1)
297using var timeoutCts = new CancellationTokenSource(TimeSpan.FromMilliseconds(150));
Orchestrator\ApplicationOrchestratorTests.cs (2)
704await Task.Delay(TimeSpan.FromMilliseconds(250), TestContext.Current.CancellationToken); 877await Task.Delay(TimeSpan.FromMilliseconds(250), TestContext.Current.CancellationToken);
Publishing\ContainerRuntimeBaseTests.cs (1)
22runtime.RunFailingCommandAsync()).WaitAsync(TimeSpan.FromSeconds(30));
ResourceCommandServiceTests.cs (3)
1646await app.StartAsync().DefaultTimeout(TimeSpan.FromMinutes(2)); 1650await resourceNotificationService.WaitForResourceAsync(project.Resource.Name, e => KnownResourceStates.BuildableStates.Contains(e.Snapshot.State?.Text), cts.Token).DefaultTimeout(TimeSpan.FromMinutes(2)); 1652var result = await app.ResourceCommands.ExecuteCommandAsync(project.Resource, KnownResourceCommands.RebuildCommand).DefaultTimeout(TimeSpan.FromMinutes(2));
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (3)
8private static readonly TimeSpan s_defaultTimeout = TimeSpan.FromSeconds(30); 88return new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero);
tests\Shared\TestProcesses.cs (2)
21private static readonly TimeSpan s_maxLifetime = TimeSpan.FromMinutes(5);
Utils\PeriodicRestartAsyncEnumerableTests.cs (10)
16cts.CancelAfter(TimeSpan.FromSeconds(1)); 21var innerFactory = (int? lastValue, CancellationToken cancellationToken) => Task.FromResult(CountingAsyncEnumerable(0, TimeSpan.FromMilliseconds(50), cancellationToken)); 23await foreach (var _ in PeriodicRestartAsyncEnumerable.CreateAsync(innerFactory, restartInterval: TimeSpan.FromSeconds(2), cancellationToken: cts.Token).ConfigureAwait(false)) 25if (DateTime.UtcNow - start > TimeSpan.FromSeconds(2)) 40cts.CancelAfter(TimeSpan.FromSeconds(1)); 44var innerFactory = (int? lastValue, CancellationToken cancellationToken) => Task.FromResult(RefCountingAsyncEnumerable(0, TimeSpan.FromMilliseconds(10), cancellationToken)); 46await foreach (var _ in PeriodicRestartAsyncEnumerable.CreateAsync(innerFactory, restartInterval: TimeSpan.FromMilliseconds(100), cancellationToken: cts.Token).ConfigureAwait(false)) 48if (DateTime.UtcNow - start > TimeSpan.FromSeconds(2)) 59static async IAsyncEnumerable<int> CountingAsyncEnumerable(int start, TimeSpan delay, [EnumeratorCancellation] CancellationToken cancellationToken) 71static async IAsyncEnumerable<int> RefCountingAsyncEnumerable(int start, TimeSpan delay, [EnumeratorCancellation] CancellationToken cancellationToken)
VersionChecking\VersionCheckServiceTests.cs (4)
75var currentDate = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero); 110var currentDate = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero); 150var currentDate = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero); 416public DateTimeOffset UtcNow { get; set; } = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero);
WaitForTests.cs (3)
247).WaitAsync(TimeSpan.FromSeconds(15)); 271).WaitAsync(TimeSpan.FromSeconds(15)); 300.WaitAsync(TimeSpan.FromSeconds(15));
WithHttpCommandTests.cs (5)
127.ConfigureHttpClient(client => client.Timeout = TimeSpan.FromSeconds(100)) 130TimeSpan? timeout = null; 527var configuredTimeout = TimeSpan.FromMinutes(5); 531TimeSpan? timeout = null;
WithTerminalTests.cs (8)
543ProcessStartTimeHelper.GetCurrentProcessStartTimeUnixMilliseconds() - (long)TimeSpan.FromMinutes(1).TotalMilliseconds; 591DateTime.UtcNow - TerminalHostOrphanCleanupService.InvalidMetadataRetentionPeriod - TimeSpan.FromMinutes(1)); 647DateTime.UtcNow - TerminalHostOrphanCleanupService.InvalidMetadataRetentionPeriod - TimeSpan.FromMinutes(1)); 664DateTime.UtcNow - TerminalHostOrphanCleanupService.InvalidMetadataRetentionPeriod - TimeSpan.FromMinutes(1)); 685DateTime.UtcNow - TerminalHostOrphanCleanupService.InvalidMetadataRetentionPeriod - TimeSpan.FromMinutes(1)); 750DateTime.UtcNow - TerminalHostOrphanCleanupService.InvalidMetadataRetentionPeriod - TimeSpan.FromMinutes(1)); 913await cleanupService.Completion.WaitAsync(TimeSpan.FromSeconds(10)); 1334await cleanupService.Completion.WaitAsync(TimeSpan.FromSeconds(10));
Aspire.Hosting.TestUtilities (10)
Helpers\Network.cs (3)
33.AddTimeout(new TimeoutStrategyOptions { Timeout = TimeSpan.FromSeconds(10) }) 38Delay = TimeSpan.FromMilliseconds(50), 39MaxDelay = TimeSpan.FromSeconds(2),
Utils\DockerUtils.cs (4)
13private static readonly TimeSpan s_runtimeDetectionTimeout = TimeSpan.FromSeconds(30); 121var exited = process.WaitForExit(TimeSpan.FromSeconds(3)); 137var exited = process.WaitForExit(TimeSpan.FromSeconds(3));
Utils\PersistentContainerTestHelpers.cs (3)
30TimeSpan? timeout = null) 59TimeSpan? timeout = null) 61using var cts = new CancellationTokenSource(timeout ?? TimeSpan.FromMinutes(10));
Aspire.Hosting.Valkey (6)
ValkeyBuilderExtensions.cs (6)
174var interval = (persistenceAnnotation.Interval ?? TimeSpan.FromSeconds(60)).TotalSeconds.ToString(CultureInfo.InvariantCulture); 199/// Use <see cref="WithPersistence(IResourceBuilder{ValkeyResource}, TimeSpan?, long)"/> to adjust Valkey persistence configuration, e.g.: 239/// Use <see cref="WithPersistence(IResourceBuilder{ValkeyResource}, TimeSpan?, long)"/> to adjust Valkey persistence configuration, e.g.: 291TimeSpan? interval = null, 300private sealed class PersistenceAnnotation(TimeSpan? interval, long keysChangedThreshold) : IResourceAnnotation 302public 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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
ValkeyFunctionalTests.cs (1)
208var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
Aspire.Hosting.Yarp (6)
ConfigurationBuilder\YarpClusterConfigDtos.cs (6)
17public TimeSpan? ActivityTimeout { get; set; } 145public TimeSpan? Expiration { get; set; } 160public TimeSpan? MaxAge { get; set; } 214public TimeSpan? Interval { get; set; } 234public TimeSpan? Timeout { get; set; } 256public TimeSpan? ReactivationPeriod { get; set; }
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)
35var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
Aspire.Managed.Tests (11)
ParentProcessWatchdogTests.cs (5)
51forceExitGracePeriod: TimeSpan.Zero, 74forceExitGracePeriod: TimeSpan.FromMilliseconds(50), 79Assert.True(callbackStarted.Wait(TimeSpan.FromSeconds(10))); 80Assert.Equal(124, await exitCode.Task.WaitAsync(TimeSpan.FromSeconds(10))); 87await cancellationTask.WaitAsync(TimeSpan.FromSeconds(10));
TerminalHostSignalTests.cs (6)
48var readyTask = WaitForFilesAsync(socketPaths, TimeSpan.FromSeconds(10)); 60await process.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(10)); 115var parentReadyTask = WaitForFilesAsync(parentSocketPaths, TimeSpan.FromSeconds(10)); 145var readyTask = WaitForFilesAsync(socketPaths, TimeSpan.FromSeconds(20)); 158await process.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(10)); 234private static async Task WaitForFilesAsync(IEnumerable<string> paths, TimeSpan timeout)
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.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests (3)
ConformanceTests.cs (3)
63minBackoffDurationProperty?.SetValue(options, TimeSpan.FromSeconds(1)); 68.SetRefreshInterval(TimeSpan.FromSeconds(1)); 72startupOptions.Timeout = TimeSpan.FromSeconds(1);
Aspire.Milvus.Client.Tests (1)
MilvusHealthCheckTests.cs (1)
43using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
Aspire.MongoDB.Driver (1)
src\Components\Aspire.MongoDB.Driver\AspireMongoDBDriverExtensions.cs (1)
184settings.HealthCheckTimeout > 0 ? TimeSpan.FromMilliseconds(settings.HealthCheckTimeout.Value) : null));
Aspire.MongoDB.EntityFrameworkCore.Tests (1)
ConformanceTests.cs (1)
89using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
Aspire.NATS.Net.Tests (4)
AspireNatsClientExtensionsTests.cs (4)
199using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); 214ReconnectWaitMin = TimeSpan.FromMilliseconds(1), 215ReconnectWaitMax = TimeSpan.FromMilliseconds(1) 266var activityList = await notifier.TakeAsync(1, TimeSpan.FromSeconds(10));
Aspire.Playground.Tests (28)
AppHostTests.cs (5)
64await Task.WhenAll(waitForTextTasks).WaitAsync(TimeSpan.FromMinutes(5)); 82await app.WaitForResources().WaitAsync(TimeSpan.FromMinutes(5)); 92return app.WaitForResource(wait.ResourceName, wait.TargetState).WaitAsync(TimeSpan.FromMinutes(5)); 156resilience.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(120); 157resilience.AttemptTimeout.Timeout = TimeSpan.FromSeconds(60);
BlazorWasmHostingTests.cs (1)
218await app.WaitForResources().WaitAsync(TimeSpan.FromMinutes(5));
Infrastructure\DistributedApplicationExtensions.cs (1)
247applyMigrationsHttpClient.Timeout = TimeSpan.FromSeconds(240);
ProjectSpecificTests.cs (1)
160cts.CancelAfter(TimeSpan.FromSeconds(timeoutSecs));
tests\Aspire.TestUtilities\TestcontainersPodmanConfiguration.cs (2)
48private static readonly TimeSpan s_podmanInspectTimeout = TimeSpan.FromSeconds(10);
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private 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.Qdrant.Client.Tests (1)
QdrantHealthCheckTests.cs (1)
40using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
Aspire.RabbitMQ.Client (1)
src\Components\Aspire.RabbitMQ.Client\AspireRabbitMQExtensions.cs (1)
198Delay = TimeSpan.FromSeconds(1),
Aspire.RabbitMQ.Client.Tests (2)
AspireRabbitMQExtensionsTests.cs (1)
157Assert.Equal(TimeSpan.FromSeconds(3), connectionFactory.SocketReadTimeout);
AspireRabbitMQLoggingTests.cs (1)
69await tsc.Task.WaitAsync(TimeSpan.FromMinutes(1));
Aspire.RabbitMQ.Client.v6.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)
69await tsc.Task.WaitAsync(TimeSpan.FromMinutes(1));
Aspire.Seq.Tests (2)
SeqEndpointCanBeConfigured.cs (2)
81using var serverCts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); 94using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
Aspire.StackExchange.Redis (3)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
130var parentCompleted = parent.Duration != TimeSpan.Zero;
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisInstrumentationOptions.cs (2)
34public 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 (4)
AspireRedisExtensionsTests.cs (4)
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); 433await outputCache.SetAsync("outputKey", [1, 2, 3, 4], tags: null, validFor: TimeSpan.MaxValue, cancellationToken: default);
Aspire.Templates.Tests (19)
PerTestFrameworkTemplatesTests.cs (1)
51.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)); 277var startupTimeoutTask = Task.Delay(TimeSpan.FromSeconds(AppStartupWaitTimeoutSecs), token); 300var allOutputCompleteTimeoutTask = Task.Delay(TimeSpan.FromSeconds(5), token); 368cts.CancelAfter(TimeSpan.FromSeconds(DashboardAvailabilityTimeoutSecs)); 386Delay = TimeSpan.FromSeconds(1) 476.WithTimeout(TimeSpan.FromSeconds(30)); 489.WithTimeout(TimeSpan.FromSeconds(30)); 517handler.PooledConnectionLifetime = TimeSpan.FromSeconds(5); 518handler.ConnectTimeout = TimeSpan.FromSeconds(5); 524options.AttemptTimeout.Timeout = TimeSpan.FromMinutes(2); 525options.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(5); // needs to be at least double the AttemptTimeout to pass options validation 526options.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.TerminalHost (24)
DcpUpstreamAdapter.cs (1)
494await pump.WaitAsync(TimeSpan.FromSeconds(2)).ConfigureAwait(false);
src\Shared\ParentProcessLivenessMonitor.cs (2)
13private static readonly TimeSpan s_pollInterval = TimeSpan.FromSeconds(1);
src\Shared\ParentProcessWatchdog.cs (4)
21internal static TimeSpan ForceExitGracePeriod { get; } = TimeSpan.FromSeconds(5); 96TimeSpan forceExitGracePeriod, 125TimeSpan forceExitGracePeriod,
src\Shared\ProcessStartTimeHelper.cs (9)
26public static readonly TimeSpan LegacyStartTimeMatchTolerance = TimeSpan.FromSeconds(1); 37public static readonly TimeSpan StableStartTimeMatchTolerance = TimeSpan.FromMilliseconds(20); 144TimeSpan? tolerance = null, 160TimeSpan? tolerance, 233public static bool IsProcessRunningWithRuntimeStartTime(int pid, long expectedStartTimeUnixSeconds, TimeSpan? tolerance = null) 281public static bool AreClose(long expectedStartTimeUnixSeconds, long actualStartTimeUnixSeconds, TimeSpan? tolerance = null) 296public static bool AreCloseMilliseconds(long expectedStartTimeUnixMilliseconds, long actualStartTimeUnixMilliseconds, TimeSpan? tolerance = null)
TerminalHostApp.cs (1)
403using var stopCts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
TerminalReplica.cs (7)
330var delay = consecutiveFailures switch 3320 => TimeSpan.FromMilliseconds(100), 3331 => TimeSpan.FromMilliseconds(250), 3342 => TimeSpan.FromMilliseconds(500), 3353 => TimeSpan.FromSeconds(1), 3364 => TimeSpan.FromSeconds(2), 337_ => TimeSpan.FromSeconds(5),
Aspire.TerminalHost.Tests (68)
TerminalHostAppTests.cs (50)
58await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 65await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 81await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 97await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 111await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 119var exitCode = await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 141await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 158await Task.WhenAll(connectTasks).WaitAsync(TimeSpan.FromSeconds(10)); 181await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 195using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(3)); 218await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 228await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 275await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 277await using var producer = await ConnectProducerAsync(args.ProducerUdsPath, TimeSpan.FromSeconds(10)); 281TimeSpan.FromSeconds(5), 288await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 309await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 318await using (var producer = await ConnectProducerAsync(args.ProducerUdsPath, TimeSpan.FromSeconds(5))) 324TimeSpan.FromSeconds(5), 334TimeSpan.FromSeconds(10), 342await using (var producer = await ConnectProducerAsync(args.ProducerUdsPath, TimeSpan.FromSeconds(10))) 348TimeSpan.FromSeconds(5), 358TimeSpan.FromSeconds(10), 371await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 395await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 403await WaitForFileAsync(args.ProducerUdsPath, TimeSpan.FromSeconds(10)); 404await WaitForFileAsync(args.ConsumerUdsPath, TimeSpan.FromSeconds(10)); 414await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 440await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 452await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 477await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 483await using var producer = await ConnectProducerAsync(args.ProducerUdsPath, TimeSpan.FromSeconds(5)); 488TimeSpan.FromSeconds(5), 493await WaitForFileAsync(args.ConsumerUdsPath, TimeSpan.FromSeconds(5)); 504args.ConsumerUdsPath, TimeSpan.FromSeconds(5)); 530TimeSpan.FromSeconds(10)); 545await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 588byte expectedType, Func<byte[], bool> match, TimeSpan timeout) 665private static async Task<TestHmp1Producer> ConnectProducerAsync(string socketPath, TimeSpan timeout) 713public static async Task<TestHmp1Consumer> ConnectAsync(string socketPath, TimeSpan timeout) 778private static async Task WaitForAsync(Func<bool> predicate, TimeSpan timeout, string failureMessage) 832await WaitForFileAsync(control, TimeSpan.FromSeconds(10)); 844await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 873await WaitForFileAsync(args.ProducerUdsPath, TimeSpan.FromSeconds(10)); 874await WaitForFileAsync(args.ConsumerUdsPath, TimeSpan.FromSeconds(10)); 879TimeSpan.FromSeconds(5)); 883TimeSpan.FromSeconds(5)); 889await hostTask.WaitAsync(TimeSpan.FromSeconds(10)); 893private static async Task WaitForUnixFileModeAsync(string path, UnixFileMode expected, TimeSpan timeout) 929private static async Task WaitForFileAsync(string path, TimeSpan timeout)
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)); 90return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 105return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 120return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 123public static Task<T> DefaultTimeout<T>(this Task<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 135return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 138public static Task<T> DefaultTimeout<T>(this ValueTask<T> task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 143public static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout, 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 210private static string CreateMessage(TimeSpan timeout, string filePath, int lineNumber)
Aspire.TestTools (8)
GitHubCli.cs (2)
230private static readonly TimeSpan s_defaultProcessTimeout = TimeSpan.FromMinutes(5);
TrxReader.cs (6)
41StartTime: startTime is null ? TimeSpan.MinValue : TimeSpan.Parse(startTime, CultureInfo.InvariantCulture), 42EndTime: endTime is null ? TimeSpan.MinValue : TimeSpan.Parse(endTime, CultureInfo.InvariantCulture), 296public record TestResult(string Name, string Outcome, TimeSpan StartTime, TimeSpan EndTime, string? ErrorMessage = null, string? Stdout = null);
Aspire.TestUtilities (2)
TestcontainersPodmanConfiguration.cs (2)
48private static readonly TimeSpan s_podmanInspectTimeout = TimeSpan.FromSeconds(10);
Aspire.TypeSystem (2)
AtsConstants.cs (2)
166/// TimeSpan type ID. Maps from .NET <see cref="System.TimeSpan"/>. 424typeof(TimeSpan),
AzureAppConfiguration.Web (1)
Program.cs (1)
11refresh.SetRefreshInterval(TimeSpan.FromSeconds(10));
AzureKusto.AppHost (1)
AzureKustoReadWriteDatabaseResourceBuilderExtensions.cs (1)
19Delay = TimeSpan.FromMilliseconds(100),
AzureKusto.Worker (2)
Program.cs (1)
38Delay = TimeSpan.FromMilliseconds(100),
QueryWorker.cs (1)
35await Task.Delay(TimeSpan.FromSeconds(1), stoppingToken);
AzureSearch.ApiService (1)
Program.cs (1)
172await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken);
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
BlazorHosted.ClientServiceDefaults (2)
Extensions.cs (2)
54Delay = TimeSpan.FromSeconds(1), 55MaxDelay = TimeSpan.FromSeconds(5),
BlazorStandalone.ClientServiceDefaults (2)
Extensions.cs (2)
54Delay = TimeSpan.FromSeconds(1), 55MaxDelay = TimeSpan.FromSeconds(5),
cdac-build-tool (2)
_generated\0\RegexGenerator.g.cs (2)
322internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
CdkSample.AppHost (2)
AppHost.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)
1628Assert.True(TimeSpan.TryParse(validTimeSpanString, CultureInfo.InvariantCulture, out _)); 1640Assert.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);
CosmosEndToEnd.ApiService (1)
Program.cs (1)
17configureDbContextOptions.RequestTimeout = TimeSpan.FromSeconds(120);
csc (1)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
173await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false);
CustomResources.AppHost (1)
TestResource.cs (1)
59using var timer = new PeriodicTimer(TimeSpan.FromSeconds(seconds));
dotnet (69)
_generated\159\TelemetryDiskLoggerJsonSerializerContext.ActivityModel.g.cs (7)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.ActivityModel((string)args[0], (string)args[1], (global::System.TimeSpan)args[2], (global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.IdentifiersModel)args[3], (global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.SourceModel)args[4], (global::System.Collections.Generic.Dictionary<string, string>)args[5], (global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel[])args[6]), 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.ActivityModel).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string), typeof(global::System.TimeSpan), typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.IdentifiersModel), typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.SourceModel), typeof(global::System.Collections.Generic.Dictionary<string, string>), typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel[])}, modifiers: null), 97var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan> 112AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.ActivityModel).GetProperty("duration", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null), 115properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info2); 261ParameterType = typeof(global::System.TimeSpan), 314private static extern void __set_ActivityModel_duration(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.ActivityModel obj, global::System.TimeSpan value);
_generated\167\TelemetryDiskLoggerJsonSerializerContext.TimeSpan.g.cs (8)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 22get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 29jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
_generated\171\TelemetryDiskLoggerJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
54if (type == typeof(global::System.TimeSpan))
_generated\190\RegexGenerator.g.cs (2)
606internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
Commands\Test\MTP\ArtifactPostProcessingTelemetry.cs (2)
48TimeSpan duration) 57TimeSpan duration)
Commands\Test\MTP\IPC\NamedPipeServer.cs (1)
240if (!_loopTask!.Wait(TimeSpan.FromSeconds(90)))
Commands\Test\MTP\Terminal\HumanReadableDurationFormatter.cs (2)
10public static void Append(ITerminal terminal, TimeSpan duration, bool wrapInParentheses = true) 62public static string Render(TimeSpan? duration, bool wrapInParentheses = true, bool showMilliseconds = false)
Commands\Test\MTP\Terminal\IStopwatch.cs (1)
12TimeSpan Elapsed { get; }
Commands\Test\MTP\Terminal\SystemStopwatch.cs (1)
12public TimeSpan Elapsed => _stopwatch.Elapsed;
Commands\Test\MTP\Terminal\TerminalTestReporter.cs (10)
387TimeSpan runDuration = _testExecutionStartTime != null && _testExecutionEndTime != null ? (_testExecutionEndTime - _testExecutionStartTime).Value : TimeSpan.Zero; 587IReadOnlyList<(string DisplayName, TimeSpan Duration)> slowest = assembly.GetSlowestTests(count); 603foreach ((string displayName, TimeSpan duration) in slowest) 614IReadOnlyList<(string DisplayName, TimeSpan Duration)> tests = assemblies.Count == 1 624foreach ((string displayName, TimeSpan duration) in tests) 631private static void AppendSlowestTestLine(ITerminal terminal, string displayName, TimeSpan duration) 720TimeSpan? duration, 788TimeSpan? duration, 1258private static void AppendLongDuration(ITerminal terminal, TimeSpan duration, bool wrapInParentheses = true, bool colorize = true)
Commands\Test\MTP\Terminal\TestNodeResultsState.cs (1)
55.OrderByDescending(d => d.Stopwatch?.Elapsed ?? TimeSpan.Zero)
Commands\Test\MTP\Terminal\TestProgressState.cs (3)
22private readonly Dictionary<string, (string DisplayName, TimeSpan Duration)> _testUidToDuration = new(); 336public void RecordTestDuration(string testNodeUid, string displayName, TimeSpan? duration) 355public IReadOnlyList<(string DisplayName, TimeSpan Duration)> GetSlowestTests(int count)
Commands\Test\MTP\TestApplication.cs (8)
32private static readonly TimeSpan DefaultArtifactPostProcessingTimeout = TimeSpan.FromMinutes(15); 35/// Largest timeout <see cref="Task.WaitAsync(TimeSpan)"/> accepts, in seconds. Anything above 40private static readonly TimeSpan ArtifactPostProcessingTimeout = GetArtifactPostProcessingTimeout(); 216await Task.WhenAll(stdOutTask, stdErrTask).WaitAsync(TimeSpan.FromSeconds(5)); 576private static TimeSpan GetArtifactPostProcessingTimeout() 580internal static TimeSpan ParseArtifactPostProcessingTimeout(string? configuredTimeout) 597: TimeSpan.FromSeconds(seconds);
Commands\Test\MTP\TestApplicationHandler.cs (2)
340testResult.Duration.HasValue ? TimeSpan.FromTicks(testResult.Duration.Value) : null, 356testResult.Duration.HasValue ? TimeSpan.FromTicks(testResult.Duration.Value) : null,
Commands\Test\MTP\TestRunPolicy.cs (13)
19internal static readonly TimeSpan DefaultCancellationGracePeriod = TimeSpan.FromSeconds(30); 22private readonly TimeSpan? _timeout; 30private TimeSpan? _remainingTimeout; 39TimeSpan? timeout, 40TimeSpan? cancellationGracePeriod = null, 48if (timeout.HasValue && timeout.Value <= TimeSpan.Zero) 77public TimeSpan CancellationGracePeriod { get; } 100TimeSpan dueTime = remainingTimeout > TimeSpan.Zero ? remainingTimeout : TimeSpan.Zero; 131TimeSpan elapsed = Stopwatch.GetElapsedTime(_timerStartedTimestamp); 133timeoutReached = _remainingTimeout <= TimeSpan.Zero;
NugetPackageDownloader\NuGetPackageDownloader.cs (2)
1005internal static TimeSpan CliCompletionsTimeout { get; set; } = TimeSpan.FromMilliseconds(500);
NugetSearch\NugetToolSearchApiRequest.cs (1)
29using var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(10));
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26425.101\contentFiles\cs\net11.0\BuildServerConnection.cs (1)
173await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false);
Telemetry\TelemetryDiskLogger.cs (1)
38TimeSpan duration,
TransactionalAction.cs (2)
73TimeSpan.Zero)) 97TransactionManager.MaximumTimeout = TimeSpan.Zero;
dotnet-aot (23)
_generated\116\RegexGenerator.g.cs (2)
194internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
_generated\18\TelemetryDiskLoggerJsonSerializerContext.ActivityModel.g.cs (7)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.ActivityModel((string)args[0], (string)args[1], (global::System.TimeSpan)args[2], (global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.IdentifiersModel)args[3], (global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.SourceModel)args[4], (global::System.Collections.Generic.Dictionary<string, string>)args[5], (global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel[])args[6]), 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.ActivityModel).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string), typeof(global::System.TimeSpan), typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.IdentifiersModel), typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.SourceModel), typeof(global::System.Collections.Generic.Dictionary<string, string>), typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.EventModel[])}, modifiers: null), 97var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan> 112AttributeProviderFactory = static () => typeof(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.ActivityModel).GetProperty("duration", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null), 115properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info2); 261ParameterType = typeof(global::System.TimeSpan), 314private static extern void __set_ActivityModel_duration(global::Microsoft.DotNet.Cli.Telemetry.TelemetryDiskLogger.ActivityModel obj, global::System.TimeSpan value);
_generated\26\TelemetryDiskLoggerJsonSerializerContext.TimeSpan.g.cs (8)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 22get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 29jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
_generated\30\TelemetryDiskLoggerJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
54if (type == typeof(global::System.TimeSpan))
src\sdk\src\Cli\dotnet\NugetPackageDownloader\NuGetPackageDownloader.cs (2)
1005internal static TimeSpan CliCompletionsTimeout { get; set; } = TimeSpan.FromMilliseconds(500);
src\sdk\src\Cli\dotnet\NugetSearch\NugetToolSearchApiRequest.cs (2)
29using var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(10)); 98using var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(10));
src\sdk\src\Cli\dotnet\Telemetry\TelemetryDiskLogger.cs (1)
38TimeSpan duration,
dotnet-dev-certs (6)
_generated\10\RegexGenerator.g.cs (2)
607internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
Program.cs (2)
47public static readonly TimeSpan HttpsCertificateValidity = TimeSpan.FromDays(365);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
272TimeSpan 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-suggest (4)
ISuggestionStore.cs (1)
9string GetCompletions(string exeFileName, string suggestionTargetArguments, TimeSpan timeout);
SuggestionDispatcher.cs (2)
104public TimeSpan Timeout { get; set; } = TimeSpan.FromMilliseconds(5000);
SuggestionStore.cs (1)
13public string GetCompletions(string exeFileName, string suggestionTargetArguments, TimeSpan timeout)
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)
187if (!TimeSpan.TryParseExact(validForOption.Value(), _timeSpanFormats, CultureInfo.InvariantCulture, out var validForValue))
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 (14)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
143internal bool WaitForOutstandingObjectsToBeFreed(TimeSpan timeout)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 112TimeSpan delay,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (2)
37private readonly TimeSpan _delay; 73TimeSpan delay,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
752or nameof(TimeSpan))
GetDocument.Insider (9)
Commands\GetDocumentCommandWorker.cs (1)
373var finished = resultTask.Wait(TimeSpan.FromMinutes(1));
src\ab038811704af8d7\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, 123public static Func<string[], IServiceProvider?>? ResolveServiceProviderFactory(Assembly assembly, TimeSpan? waitTimeout = null) 201private readonly TimeSpan _waitTimeout; 214TimeSpan waitTimeout,
HealthChecksSandbox.AppHost (1)
AppHost.cs (1)
133await Task.Delay(TimeSpan.FromSeconds(10));
HelixTestTasks (2)
ComputeBatchTimeout.cs (2)
97var ts = TimeSpan.FromMinutes(totalMinutes);
illink (2)
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;
Infrastructure.Tests (44)
CreateFailingTestIssue\CreateFailingTestIssueFixture.cs (1)
48using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(3));
CreateFailingTestIssue\CreateFailingTestIssueToolTests.cs (1)
653using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(2));
DownloadFailingJobLogs\DownloadFailingJobLogsToolTests.cs (1)
109using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(2));
ExtractTestPartitions\ExtractTestPartitionsFixture.cs (1)
38using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
ExtractTestPartitions\ExtractTestPartitionsTests.cs (1)
339using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(2));
GenerateTestSummary\GenerateTestSummaryFixture.cs (1)
41using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(3));
GenerateTestSummary\GenerateTestSummaryToolTests.cs (1)
270using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(2));
Pipelines\ExtensionE2eRecorderStepTests.cs (1)
74.WithTimeout(TimeSpan.FromMinutes(2));
Pipelines\NixCliPackageTests.cs (1)
243using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));
Pipelines\NpmCliPackageTests.cs (4)
166.WithTimeout(TimeSpan.FromSeconds(30)); 198.WithTimeout(TimeSpan.FromSeconds(30)); 232.WithTimeout(TimeSpan.FromSeconds(30)); 580.WithTimeout(TimeSpan.FromMinutes(2));
PowerShellScripts\AspireSkillsBundleHashTests.cs (1)
142using var cmd = new PowerShellCommand(driverPath, _output).WithTimeout(TimeSpan.FromMinutes(1));
PowerShellScripts\BuildTestMatrixTests.cs (1)
737.WithTimeout(TimeSpan.FromMinutes(2));
PowerShellScripts\DownloadNativeArchivesTests.cs (2)
390.WithTimeout(TimeSpan.FromMinutes(2)); 683try { _serverTask?.Wait(TimeSpan.FromSeconds(2)); } catch { }
PowerShellScripts\ExpandTestMatrixGitHubTests.cs (3)
551.WithTimeout(TimeSpan.FromMinutes(2)); 568.WithTimeout(TimeSpan.FromMinutes(2)) 622.WithTimeout(TimeSpan.FromMinutes(2));
PowerShellScripts\PowerShellCommand.cs (3)
20private TimeSpan? _timeout; 50public PowerShellCommand WithTimeout(TimeSpan timeSpan) 143var completedTask = await Task.WhenAny(waitForExitTask, Task.Delay(TimeSpan.FromSeconds(5), token)).ConfigureAwait(false);
PowerShellScripts\SplitTestMatrixByDepsTests.cs (3)
223.WithTimeout(TimeSpan.FromMinutes(2)) 238.WithTimeout(TimeSpan.FromMinutes(2)) 254.WithTimeout(TimeSpan.FromMinutes(2))
PowerShellScripts\SplitTestProjectsTests.cs (1)
188.WithTimeout(TimeSpan.FromMinutes(3));
PowerShellScripts\StageNativeCliToolPackagesTests.cs (1)
289.WithTimeout(TimeSpan.FromMinutes(2));
PowerShellScripts\TrustedExtensionReleasePrTests.cs (1)
242.WithTimeout(TimeSpan.FromMinutes(1))
PowerShellScripts\ValidateNpmPackageSignaturesTests.cs (1)
205.WithTimeout(TimeSpan.FromMinutes(1));
PowerShellScripts\ValidateNpmReleaseAliasesTests.cs (1)
180.WithTimeout(TimeSpan.FromMinutes(2))
PowerShellScripts\WriteClassModeTestPropsTests.cs (1)
117.WithTimeout(TimeSpan.FromMinutes(1));
WorkflowScripts\AutoRerunTransientCiFailuresTests.cs (1)
2231command.WithWorkingDirectory(_repoRoot).WithTimeout(TimeSpan.FromMinutes(1));
WorkflowScripts\ExtensionChangelogFinalizedWorkflowTests.cs (2)
338using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(30)); 502using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(30));
WorkflowScripts\ExtensionReleaseWorkflowTests.cs (5)
613using var timeout = new CancellationTokenSource(TimeSpan.FromMinutes(1)); 665using var timeout = new CancellationTokenSource(TimeSpan.FromMinutes(1)); 744using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(30)); 781using var timeout = new CancellationTokenSource(TimeSpan.FromMinutes(1)); 847using var timeout = new CancellationTokenSource(TimeSpan.FromMinutes(1));
WorkflowScripts\NodeCommand.cs (3)
19private TimeSpan? _timeout; 38public NodeCommand WithTimeout(TimeSpan timeSpan) 135var completedTask = await Task.WhenAny(waitForExitTask, Task.Delay(TimeSpan.FromSeconds(5), token)).ConfigureAwait(false);
WorkflowScripts\PrDocsCheckWorkflowTests.cs (1)
195using var timeout = new CancellationTokenSource(TimeSpan.FromMinutes(2));
Microsoft.Agents.AI.ProjectTemplates.Tests (4)
TestCommand.cs (3)
20public TimeSpan? Timeout { get; set; } 105var elapsedTime = Stopwatch.GetElapsedTime(startTimestamp); 119var elapsedTime = Stopwatch.GetElapsedTime(startTimestamp);
TestCommandExtensions.cs (1)
24public static TCommand WithTimeout<TCommand>(this TCommand command, TimeSpan timeout)
Microsoft.Analyzers.Extra.Tests (1)
StaticTimeTests.cs (1)
19Assembly.GetAssembly(typeof(TimeSpan))!,
Microsoft.Arcade.Common (10)
ExponentialRetry.cs (8)
35public TimeSpan? MaximumDelay { get; set; } 41public Action<int, TimeSpan> RetryDelayCallback { get; set; } 74TimeSpan exponentialDelay = TimeSpan.FromSeconds( 76if (MaximumDelay is TimeSpan maximumDelay && exponentialDelay > maximumDelay) 81TimeSpan delay = result.RetryAfter is TimeSpan retryAfter 82? TimeSpan.FromTicks(Math.Max(exponentialDelay.Ticks, retryAfter.Ticks))
IRetryHandler.cs (2)
20public readonly record struct RetryResult(bool Succeeded, TimeSpan? RetryAfter = null) 24public static RetryResult Retry(TimeSpan? retryAfter = null)
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)
66var 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)
101var timeElapsed = currentUtc.Subtract(issuedUtc.Value); 102var timeRemaining = expiresUtc.Value.Subtract(currentUtc); 127var timeSpan = expiresUtc.Value.Subtract(issuedUtc.Value);
CookieAuthenticationOptions.cs (2)
30ExpireTimeSpan = TimeSpan.FromDays(14); 134public 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.DeviceBoundSessions (6)
DeviceBoundSessionChallengeProtector.cs (2)
34public string GenerateRegistrationChallenge(ClaimsPrincipal principal, TimeSpan lifetime) 42public string GenerateRefreshChallenge(ClaimsPrincipal principal, string sessionId, TimeSpan lifetime)
DeviceBoundSessionOptions.cs (4)
76public TimeSpan ShortLivedCookieExpiration { get; set; } = TimeSpan.FromMinutes(10); 82public TimeSpan ChallengeMaxAge { get; set; } = TimeSpan.FromMinutes(5);
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 (7)
_generated\1\RegexGenerator.g.cs (2)
173internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
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)
438var maxAge = properties.GetParameter<TimeSpan?>(OpenIdConnectParameterNames.MaxAge) ?? Options.MaxAge; 1148var 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.Twitter (2)
TwitterHandler.cs (1)
341var secondsSinceUnixEpocStart = TimeProvider.GetUtcNow() - DateTimeOffset.UnixEpoch;
TwitterOptions.cs (1)
25BackchannelTimeout = TimeSpan.FromSeconds(60);
Microsoft.AspNetCore.Components (10)
_generated\7\RegexGenerator.g.cs (2)
141internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
ComponentsMetrics.cs (6)
99var duration = Stopwatch.GetElapsedTime(startTimestamp); 111var duration = Stopwatch.GetElapsedTime(startTimestamp); 128var duration = Stopwatch.GetElapsedTime(startTimestamp); 134var duration = Stopwatch.GetElapsedTime(startTimestamp); 154var duration = Stopwatch.GetElapsedTime(startTimestamp); 161var duration = Stopwatch.GetElapsedTime(startTimestamp);
src\aspnetcore\src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (2)
26private static readonly TimeSpan RegexMatchTimeout = TimeSpan.FromSeconds(10);
Microsoft.AspNetCore.Components.Endpoints (58)
_generated\20\BrowserOptionsJsonContext.InteractiveServerBrowserOptions.g.cs (4)
73var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan?> 79Converter = GetConverterForNullableProperty<global::System.TimeSpan>(new global::Microsoft.AspNetCore.Components.TimeSpanMillisecondsJsonConverter(), options), 88AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Components.InteractiveServerBrowserOptions).GetProperty("ReconnectionRetryInterval", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan?), global::System.Array.Empty<global::System.Type>(), null), 91properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan?>(options, info1);
_generated\22\BrowserOptionsJsonContext.StaticServerBrowserOptions.g.cs (4)
73var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan?> 79Converter = GetConverterForNullableProperty<global::System.TimeSpan>(new global::Microsoft.AspNetCore.Components.TimeSpanMillisecondsJsonConverter(), options), 88AttributeProviderFactory = static () => typeof(global::Microsoft.AspNetCore.Components.StaticServerBrowserOptions).GetProperty("CircuitInactivityTimeout", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan?), global::System.Array.Empty<global::System.Type>(), null), 91properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan?>(options, info1);
_generated\28\BrowserOptionsJsonContext.TimeSpan.g.cs (8)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 22get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 29jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
_generated\29\BrowserOptionsJsonContext.NullableTimeSpan.g.cs (9)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?>? _NullableTimeSpan; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?> NullableTimeSpan 22get => _NullableTimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?>)Options.GetTypeInfo(typeof(global::System.TimeSpan?)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?> Create_NullableTimeSpan(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan?>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?> jsonTypeInfo)) 29global::System.Text.Json.Serialization.JsonConverter converter = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetNullableConverter<global::System.TimeSpan>(options); 30jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan?>(options, converter);
_generated\34\BrowserOptionsJsonContext.GetJsonTypeInfo.g.cs (2)
66if (type == typeof(global::System.TimeSpan)) 70if (type == typeof(global::System.TimeSpan?))
BrowserConfiguration\BrowserOptionsJsonConverters.cs (4)
11internal sealed class TimeSpanMillisecondsJsonConverter : JsonConverter<TimeSpan?> 13public override TimeSpan? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 14=> reader.TokenType is JsonTokenType.Null ? null : TimeSpan.FromMilliseconds(reader.GetDouble()); 16public override void Write(Utf8JsonWriter writer, TimeSpan? value, JsonSerializerOptions options)
BrowserConfiguration\InteractiveServerBrowserOptions.cs (1)
29public TimeSpan? ReconnectionRetryInterval { get; set; }
BrowserConfiguration\StaticServerBrowserOptions.cs (1)
28public TimeSpan? CircuitInactivityTimeout { get; set; }
Builder\OpaqueRedirection.cs (1)
46var lifetime = options.Value.TemporaryRedirectionUrlValidityDuration;
CacheView\CacheStoreOptions.cs (2)
8public TimeSpan? ExpiresAfter { get; init; } 10public TimeSpan? ExpiresSliding { get; init; }
CacheView\CacheView.cs (2)
42public TimeSpan? ExpiresAfter { get; set; } 55public TimeSpan? ExpiresSliding { get; set; }
CacheView\HybridCacheViewStore.cs (3)
62var absolute = options.ExpiresOn.HasValue 66if (absolute < TimeSpan.Zero) 68absolute = TimeSpan.Zero;
DependencyInjection\RazorComponentsServiceOptions.cs (5)
16private TimeSpan _temporaryRedirectionUrlValidityDuration = TimeSpan.FromMinutes(5); 88public TimeSpan TemporaryRedirectionUrlValidityDuration 143internal static readonly TimeSpan DefaultCacheViewExpiration = TimeSpan.FromSeconds(30);
FormMapping\Converters\NullableConverter.cs (1)
69type == typeof(TimeSpan) ||
FormMapping\WellKnownConverters.cs (6)
43{ typeof(TimeSpan), new ParsableConverter<TimeSpan>() }, 75converters.Add(typeof(TimeSpan?), new NullableConverter<TimeSpan>((FormDataConverter<TimeSpan>)converters[typeof(TimeSpan)]));
src\aspnetcore\src\Shared\Components\ServerComponentSerializationSettings.cs (2)
48public static readonly TimeSpan DataExpiration = TimeSpan.FromMinutes(5);
src\aspnetcore\src\Shared\Components\ServerComponentSerializer.cs (3)
24TimeSpan? dataExpiration = default) 26var expiration = dataExpiration ?? ServerComponentSerializationSettings.DataExpiration; 36TimeSpan dataExpiration)
Microsoft.AspNetCore.Components.Server (27)
CircuitOptions.cs (8)
50public TimeSpan DisconnectedCircuitRetentionPeriod { get; set; } = TimeSpan.FromMinutes(3); 76public TimeSpan PersistedCircuitInMemoryRetentionPeriod { get; set; } = TimeSpan.FromHours(2); 84public TimeSpan? PersistedCircuitDistributedRetentionPeriod { get; set; } = TimeSpan.FromHours(8); 108public TimeSpan JSInteropDefaultCallTimeout { get; set; } = TimeSpan.FromMinutes(1);
Circuits\CircuitMetrics.cs (1)
75var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp);
Circuits\CircuitPersistenceManager.cs (1)
216var localRetention = circuitOptions.Value.PersistedCircuitInMemoryRetentionPeriod;
Circuits\RemoteJSDataStream.cs (3)
15private readonly TimeSpan _jsInteropDefaultCallTimeout; 41TimeSpan jsInteropDefaultCallTimeout, 63TimeSpan jsInteropDefaultCallTimeout,
Circuits\RemoteJSRuntime.cs (1)
192CancellationTokenSource 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)
50protected abstract TimeSpan RevalidationInterval { get; }
src\aspnetcore\src\Shared\Components\ServerComponentSerializationSettings.cs (2)
48public static readonly TimeSpan DataExpiration = TimeSpan.FromMinutes(5);
src\aspnetcore\src\Shared\Components\ServerComponentSerializer.cs (3)
24TimeSpan? dataExpiration = default) 26var expiration = dataExpiration ?? ServerComponentSerializationSettings.DataExpiration; 36TimeSpan dataExpiration)
src\aspnetcore\src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
src\aspnetcore\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.AutoPause (4)
AutoPauseBrowserOptions.cs (3)
28/// <value>Defaults to two minutes. Must be greater than <see cref="TimeSpan.Zero"/>.</value> 29public TimeSpan HiddenDelay { get; set; } = TimeSpan.FromMinutes(2);
AutoPauseBrowserOptionsExtensions.cs (1)
30if (settings.Enabled && settings.HiddenDelay <= TimeSpan.Zero)
Microsoft.AspNetCore.Components.Testing (4)
Infrastructure\ReadinessNotificationService.cs (4)
45var delay = TimeSpan.FromMilliseconds(200); 52client.Timeout = TimeSpan.FromSeconds(5); 67delay = TimeSpan.FromMilliseconds(delay.TotalMilliseconds * 2);
Microsoft.AspNetCore.Components.WebAssembly.Authentication (2)
Services\RemoteAuthenticationService.cs (2)
32private static readonly TimeSpan _userCacheRefreshInterval = TimeSpan.FromSeconds(60);
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)
449using var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
Microsoft.AspNetCore.Connections.Abstractions (2)
Features\IAuthenticationRefreshFeature.cs (2)
20TimeSpan? InitialTokenLifetime { get; } 26Task<TimeSpan?> RefreshAuthenticationAsync(CancellationToken cancellationToken = default);
Microsoft.AspNetCore.CookiePolicy (1)
CookiePolicyOptions.cs (1)
48Expiration = TimeSpan.FromDays(365),
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.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; 523private TimeSpan GetRefreshPeriodWithJitter(TimeSpan refreshPeriod) 528return 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)
83DateTimeOffset embeddedExpiration = new DateTimeOffset(checked((long)utcTicksExpiration), TimeSpan.Zero /* UTC */);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (4)
_generated\0\RegexGenerator.g.cs (2)
607internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
272TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
Microsoft.AspNetCore.Diagnostics.Middleware (9)
Buffering\PerRequestLogBufferingOptions.cs (3)
30private static readonly TimeSpan _defaultAutoFlushDuration = TimeSpan.FromSeconds(30); 40public TimeSpan AutoFlushDuration { get; set; } = _defaultAutoFlushDuration;
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\BindingExtensions.g.cs (3)
387public static global::System.TimeSpan ParseSystemTimeSpan(string value, string? path) 391return global::System.TimeSpan.Parse(value, CultureInfo.InvariantCulture); 395throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.TimeSpan)}'.", exception);
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.HeaderParsing.Tests (1)
ParserTests.cs (1)
122Assert.Equal(TimeSpan.FromSeconds(604800), result.MaxAge);
Microsoft.AspNetCore.Hosting (10)
Internal\HostingApplicationDiagnostics.cs (2)
291var elapsed = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp); 587if (activity.Duration == TimeSpan.Zero)
Internal\HostingEventSource.cs (1)
97DisplayRateTimeScale = TimeSpan.FromSeconds(1)
Internal\HostingMetrics.cs (1)
97var 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)
26public 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.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.Connections (37)
_generated\0\LoggerMessage.g.cs (3)
139private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.TimeSpan, string, global::System.Exception?> __TransportSendTimeoutCallback = 140global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.TimeSpan, string>(global::Microsoft.Extensions.Logging.LogLevel.Trace, new global::Microsoft.Extensions.Logging.EventId(9, "TransportSendTimeout"), "{Timeout}ms elapsed attempting to send a message to the transport. Closing connection {TransportConnectionId}.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 147public static partial void TransportSendTimeout(global::Microsoft.Extensions.Logging.ILogger logger, global::System.TimeSpan timeout, string transportConnectionId)
ConnectionOptions.cs (1)
14public TimeSpan? DisconnectTimeout { get; set; }
ConnectionOptionsSetup.cs (2)
17public static TimeSpan DefaultDisconectTimeout = TimeSpan.FromSeconds(15);
HttpConnectionDispatcherOptions.cs (6)
35TransportSendTimeout = TimeSpan.FromSeconds(10); 105public TimeSpan TransportSendTimeout 110ArgumentOutOfRangeException.ThrowIfEqual(value, TimeSpan.Zero); 163/// When set, the value must be greater than <see cref="TimeSpan.Zero"/>. 170public TimeSpan? MaximumAuthenticationExpiration 175if (value is { } timeSpan && timeSpan <= TimeSpan.Zero)
Internal\HttpConnectionContext.cs (9)
58private TimeSpan _startedSendTime; 90LastSeenTicks = TimeSpan.FromMilliseconds(Environment.TickCount64); 157public TimeSpan LastSeenTicks { get; set; } 159public TimeSpan? LastSeenTicksIfInactive 812TimeSpan pollTimeout, 991LastSeenTicks = TimeSpan.FromMilliseconds(Environment.TickCount64); 1023_startedSendTime = TimeSpan.FromMilliseconds(Environment.TickCount64); 1028internal void TryCancelSend(TimeSpan currentTicks) 1191public static partial void TransportSendTimeout(ILogger logger, TimeSpan timeout, string transportConnectionId);
Internal\HttpConnectionDispatcher.cs (2)
217var ttl = newExpiration - DateTimeOffset.UtcNow; 583var ttl = expiresUtc.Value - DateTimeOffset.UtcNow;
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\aspnetcore\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 (11)
HttpConnection.cs (8)
37private static readonly TimeSpan HttpClientTimeout = TimeSpan.FromSeconds(120); 52private TimeSpan? _initialTokenLifetime; 101TimeSpan? IAuthenticationRefreshFeature.InitialTokenLifetime => _initialTokenLifetime; 769async Task<TimeSpan?> IAuthenticationRefreshFeature.RefreshAuthenticationAsync(CancellationToken cancellationToken) 825private static (TimeSpan? TokenLifetime, string? AccessToken) ParseRefreshResponse(ReadOnlySpan<byte> content) 834TimeSpan? tokenLifetime = null; 846tokenLifetime = TimeSpan.FromSeconds(reader.GetInt32());
HttpConnectionOptions.cs (2)
191public TimeSpan CloseTimeout { get; set; } = TimeSpan.FromSeconds(5);
Internal\WebSocketsTransport.cs (1)
36private readonly TimeSpan _closeTimeout;
Microsoft.AspNetCore.Http.Connections.Common (4)
NegotiateProtocol.cs (3)
97if (response.TokenLifetime is { } tokenLifetime && tokenLifetime > TimeSpan.Zero) 170TimeSpan? tokenLifetime = null; 230tokenLifetime = TimeSpan.FromSeconds(reader.ReadAsInt32(TokenLifetimePropertyName).GetValueOrDefault());
NegotiationResponse.cs (1)
62public TimeSpan? TokenLifetime { get; set; }
Microsoft.AspNetCore.Http.Extensions (7)
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Converters\NullableConverter.cs (1)
69type == typeof(TimeSpan) ||
src\aspnetcore\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.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.Results (2)
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (2)
392var ticksToRemove = dateTimeOffset.Ticks % TimeSpan.TicksPerSecond; 393return dateTimeOffset.Subtract(TimeSpan.FromTicks(ticksToRemove));
Microsoft.AspNetCore.HttpLogging (7)
FileLoggerProcessor.cs (1)
22private TimeSpan _flushInterval;
src\aspnetcore\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.HttpsPolicy (2)
HstsOptions.cs (2)
18public TimeSpan MaxAge { get; set; } = TimeSpan.FromDays(30);
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\aspnetcore\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.InternalTesting (14)
AssemblyTestLog.cs (1)
291flushToDiskInterval: TimeSpan.FromSeconds(1),
src\aspnetcore\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.Mvc.ApiExplorer (1)
EndpointModelMetadata.cs (1)
65|| underlyingType == 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\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (2)
392var ticksToRemove = dateTimeOffset.Ticks % TimeSpan.TicksPerSecond; 393return dateTimeOffset.Subtract(TimeSpan.FromTicks(ticksToRemove));
src\aspnetcore\src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
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.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.Testing (8)
src\ab038811704af8d7\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, 123public static Func<string[], IServiceProvider?>? ResolveServiceProviderFactory(Assembly assembly, TimeSpan? waitTimeout = null) 201private readonly TimeSpan _waitTimeout; 214TimeSpan waitTimeout,
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.OpenApi (1)
Services\OpenApiConstants.cs (1)
52typeof(TimeSpan),
Microsoft.AspNetCore.OutputCaching (19)
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 (4)
270var cacheEntryAge = context.ResponseTime.Value - context.CachedResponse.Created; 271context.CachedEntryAge = cacheEntryAge > TimeSpan.Zero ? cacheEntryAge : TimeSpan.Zero; 308response.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.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.RateLimiting (4)
RateLimitingMetrics.cs (2)
108var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp); 158var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp);
src\aspnetcore\src\Shared\ValueStopwatch\ValueStopwatch.cs (2)
26public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) 37public TimeSpan GetElapsedTime()
Microsoft.AspNetCore.Razor.Utilities.Shared (1)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
143internal bool WaitForOutstandingObjectsToBeFreed(TimeSpan timeout)
Microsoft.AspNetCore.ResponseCaching (68)
_generated\0\LoggerMessage.g.cs (36)
73private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.TimeSpan, global::System.Exception?> __ExpirationMinFreshAddedCallback = 74global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Debug, new global::Microsoft.Extensions.Logging.EventId(5, "LogRequestMethodNotCacheable"), "Adding a minimum freshness requirement of {Duration} specified by the 'min-fresh' cache directive.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 81internal static partial void ExpirationMinFreshAdded(this global::Microsoft.Extensions.Logging.ILogger logger, global::System.TimeSpan duration) 89private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.TimeSpan, global::System.TimeSpan, global::System.Exception?> __ExpirationSharedMaxAgeExceededCallback = 90global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.TimeSpan, global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Debug, new global::Microsoft.Extensions.Logging.EventId(6, "ExpirationSharedMaxAgeExceeded"), "The age of the entry is {Age} and has exceeded the maximum age for shared caches of {SharedMaxAge} specified by the 's-maxage' cache directive.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 97internal static partial void ExpirationSharedMaxAgeExceeded(this global::Microsoft.Extensions.Logging.ILogger logger, global::System.TimeSpan age, global::System.TimeSpan sharedMaxAge) 105private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.TimeSpan, global::System.TimeSpan, global::System.Exception?> __ExpirationMustRevalidateCallback = 106global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.TimeSpan, global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Debug, new global::Microsoft.Extensions.Logging.EventId(7, "ExpirationMustRevalidate"), "The age of the entry is {Age} and has exceeded the maximum age of {MaxAge} specified by the 'max-age' cache directive. It must be revalidated because the 'must-revalidate' or 'proxy-revalidate' cache directive is specified.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 113internal static partial void ExpirationMustRevalidate(this global::Microsoft.Extensions.Logging.ILogger logger, global::System.TimeSpan age, global::System.TimeSpan maxAge) 121private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.TimeSpan, global::System.TimeSpan, global::System.TimeSpan, global::System.Exception?> __ExpirationMaxStaleSatisfiedCallback = 122global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.TimeSpan, global::System.TimeSpan, global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Debug, new global::Microsoft.Extensions.Logging.EventId(8, "ExpirationMaxStaleSatisfied"), "The age of the entry is {Age} and has exceeded the maximum age of {MaxAge} specified by the 'max-age' cache directive. However, it satisfied the maximum stale allowance of {MaxStale} specified by the 'max-stale' cache directive.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 129internal static partial void ExpirationMaxStaleSatisfied(this global::Microsoft.Extensions.Logging.ILogger logger, global::System.TimeSpan age, global::System.TimeSpan maxAge, global::System.TimeSpan maxStale) 137private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.TimeSpan, global::System.TimeSpan, global::System.Exception?> __ExpirationMaxAgeExceededCallback = 138global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.TimeSpan, global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Debug, new global::Microsoft.Extensions.Logging.EventId(9, "ExpirationMaxAgeExceeded"), "The age of the entry is {Age} and has exceeded the maximum age of {MaxAge} specified by the 'max-age' cache directive.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 145internal static partial void ExpirationMaxAgeExceeded(this global::Microsoft.Extensions.Logging.ILogger logger, global::System.TimeSpan age, global::System.TimeSpan maxAge) 457private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.TimeSpan, global::System.TimeSpan, global::System.Exception?> __ExpirationInfiniteMaxStaleSatisfiedCallback = 458global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.TimeSpan, global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Debug, new global::Microsoft.Extensions.Logging.EventId(29, "ExpirationInfiniteMaxStaleSatisfied"), "The age of the entry is {Age} and has exceeded the maximum age of {MaxAge} specified by the 'max-age' cache directive. However, the 'max-stale' cache directive was specified without an assigned value and a stale response of any age is accepted.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 465internal static partial void ExpirationInfiniteMaxStaleSatisfied(this global::Microsoft.Extensions.Logging.ILogger logger, global::System.TimeSpan age, global::System.TimeSpan maxAge)
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.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; } 44if (Lifetime > TimeSpan.Zero)
Microsoft.AspNetCore.Routing (4)
_generated\1\RegexGenerator.g.cs (2)
141internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
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)
701private TimeSpan? GetCacheTtl() 743var expiresOffset = expirationDate - DateTimeOffset.UtcNow; 744if (expiresOffset > TimeSpan.Zero)
RequestProcessing\Response.cs (4)
30private TimeSpan? _cacheTtl; 187public TimeSpan? CacheTtl 330if (_cacheTtl.HasValue && _cacheTtl.Value > TimeSpan.Zero) 333cachePolicy.SecondsToLive = (uint)Math.Min(_cacheTtl.Value.Ticks / TimeSpan.TicksPerSecond, Int32.MaxValue);
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\aspnetcore\src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
src\aspnetcore\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.IIS (4)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\aspnetcore\src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
207public bool TryGetElapsedTime(HttpSysRequestTimingType startingTimestampType, HttpSysRequestTimingType endingTimestampType, out TimeSpan elapsed)
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\aspnetcore\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\aspnetcore\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.Kestrel.Core (104)
_generated\0\LoggerMessage.g.cs (6)
643private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.DateTimeOffset, global::System.TimeSpan, global::System.TimeSpan, global::System.Exception?> __HeartbeatSlowCallback = 644global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.DateTimeOffset, global::System.TimeSpan, global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Warning, new global::Microsoft.Extensions.Logging.EventId(22, "HeartbeatSlow"), "As of \"{now}\", the heartbeat has been running for \"{heartbeatDuration}\" which is longer than \"{interval}\". This could be caused by thread pool starvation.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 651public static partial void HeartbeatSlow(global::Microsoft.Extensions.Logging.ILogger logger, global::System.DateTimeOffset now, global::System.TimeSpan heartbeatDuration, global::System.TimeSpan interval)
_generated\1\RegexGenerator.g.cs (2)
610internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
DirectTlsEndpointOptions.cs (3)
124public TimeSpan HandshakeTimeout 129if (value <= TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) 134field = value != Timeout.InfiniteTimeSpan ? value : TimeSpan.MaxValue;
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; 117public TimeSpan HandshakeTimeout 122if (value <= TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) 126_handshakeTimeout = value != Timeout.InfiniteTimeSpan ? value : TimeSpan.MaxValue;
Internal\Http2\Http2Connection.cs (3)
67private readonly TimeSpan StreamPoolExpiry = TimeSpan.FromSeconds(5); 178if (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)
153var duration = Stopwatch.GetElapsedTime(startTimestamp, currentTimestamp); 344var 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)); 388new MinDataRate(bytesPerSecond: 240, gracePeriod: TimeSpan.FromSeconds(5));
ListenOptionsHttpsExtensions.cs (6)
235public static ListenOptions UseHttps(this ListenOptions listenOptions, ServerOptionsSelectionCallback serverOptionsSelectionCallback, object state, TimeSpan handshakeTimeout) 282internal static readonly TimeSpan DefaultTlsClientHelloListenerTimeout = TimeSpan.FromSeconds(8); 304public static ListenOptions UseTlsClientHelloListener(this ListenOptions listenOptions, Action<ConnectionContext, ReadOnlySequence<byte>> tlsClientHelloBytesCallback, TimeSpan? timeout = null) 310ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(timeout.Value, TimeSpan.Zero, nameof(timeout)); 313var effectiveTimeout = timeout ?? DefaultTlsClientHelloListenerTimeout;
Middleware\HttpsConnectionMiddleware.cs (1)
34private readonly TimeSpan _handshakeTimeout;
MinDataRate.cs (2)
19public MinDataRate(double bytesPerSecond, TimeSpan gracePeriod) 44public TimeSpan GracePeriod { get; }
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\aspnetcore\src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
272TimeSpan 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.Transport.DirectTls (5)
Connection\DirectTlsConnectionListener.cs (1)
217using var stopCts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
TlsEventPump.cs (2)
144public TlsEventPump(ILogger tlsPumpLogger, int id, TimeSpan handshakeTimeout) 148_handshakeTimeoutMs = handshakeTimeout == Timeout.InfiniteTimeSpan || handshakeTimeout == TimeSpan.MaxValue
TlsEventPumpPool.cs (2)
26public TlsEventPumpPool(int pumpCount, ILoggerFactory loggerFactory, TimeSpan? handshakeTimeout = null) 35var effectiveHandshakeTimeout = handshakeTimeout ?? Timeout.InfiniteTimeSpan;
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (3)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\aspnetcore\src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (3)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout)
src\aspnetcore\src\Shared\Buffers.MemoryPool\PinnedBlockMemoryPool.cs (2)
27public static readonly TimeSpan DefaultEvictionDelay = TimeSpan.FromSeconds(10);
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.SignalR (1)
SignalRDependencyInjectionExtensions.cs (1)
44services.Configure<WebSocketOptions>(o => o.KeepAliveInterval = TimeSpan.Zero);
Microsoft.AspNetCore.SignalR.Client.Core (81)
_generated\0\LoggerMessage.g.cs (12)
1030private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, long, global::System.TimeSpan, global::System.Exception?> __ReconnectedCallback = 1031global::Microsoft.Extensions.Logging.LoggerMessage.Define<long, global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Information, new global::Microsoft.Extensions.Logging.EventId(70, "Reconnected"), "HubConnection reconnected successfully after {ReconnectAttempts} attempts and {ElapsedTime} elapsed.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 1038public static partial void Reconnected(global::Microsoft.Extensions.Logging.ILogger logger, long reconnectAttempts, global::System.TimeSpan elapsedTime) 1046private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, long, global::System.TimeSpan, global::System.Exception?> __ReconnectAttemptsExhaustedCallback = 1047global::Microsoft.Extensions.Logging.LoggerMessage.Define<long, global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Information, new global::Microsoft.Extensions.Logging.EventId(71, "ReconnectAttemptsExhausted"), "Reconnect retries have been exhausted after {ReconnectAttempts} failed attempts and {ElapsedTime} elapsed. Disconnecting.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 1054public static partial void ReconnectAttemptsExhausted(global::Microsoft.Extensions.Logging.ILogger logger, long reconnectAttempts, global::System.TimeSpan elapsedTime) 1062private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, long, global::System.TimeSpan, global::System.Exception?> __AwaitingReconnectRetryDelayCallback = 1063global::Microsoft.Extensions.Logging.LoggerMessage.Define<long, global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Trace, new global::Microsoft.Extensions.Logging.EventId(72, "AwaitingReconnectRetryDelay"), "Reconnect attempt number {ReconnectAttempts} will start in {RetryDelay}.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 1070public static partial void AwaitingReconnectRetryDelay(global::Microsoft.Extensions.Logging.ILogger logger, long reconnectAttempts, global::System.TimeSpan retryDelay) 1446private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.TimeSpan?, global::System.Exception?> __AuthenticationRefreshCompletedCallback = 1447global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.TimeSpan?>(global::Microsoft.Extensions.Logging.LogLevel.Debug, new global::Microsoft.Extensions.Logging.EventId(96, "AuthenticationRefreshCompleted"), "Authentication token refresh completed. New TTL: {TokenLifetime}.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 1454public static partial void AuthenticationRefreshCompleted(global::Microsoft.Extensions.Logging.ILogger logger, global::System.TimeSpan? tokenLifetime)
AuthenticationRefreshOptions.cs (5)
30public TimeSpan RefreshBeforeExpiration 35if (value < TimeSpan.Zero) 42} = TimeSpan.FromMinutes(5); 50internal AuthenticationRefreshedContext(HubConnection hubConnection, TimeSpan? newTokenLifetime) 65public TimeSpan? NewTokenLifetime { get; }
HubConnection.cs (31)
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); 73private static readonly TimeSpan _maximumAuthenticationRefreshDelay = TimeSpan.FromMilliseconds(int.MaxValue); 99private TimeSpan _lastAuthenticationRefreshDelay; 192internal TimeSpan TickRate { get; set; } = TimeSpan.FromSeconds(1); 200public TimeSpan ServerTimeout { get; set; } 208public TimeSpan KeepAliveInterval { get; set; } 213public TimeSpan HandshakeTimeout { get; set; } = DefaultHandshakeTimeout; 585if (authenticationRefreshFeature?.InitialTokenLifetime is { } initialTokenLifetime && initialTokenLifetime > TimeSpan.Zero) 601public async Task<TimeSpan?> RefreshAuthenticationAsync(CancellationToken cancellationToken = default) 614private async Task<TimeSpan?> RefreshAuthenticationAsyncCore(ConnectionState connectionState, CancellationToken cancellationToken) 623TimeSpan? newTtl; 645if (newTtl is { } tokenLifetime && tokenLifetime > TimeSpan.Zero) 688internal void ScheduleAuthenticationRefresh(TimeSpan tokenLifetime) 696private void ScheduleAuthenticationRefresh(TimeSpan tokenLifetime, ConnectionState connectionState) 698var refreshBefore = _authenticationRefreshOptions.RefreshBeforeExpiration; 699TimeSpan refreshIn; 701var timeUntilRefreshWindow = tokenLifetime - refreshBefore; 719internal void ScheduleAuthenticationRefreshAt(TimeSpan refreshIn) 727private void ScheduleAuthenticationRefreshAt(TimeSpan refreshIn, ConnectionState connectionState) 2118var nextRetryDelay = GetNextRetryDelay(previousReconnectAttempts, TimeSpan.Zero, retryReason); 2220var elapsedTime = DateTime.UtcNow - reconnectStartTime; 2234private TimeSpan? GetNextRetryDelay(long previousRetryCount, TimeSpan elapsedTime, Exception? retryReason) 2600cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
HubConnection.Log.cs (6)
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) 348public static partial void AuthenticationRefreshCompleted(ILogger logger, TimeSpan? tokenLifetime);
HubConnectionBuilderExtensions.cs (3)
50public static IHubConnectionBuilder WithAutomaticReconnect(this IHubConnectionBuilder hubConnectionBuilder, TimeSpan[] reconnectDelays) 74public static IHubConnectionBuilder WithServerTimeout(this IHubConnectionBuilder hubConnectionBuilder, TimeSpan timeout) 86public 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\aspnetcore\src\Shared\NonCapturingTimer\NonCapturingTimer.cs (2)
16public static Timer Create(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
src\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (3)
23public static TimeSpan AckRate => TimeSpan.FromSeconds(1); 140using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5), _timeProvider);
src\aspnetcore\src\SignalR\common\Shared\TimerAwaitable.cs (4)
19private readonly TimeSpan _period; 21private readonly TimeSpan _dueTime; 26public TimerAwaitable(TimeSpan dueTime, TimeSpan period)
Microsoft.AspNetCore.SignalR.Core (25)
_generated\0\LoggerMessage.g.cs (3)
190private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.TimeSpan, global::System.Exception?> __ClientTimeoutCallback = 191global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Debug, new global::Microsoft.Extensions.Logging.EventId(9, "ClientTimeout"), "Client timeout ({ClientTimeout}ms) elapsed without receiving a message from the client. Closing connection.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 198public static partial void ClientTimeout(global::Microsoft.Extensions.Logging.ILogger logger, global::System.TimeSpan clientTimeout)
HubConnectionContext.cs (6)
32private readonly TimeSpan _keepAliveInterval; 33private readonly TimeSpan _clientTimeoutInterval; 51private TimeSpan _receivedMessageElapsed; 607internal async Task<bool> HandshakeAsync(TimeSpan timeout, IReadOnlyList<string>? supportedProtocols, IHubProtocolResolver protocolResolver, 787var elapsed = _timeProvider.GetElapsedTime(Volatile.Read(ref _lastSendTick), currentTime); 891_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)
124var 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\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (3)
23public static TimeSpan AckRate => TimeSpan.FromSeconds(1); 140using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5), _timeProvider);
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\aspnetcore\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\aspnetcore\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\aspnetcore\src\Shared\NonCapturingTimer\NonCapturingTimer.cs (2)
16public static Timer Create(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
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.TestHost (9)
src\ab038811704af8d7\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, 123public static Func<string[], IServiceProvider?>? ResolveServiceProviderFactory(Assembly assembly, TimeSpan? waitTimeout = null) 201private readonly TimeSpan _waitTimeout; 214TimeSpan waitTimeout,
TestServer.cs (1)
186Timeout = TimeSpan.FromSeconds(200),
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.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.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 (63)
_generated\10\RegexGenerator.g.cs (2)
7015internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
BackEnd\BuildManager\BuildManager.cs (1)
694if (_coordinatorClient.WaitDuration is TimeSpan waitDuration)
BackEnd\BuildManager\CoordinatorClient.cs (2)
53public TimeSpan? WaitDuration { get; private init; } 434TimeSpan? waitDuration = null)
BackEnd\Components\Communications\LogMessagePacket.cs (4)
176TimeSpan exclusiveTime = profiledLocation.ExclusiveTime; 177TimeSpan inclusiveTime = profiledLocation.InclusiveTime; 477TimeSpan exclusiveTime = default; 478TimeSpan inclusiveTime = default;
BackEnd\Components\Scheduler\SchedulableRequest.cs (1)
302public TimeSpan GetTimeSpentInState(SchedulableRequestState desiredState)
BackEnd\Components\Scheduler\Scheduler.cs (3)
2414TimeSpan[] nodeActiveTimes = new TimeSpan[_availableNodes.Count]; 2526TimeSpan totalDuration = currentEventTime - nodeStartTimes[i];
BackEnd\Components\Scheduler\ScheduleTimeRecord.cs (3)
21private TimeSpan _accumulatedTime; 29_accumulatedTime = TimeSpan.Zero; 38public TimeSpan AccumulatedTime
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (1)
129manifest.ResolvableSdkRegex = new Regex(pattern, regexOptions, TimeSpan.FromMilliseconds(SdkResolverPatternRegexTimeoutMsc));
BuildCheck\Infrastructure\BuildCheckBuildEventHandler.cs (3)
190Dictionary<string, TimeSpan> infraStats = _tracingData.InfrastructureTracingData; 193Dictionary<string, TimeSpan> checkStats = _tracingData.ExtractCheckStats(); 208private string BuildCsvString(string title, Dictionary<string, TimeSpan> rowData)
BuildCheck\Infrastructure\TracingReporter.cs (8)
12private TimeSpan checkAcquisitionTime; 13private TimeSpan checkSetDataSourceTime; 14private TimeSpan newProjectChecksTime; 16public void AddAcquisitionStats(TimeSpan subtotal) 21public void AddSetDataSourceStats(TimeSpan subtotal) 26public void AddNewProjectStats(TimeSpan subtotal) 31public Dictionary<string, TimeSpan> GetInfrastructureTracingStats() 32=> new Dictionary<string, TimeSpan>()
Evaluation\Profiler\EvaluationLocationMarkdownPrettyPrinter.cs (1)
27internal override void AppendLocation(StringBuilder stringBuilder, TimeSpan totalTime, EvaluationLocation evaluationLocation, ProfiledLocation profiledLocation)
Evaluation\Profiler\EvaluationLocationPrettyPrinterBase.cs (5)
26internal abstract void AppendLocation(StringBuilder stringBuilder, TimeSpan totalTime, EvaluationLocation evaluationLocation, ProfiledLocation profiledLocation); 34protected static double GetMilliseconds(TimeSpan timeSpan) 40protected static double GetPercentage(TimeSpan total, TimeSpan time) 95protected void AppendDefaultLocationWithSeparator(StringBuilder stringBuilder, TimeSpan totalTime, EvaluationLocation evaluationLocation, ProfiledLocation profiledLocation, string separator)
Evaluation\Profiler\EvaluationLocationTabSeparatedPrettyPrinter.cs (1)
26internal override void AppendLocation(StringBuilder stringBuilder, TimeSpan totalTime, EvaluationLocation evaluationLocation, ProfiledLocation profiledLocation)
Evaluation\Profiler\EvaluationProfiler.cs (2)
146previousTimeSpent = new ProfiledLocation(TimeSpan.Zero, TimeSpan.Zero, 0);
Evaluation\Profiler\ProfilerResultPrettyPrinter.cs (1)
56TimeSpan? totalTime = null;
Evaluation\PropertyFunctionReceiver.cs (1)
42typeof(DateTime), typeof(DateTimeOffset), typeof(TimeSpan),
Graph\ProjectGraph.cs (2)
77public GraphConstructionMetrics(TimeSpan constructionTime, int nodeCount, int edgeCount) 84public TimeSpan ConstructionTime { get; }
Instance\TaskRegistry.cs (1)
1103public TimeSpan ExecutedTime => _executedSw.Elapsed;
Logging\BaseConsoleLogger.cs (3)
731protected TimeSpan elapsedTime = new TimeSpan(0); 758internal TimeSpan ElapsedTime => elapsedTime; 854return TimeSpan.Compare(p1.ElapsedTime, p2.ElapsedTime);
Logging\BinaryLogger\BuildEventArgsReader.cs (4)
1293kvp => TimeSpan.FromTicks(long.Parse(kvp.Value)))); 1813private TimeSpan ReadTimeSpan() 1821var exclusiveTime = ReadTimeSpan(); 1822var inclusiveTime = ReadTimeSpan();
Logging\BinaryLogger\BuildEventArgsWriter.cs (2)
355Dictionary<string, TimeSpan> stats = e.TracingData.ExtractCheckStats(); 1389private void Write(TimeSpan timeSpan)
Logging\LogFormatter.cs (1)
47internal static string FormatTimeSpan(TimeSpan t)
Logging\ParallelLogger\ParallelConsoleLogger.cs (1)
1754elapsedTime += (TimeSpan.FromTicks(eventTimeStamp.Ticks - (long)time));
Resources\Constants.cs (2)
275[DynamicDependency(PropertyFunctionMembers, typeof(TimeSpan))] 391availableStaticMethods.TryAdd("System.TimeSpan", new Tuple<string, Type>(null, typeof(TimeSpan)));
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (1)
400TimeSpan usedWaitTime = restartWaitTime - originalWaitStartTime;
src\msbuild\src\Shared\Tracing.cs (3)
37private static readonly TimeSpan s_interval; 63s_interval = TimeSpan.FromSeconds(seconds); 67s_interval = TimeSpan.FromSeconds(1);
TelemetryInfra\ITelemetryCollector.cs (1)
26TimeSpan cumulativeExecutionTime,
TelemetryInfra\TelemetryCollectorProvider.cs (2)
59public void AddTask(TaskOrTargetTelemetryKey key, TimeSpan cumulativeExecutionTime, int executionsCount, long totalMemoryConsumed, string? taskFactoryName, string? taskHostRuntime) 88public void AddTask(TaskOrTargetTelemetryKey key, TimeSpan cumulativeExecutionTime, int executionsCount, long totalMemoryConsumed, string? taskFactoryName, string? taskHostRuntime) { }
Utilities\Utilities.cs (1)
718else if (item is KeyValuePair<string, TimeSpan> keyTimeSpanValue)
Microsoft.Build.Framework (35)
_generated\1\RegexGenerator.g.cs (2)
226internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
BackEnd\CommunicationsUtilities.cs (1)
815float millisecondsSinceLastLog = (float)(nowTicks - s_lastLoggedTicks) / TimeSpan.TicksPerMillisecond;
BinaryReaderExtensions.cs (4)
125public static Dictionary<string, TimeSpan> ReadDurationDictionary(this BinaryReader reader) 128var durations = new Dictionary<string, TimeSpan>(count); 132TimeSpan value = TimeSpan.FromTicks(reader.ReadInt64());
BinaryTranslator.cs (2)
465public void Translate(ref TimeSpan value) 1287public void Translate(ref TimeSpan value)
BinaryWriterExtensions.cs (2)
134public static void WriteDurationsDictionary(this BinaryWriter writer, Dictionary<string, TimeSpan> durations) 137foreach (KeyValuePair<string, TimeSpan> kvp in durations)
BuildCheck\BuildCheckEventArgs.cs (3)
28internal BuildCheckTracingEventArgs(Dictionary<string, TimeSpan> executionData) 107TimeSpan 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)
268void Translate(ref TimeSpan value);
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)
53TimeSpan totalRuntime = new TimeSpan(runtimeTicks);
Telemetry\TaskExecutionStats.cs (3)
12TimeSpan cumulativeExecutionTime, 19: this(TimeSpan.Zero, 0, 0, null, null) 32public TimeSpan CumulativeExecutionTime { get; set; } = cumulativeExecutionTime;
Telemetry\WorkerNodeTelemetryData.cs (1)
36public void AddTask(TaskOrTargetTelemetryKey task, TimeSpan cumulativeExecutionTime, int executionsCount, long totalMemoryConsumption, string? factoryName, string? taskHostRuntime)
Telemetry\WorkerNodeTelemetryEventArgs.cs (2)
47var cumulativeExecutionTime = TimeSpan.FromTicks(reader.ReadInt64());
Microsoft.Build.Tasks.CodeAnalysis (1)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
173await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false);
Microsoft.Build.Tasks.Core (7)
_generated\0\RegexGenerator.g.cs (2)
4161internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
DownloadFile.cs (1)
154using (var client = new HttpClient(HttpMessageHandler ?? new HttpClientHandler(), disposeHandler: true) { Timeout = TimeSpan.FromMilliseconds(Timeout) })
src\msbuild\src\Shared\NodePipeServer.cs (1)
93TimeSpan usedWaitTime = restartWaitTime - originalWaitStartTime;
src\msbuild\src\Shared\Tracing.cs (3)
37private static readonly TimeSpan s_interval; 63s_interval = TimeSpan.FromSeconds(seconds); 67s_interval = TimeSpan.FromSeconds(1);
Microsoft.Build.Utilities.Core (6)
_generated\0\RegexGenerator.g.cs (2)
2645internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
src\msbuild\src\Shared\Tracing.cs (3)
37private static readonly TimeSpan s_interval; 63s_interval = TimeSpan.FromSeconds(seconds); 67s_interval = TimeSpan.FromSeconds(1);
ToolTask.cs (1)
1133bool allEOFReceived = _eofCountdown.Wait(TimeSpan.FromSeconds(eofTimeoutSec));
Microsoft.CodeAnalysis (96)
_generated\0\RegexGenerator.g.cs (2)
946internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
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); 616var executionTime = _analyzerExecutionTimeOpt != null ? _analyzerExecutionTimeOpt[analyzer] : default;
DiagnosticAnalyzer\AnalyzerDriver.cs (3)
922if (AnalyzerExecutionTimes.TryGetValue(analyzer, out var analyzerExecutionTimeSpan)) 1460internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes => AnalyzerExecutor.AnalyzerExecutionTimes; 1461internal 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)"/>. 229internal ImmutableDictionary<DiagnosticAnalyzer, TimeSpan> AnalyzerExecutionTimes 234return _analyzerExecutionTimeMap.ToImmutableDictionary(pair => pair.Key, pair => TimeSpan.FromTicks(pair.Value.Value)); 1688internal TimeSpan ResetAnalyzerExecutionTime(DiagnosticAnalyzer analyzer) 1693return TimeSpan.Zero; 1696return 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)
1286var executionTime = GetAnalyzerExecutionTime(analyzer); 1309private 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, compilationCache: CompilationCache.Empty); 236return _state.With(stateTable: DriverStateTable.Empty, runTime: TimeSpan.Zero); 578private static GeneratorState SetGeneratorException(Compilation compilation, CommonMessageProvider provider, GeneratorState generatorState, ISourceGenerator generator, Exception e, DiagnosticBag? diagnosticBag, GeneratorRunPhase phase, TimeSpan? runTime, CancellationToken cancellationToken) 600return generatorState.WithError(e, filtered ?? diagnostic, runTime ?? TimeSpan.Zero, phase);
SourceGeneration\GeneratorDriverState.cs (3)
24TimeSpan runtime, 105internal readonly TimeSpan RunTime; 124TimeSpan? runTime = null,
SourceGeneration\GeneratorState.cs (6)
31elapsedTime: TimeSpan.Zero, 56elapsedTime: TimeSpan.Zero, 72TimeSpan elapsedTime, 111TimeSpan elapsedTime) 127public GeneratorState WithError(Exception exception, Diagnostic error, TimeSpan elapsedTime, GeneratorRunPhase phase) 159internal 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\AbstractSourceOutputNode.cs (2)
57tableBuilder.TryRemoveEntries(TimeSpan.Zero, inputs); 59else if (entry.State != EntryState.Cached || !tableBuilder.TryUseCachedEntries(TimeSpan.Zero, inputs))
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)
58TimeSpan elapsedTime = stopwatch.Elapsed; 190tableBuilder.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)
78if (_filterTable.TryRemoveEntries(TimeSpan.Zero, noInputStepsStepInfo, out var removedNodes)) 81_transformTable.TryRemoveEntries(TimeSpan.Zero, noInputStepsStepInfo); 89if (state != EntryState.Cached || !_filterTable.TryUseCachedEntries(TimeSpan.Zero, noInputStepsStepInfo, out NodeStateTable<SyntaxNode>.TableEntry entry)) 104_transformTable.TryRemoveEntries(TimeSpan.Zero, noInputStepsStepInfo);
SourceGeneration\Nodes\SyntaxReceiverStrategy.cs (1)
38private TimeSpan lastElapsedTime;
SourceGeneration\Nodes\TransformNode.cs (2)
76tableBuilder.TryRemoveEntries(TimeSpan.Zero, inputs); 78else 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) 145internal TimeSpan ElapsedTime { get; } 201internal GeneratorDriverTimingInfo(TimeSpan elapsedTime, ImmutableArray<GeneratorTimingInfo> generatorTimes) 213public TimeSpan ElapsedTime { get; } 226internal GeneratorTimingInfo(ISourceGenerator generator, TimeSpan elapsedTime) 240public TimeSpan ElapsedTime { get; }
SourceGeneration\SyntaxStore.cs (9)
32private readonly ImmutableDictionary<SyntaxInputNode, TimeSpan>.Builder _syntaxTimes = ImmutableDictionary.CreateBuilder<SyntaxInputNode, TimeSpan>(); 77_syntaxTimes[node] = TimeSpan.Zero; 84_syntaxTimes[syntaxInputNode] = TimeSpan.Zero; 107var elapsed = sw.Elapsed; 173public TimeSpan GetRuntimeAdjustment(ImmutableArray<SyntaxInputNode> inputNodes) 175TimeSpan result = TimeSpan.Zero; 179if (_syntaxTimes.TryGetValue(node, out var adjustment))
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
143internal bool WaitForOutstandingObjectsToBeFreed(TimeSpan timeout)
VersionHelper.cs (1)
204TimeSpan days = time.Date - new DateTime(2000, 1, 1);
Microsoft.CodeAnalysis.Analyzers (14)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
143internal bool WaitForOutstandingObjectsToBeFreed(TimeSpan timeout)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 112TimeSpan delay,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (2)
37private readonly TimeSpan _delay; 73TimeSpan delay,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
752or nameof(TimeSpan))
Microsoft.CodeAnalysis.AnalyzerUtilities (14)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
143internal bool WaitForOutstandingObjectsToBeFreed(TimeSpan timeout)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 112TimeSpan delay,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (2)
37private readonly TimeSpan _delay; 73TimeSpan delay,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
752or nameof(TimeSpan))
Microsoft.CodeAnalysis.CodeStyle (14)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
143internal bool WaitForOutstandingObjectsToBeFreed(TimeSpan timeout)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 112TimeSpan delay,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (2)
37private readonly TimeSpan _delay; 73TimeSpan delay,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
752or nameof(TimeSpan))
Microsoft.CodeAnalysis.CSharp (2)
CommandLine\CSharpCommandLineParser.cs (2)
295var timeout = TimeSpan.FromMinutes(2);
Microsoft.CodeAnalysis.Extensions.Package (2)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
143internal bool WaitForOutstandingObjectsToBeFreed(TimeSpan timeout)
Symbols\ITypeSymbolExtensions.cs (1)
752or nameof(TimeSpan))
Microsoft.CodeAnalysis.Features (85)
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)
29TimeSpan.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)
32TimeSpan.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)
58TimeSpan.Zero, 63var allFilesWorkerBackOffTimeSpan = UnitTestingSolutionCrawlerTimeSpan.AllFilesWorkerBackOff; 64var entireProjectWorkerBackOffTimeSpan = UnitTestingSolutionCrawlerTimeSpan.EntireProjectWorkerBackOff; 74var semanticBackOffTimeSpan = UnitTestingSolutionCrawlerTimeSpan.SemanticChangeBackOff; 75var 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)
162var timeout = TimeSpan.FromSeconds(5);
SemanticSearch\ExecuteQueryResult.cs (2)
27[property: DataMember(Order = 2)] TimeSpan ExecutionTime = default); 39[property: DataMember(Order = 2)] TimeSpan EmitTime = default);
Microsoft.CodeAnalysis.Features.ExternalAccess (2)
Copilot\SemanticSearch\ICopilotSemanticSearchQueryService.cs (2)
42TimeSpan ExecutionTime = default); 47TimeSpan EmitTime = default);
Microsoft.CodeAnalysis.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\UseAsyncMethodInAsyncContext.cs (1)
92IFieldSymbol? timeSpanZero = timeSpanType?.GetMembers(nameof(TimeSpan.Zero))
Microsoft.CodeAnalysis.ResxSourceGenerator (14)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
143internal bool WaitForOutstandingObjectsToBeFreed(TimeSpan timeout)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 112TimeSpan delay,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (2)
37private readonly TimeSpan _delay; 73TimeSpan delay,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
752or nameof(TimeSpan))
Microsoft.CodeAnalysis.Workspaces (44)
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)
62internal readonly struct AnalyzerPerformanceInfo(string analyzerId, bool builtIn, TimeSpan timeSpan) 71public 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)
PatternMatching\RegexPatternMatcher.cs (2)
42var timeout = TimeSpan.FromSeconds(1);
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\roslyn\src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
143internal bool WaitForOutstandingObjectsToBeFreed(TimeSpan timeout)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 112TimeSpan delay,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (2)
37private readonly TimeSpan _delay; 73TimeSpan delay,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
752or nameof(TimeSpan))
Telemetry\TelemetryLogging.cs (1)
140await Task.Delay(TimeSpan.FromMinutes(30), cancellationToken).ConfigureAwait(false);
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
163TimeSpan.FromMilliseconds(200), // 200 chosen with absolutely no evidence whatsoever
Workspace\ProjectSystem\ReferenceFileChangeTracker.cs (1)
48TimeSpan.FromSeconds(5),
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)
84TimeSpan.Zero, 97TimeSpan.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.Diagnostics.NETCore.Client (27)
DiagnosticsClient\DiagnosticsClient.cs (4)
46internal void WaitForConnection(TimeSpan timeout) 237public void AttachProfiler(TimeSpan attachTimeout, Guid profilerGuid, string profilerPath, byte[] additionalData = null) 248internal async Task AttachProfilerAsync(TimeSpan attachTimeout, Guid profilerGuid, string profilerPath, byte[] additionalData, CancellationToken token) 702private static IpcMessage CreateAttachProfilerMessage(TimeSpan attachTimeout, Guid profilerGuid, string profilerPath, byte[] additionalData)
DiagnosticsIpc\IpcClient.cs (2)
15internal static readonly TimeSpan ConnectTimeout = TimeSpan.FromSeconds(30);
DiagnosticsIpc\IpcSocket.cs (1)
50public virtual void Connect(EndPoint remoteEP, TimeSpan timeout)
DiagnosticsIpc\IpcTransport.cs (9)
28public abstract Stream Connect(TimeSpan timeout); 44public abstract void WaitForConnection(TimeSpan timeout); 58public static Stream Connect(IpcEndpointConfig config, TimeSpan timeout) 155public override Stream Connect(TimeSpan timeout) 165public override void WaitForConnection(TimeSpan timeout) 205public override Stream Connect(TimeSpan timeout) 215public override void WaitForConnection(TimeSpan timeout) 275public override Stream Connect(TimeSpan timeout) 289public override void WaitForConnection(TimeSpan timeout)
DiagnosticsIpc\IpcUnixDomainSocket.cs (1)
28public override void Connect(EndPoint localEP, TimeSpan timeout)
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (1)
363_webSocketServer = new ReversedDiagnosticsServer(_webSocketURL, ReversedDiagnosticsServer.Kind.WebSocket, TimeSpan.FromMilliseconds(750));
HandleableCollection.cs (2)
130public T Handle(TimeSpan timeout) => Handle(DefaultHandler, timeout); 139public T Handle(Handler handler, TimeSpan timeout)
ReversedServer\ReversedDiagnosticsServer.cs (7)
24private readonly TimeSpan ParseAdvertiseTimeout; 55ParseAdvertiseTimeout = TimeSpan.FromMilliseconds(250); 78ParseAdvertiseTimeout = TimeSpan.FromMilliseconds(250); 100public ReversedDiagnosticsServer(string address, Kind kind, TimeSpan timeout) 187public IpcEndpointInfo Accept(TimeSpan timeout) 329internal Stream Connect(Guid runtimeInstanceCookie, TimeSpan timeout) 345internal void WaitForConnection(Guid runtimeInstanceCookie, TimeSpan timeout)
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
154httpClient.Timeout = TimeSpan.FromSeconds(TimeoutInSeconds);
Microsoft.DotNet.Build.Tasks.FileCatalog (1)
CatalogBuilder.cs (1)
32new(2000, 1, 1, 0, 0, 0, TimeSpan.Zero);
Microsoft.DotNet.Build.Tasks.Installers (3)
src\ExecWithRetries.cs (2)
98TimeSpan delay = TimeSpan.FromSeconds(
src\RpmBuilder.cs (1)
223private static readonly DateTimeOffset UnixEpoch = new(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
Microsoft.DotNet.Cli.Definitions (11)
_generated\6\RegexGenerator.g.cs (2)
987internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
Commands\Test\TestCommandDefinition.MicrosoftTestingPlatform.cs (9)
100public readonly Option<TimeSpan?> TimeoutOption = new("--timeout") 312private static TimeSpan? ParseTimeout(ArgumentResult argumentResult) 329TimeSpan timeout; 334? TimeSpan.FromMilliseconds(number) 336? TimeSpan.FromSeconds(number) 338? TimeSpan.FromMinutes(number) 340? TimeSpan.FromHours(number) 341: TimeSpan.FromDays(number); 349if (timeout <= TimeSpan.Zero || timeout.TotalMilliseconds > MaxSupportedTimeoutMilliseconds)
Microsoft.DotNet.Cli.Telemetry (2)
Implementation\AzureMonitorTelemetrySerializer.cs (1)
259private static string FormatDuration(TimeSpan duration)
Implementation\PersistentStorageTelemetryUploader.cs (1)
83perBlobCts.CancelAfter(TimeSpan.FromMilliseconds(_leasePeriodMilliseconds));
Microsoft.DotNet.Cli.Utils (8)
ExponentialRetry.cs (6)
8public static IEnumerable<TimeSpan> Intervals 12yield return TimeSpan.FromSeconds(0); // first retry immediately 16yield return TimeSpan.FromSeconds(seconds); 22public static IEnumerable<TimeSpan> TestingIntervals 28yield return TimeSpan.FromSeconds(0); 79public static IEnumerable<Task> Timer(IEnumerable<TimeSpan> interval)
FileAccessRetrier.cs (2)
12TimeSpan sleepDuration = default) 18sleepDuration = TimeSpan.FromMilliseconds(10);
Microsoft.DotNet.HotReload.Utils.Generator (2)
Runners\LiveRunner.cs (2)
30var interval = TimeSpan.FromMilliseconds(250); /* FIXME: make this configurable */
Microsoft.DotNet.HotReload.Watch (24)
_generated\0\RegexGenerator.g.cs (2)
753internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
Context\EnvironmentOptions.cs (3)
33TimeSpan? ProcessCleanupTimeout = null, 69public TimeSpan GetProcessCleanupTimeout() 71=> ProcessCleanupTimeout ?? TimeSpan.FromSeconds(5);
Context\EnvironmentVariables.cs (5)
45public static TimeSpan? ProcessCleanupTimeout => ReadTimeSpanMilliseconds("DOTNET_WATCH_PROCESS_CLEANUP_TIMEOUT_MS"); 92internal static TimeSpan? ReadTimeSpanMilliseconds(string variableName) 93=> Environment.GetEnvironmentVariable(variableName) is var value && long.TryParse(value, out var intValue) && intValue >= 0 ? TimeSpan.FromMilliseconds(intValue) : null; 95internal static TimeSpan? ReadTimeSpanSeconds(string variableName) 96=> Environment.GetEnvironmentVariable(variableName) is var value && long.TryParse(value, out var intValue) && intValue >= 0 ? TimeSpan.FromSeconds(intValue) : null;
FileWatcher\PollingDirectoryWatcher.cs (2)
12private static readonly TimeSpan _minRunInternal = TimeSpan.FromSeconds(.5);
Process\ProcessRunner.cs (3)
11internal class ProcessRunner(TimeSpan processCleanupTimeout) 258private static async ValueTask<bool> WaitForExitAsync(Process process, ProcessState state, TimeSpan? timeout, ILogger logger) 305cancellationSource.CancelAfter(TimeSpan.FromSeconds(1));
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (1)
241KeepAliveInterval = TimeSpan.FromSeconds(PingIntervalInSeconds)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\AbstractBrowserRefreshServer.cs (6)
158var firstReportSeconds = TimeSpan.FromSeconds(60); 159var nextReportSeconds = TimeSpan.FromSeconds(10); 161var reportDelayInSeconds = firstReportSeconds; 170await Task.Delay(SuppressTimeouts ? TimeSpan.MaxValue : reportDelayInSeconds, progressCancellationSource.Token);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\KestrelWebSocketServer.cs (2)
105.WaitAsync(suppressTimeouts ? TimeSpan.MaxValue : TimeSpan.FromSeconds(10), cancellationToken);
Microsoft.DotNet.XliffTasks (3)
ExponentialRetry.cs (3)
18foreach (TimeSpan t in Intervals) 36private static IEnumerable<TimeSpan> Intervals 43yield return TimeSpan.FromMilliseconds(milliseconds);
Microsoft.Extensions.AI (20)
ChatCompletion\OpenTelemetryChatClient.cs (2)
192TimeSpan lastChunkElapsed = default; 226TimeSpan currentElapsed = stopwatch!.Elapsed;
ChatRouting\FailoverChatClient.cs (1)
184TimeSpan? timeToFirstUpdate = null;
ChatRouting\FailoverChatClientAttempt.cs (6)
35TimeSpan duration, 36TimeSpan? timeToFirstUpdate, 40Debug.Assert(duration >= TimeSpan.Zero, "Expected a non-negative duration."); 42timeToFirstUpdate is not { } ttfu || (ttfu >= TimeSpan.Zero && ttfu <= duration), 64public TimeSpan Duration { get; } 88public TimeSpan? TimeToFirstUpdate { get; }
Common\FunctionInvocationHelpers.cs (2)
35internal static TimeSpan GetElapsedTime(long startingTimestamp) => 39new((long)((Stopwatch.GetTimestamp() - startingTimestamp) * ((double)TimeSpan.TicksPerSecond / Stopwatch.Frequency)));
Common\FunctionInvocationLogger.cs (2)
21internal static partial void LogInvocationCompleted(ILogger logger, string methodName, TimeSpan duration); 24internal static partial void LogInvocationCompletedSensitive(ILogger logger, string methodName, TimeSpan duration, string result);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (6)
261private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.String, global::System.TimeSpan, global::System.Exception?> __LogInvocationCompletedCallback = 262global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.String, global::System.TimeSpan>(global::Microsoft.Extensions.Logging.LogLevel.Debug, new global::Microsoft.Extensions.Logging.EventId(1098781176, nameof(LogInvocationCompleted)), "{MethodName} invocation completed. Duration: {Duration}", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 265internal static partial void LogInvocationCompleted(global::Microsoft.Extensions.Logging.ILogger logger, global::System.String methodName, global::System.TimeSpan duration) 270private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.String, global::System.TimeSpan, global::System.String, global::System.Exception?> __LogInvocationCompletedSensitiveCallback = 271global::Microsoft.Extensions.Logging.LoggerMessage.Define<global::System.String, global::System.TimeSpan, global::System.String>(global::Microsoft.Extensions.Logging.LogLevel.Trace, new global::Microsoft.Extensions.Logging.EventId(700532736, nameof(LogInvocationCompletedSensitive)), "{MethodName} invocation completed. Duration: {Duration}. Result: {Result}", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 274internal static partial void LogInvocationCompletedSensitive(global::Microsoft.Extensions.Logging.ILogger logger, global::System.String methodName, global::System.TimeSpan duration, global::System.String result)
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\StringSyntaxAttribute\StringSyntaxAttribute.cs (1)
66/// <summary>The syntax identifier for strings containing <see cref="TimeSpan"/> format specifiers.</summary>
Microsoft.Extensions.AI.Abstractions (38)
ChatCompletion\ChatResponseExtensions.cs (1)
680private static readonly DateTimeOffset _unixEpoch = new(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
Generated\361d1da7f942c932\JsonContext.SpeechToTextResponseUpdate.g.cs (6)
93var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan?> 108AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.SpeechToTextResponseUpdate).GetProperty("StartTime", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan?), global::System.Array.Empty<global::System.Type>(), null), 111properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan?>(options, info2); 113var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan?> 128AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.SpeechToTextResponseUpdate).GetProperty("EndTime", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan?), global::System.Array.Empty<global::System.Type>(), null), 131properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan?>(options, info3);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (2)
500if (type == typeof(global::System.TimeSpan)) 504if (type == typeof(global::System.TimeSpan?))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.NullableTimeSpan.g.cs (9)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?>? _NullableTimeSpan; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?> NullableTimeSpan 24get => _NullableTimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?>)Options.GetTypeInfo(typeof(global::System.TimeSpan?)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?> Create_NullableTimeSpan(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan?>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?> jsonTypeInfo)) 31global::System.Text.Json.Serialization.JsonConverter converter = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetNullableConverter<global::System.TimeSpan>(options); 32jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan?>(options, converter);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.SpeechToTextResponse.g.cs (6)
53var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan?> 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.SpeechToTextResponse).GetProperty("StartTime", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan?), global::System.Array.Empty<global::System.Type>(), null), 71properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan?>(options, info0); 73var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan?> 88AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.SpeechToTextResponse).GetProperty("EndTime", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan?), global::System.Array.Empty<global::System.Type>(), null), 91properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan?>(options, info1);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.TimeSpan.g.cs (8)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 24get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 31jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\StringSyntaxAttribute\StringSyntaxAttribute.cs (1)
66/// <summary>The syntax identifier for strings containing <see cref="TimeSpan"/> format specifiers.</summary>
SpeechToText\SpeechToTextResponse.cs (2)
41public TimeSpan? StartTime { get; set; } 44public TimeSpan? EndTime { get; set; }
SpeechToText\SpeechToTextResponseUpdate.cs (2)
64public TimeSpan? StartTime { get; set; } 67public TimeSpan? EndTime { get; set; }
Utilities\AIJsonUtilities.Defaults.cs (1)
90[JsonSerializable(typeof(TimeSpan))]
Microsoft.Extensions.AI.Abstractions.Tests (140)
ChatCompletion\ChatMessageTests.cs (1)
380Assert.Equal(new DateTimeOffset(2024, 6, 1, 12, 0, 0, TimeSpan.Zero), result.CreatedAt);
ChatCompletion\ChatResponseTests.cs (14)
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); 92CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), 110Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), result.CreatedAt); 129CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), 148Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), result.CreatedAt); 214Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), result.CreatedAt); 246CreatedAt = new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), 259Assert.Equal(new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), update0.CreatedAt); 275CreatedAt = new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), 280CreatedAt = new DateTimeOffset(2025, 1, 1, 10, 30, 0, TimeSpan.Zero), 288CreatedAt = new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), 301Assert.Equal(new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), update0.CreatedAt); 310Assert.Equal(new DateTimeOffset(2025, 1, 1, 10, 30, 0, TimeSpan.Zero), update1.CreatedAt);
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (20)
31new(ChatRole.Assistant, "Hello") { ResponseId = "someResponse", MessageId = "12345", CreatedAt = new DateTimeOffset(2024, 2, 3, 4, 5, 6, TimeSpan.Zero), ModelId = "model123" }, 33new(null, "world!") { CreatedAt = new DateTimeOffset(2025, 2, 3, 4, 5, 6, TimeSpan.Zero), ConversationId = "123", AdditionalProperties = new() { ["c"] = "d" } }, 49Assert.Equal(new DateTimeOffset(2024, 2, 3, 4, 5, 6, TimeSpan.Zero), response.CreatedAt); 541new(null, "Hi! ") { CreatedAt = new DateTimeOffset(2023, 1, 1, 10, 0, 0, TimeSpan.Zero), AuthorName = "Assistant" }, 542new(ChatRole.Assistant, "Hello") { MessageId = "msg1", CreatedAt = new DateTimeOffset(2024, 1, 1, 10, 0, 0, TimeSpan.Zero), AuthorName = "Assistant" }, 543new(null, " from") { MessageId = "msg1", CreatedAt = new DateTimeOffset(2024, 1, 1, 10, 1, 0, TimeSpan.Zero) }, // Later CreatedAt should not overwrite first 547new(null, "More text") { MessageId = "msg2", CreatedAt = new DateTimeOffset(2024, 1, 1, 10, 2, 0, TimeSpan.Zero), AuthorName = "Assistant" }, 550new(ChatRole.User, "How") { MessageId = "msg3", CreatedAt = new DateTimeOffset(2024, 1, 1, 11, 0, 0, TimeSpan.Zero), AuthorName = "User" }, 551new(null, " are") { MessageId = "msg3", CreatedAt = new DateTimeOffset(2024, 1, 1, 11, 1, 0, TimeSpan.Zero) }, 555new(ChatRole.Assistant, "I'm doing well,") { MessageId = "msg4", CreatedAt = new DateTimeOffset(2024, 1, 1, 12, 0, 0, TimeSpan.Zero) }, 556new(null, " thank you!") { MessageId = "msg4", CreatedAt = new DateTimeOffset(2024, 1, 1, 12, 2, 0, TimeSpan.Zero) }, // Later CreatedAt should not overwrite first 574Assert.Equal(new DateTimeOffset(2023, 1, 1, 10, 0, 0, TimeSpan.Zero), message1.CreatedAt); // First value should win 582Assert.Equal(new DateTimeOffset(2024, 1, 1, 10, 2, 0, TimeSpan.Zero), message2.CreatedAt); 590Assert.Equal(new DateTimeOffset(2024, 1, 1, 11, 0, 0, TimeSpan.Zero), message3.CreatedAt); // First value should win 598Assert.Equal(new DateTimeOffset(2024, 1, 1, 12, 0, 0, TimeSpan.Zero), message4.CreatedAt); // First value should win 824DateTimeOffset early = new(2024, 1, 1, 10, 0, 0, TimeSpan.Zero); 825DateTimeOffset middle = new(2024, 1, 1, 11, 0, 0, TimeSpan.Zero); 826DateTimeOffset late = new(2024, 1, 1, 12, 0, 0, TimeSpan.Zero); 827DateTimeOffset unixEpoch = new(1970, 1, 1, 0, 0, 0, TimeSpan.Zero); 828DateTimeOffset beforeEpoch = new(1969, 12, 31, 23, 59, 59, TimeSpan.Zero);
ChatCompletion\ChatResponseUpdateTests.cs (8)
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); 132CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), 165Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), result.CreatedAt); 195CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), 229Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), result.CreatedAt); 248var originalCreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero); 447Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), result.CreatedAt);
Contents\HostedFileContentTests.cs (1)
265Assert.Equal(new DateTimeOffset(2024, 1, 15, 10, 30, 0, TimeSpan.Zero), hostedFile.CreatedAt);
Embeddings\EmbeddingTests.cs (1)
126Assert.Equal(new DateTimeOffset(2024, 1, 1, 0, 0, 0, TimeSpan.Zero), floatEmbedding.CreatedAt);
Generated\361d1da7f942c932\JsonContext.CreateJsonSchema_IncorporatesTypesAndAnnotations_Type.g.cs (3)
113var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan> 128AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.CreateJsonSchema_IncorporatesTypesAndAnnotations_Type).GetProperty("TimeSpanProp", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null), 131properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info3);
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (2)
498if (type == typeof(global::System.TimeSpan)) 502if (type == typeof(global::System.TimeSpan?))
Generated\361d1da7f942c932\TestJsonSerializerContext.NullableTimeSpan.g.cs (9)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?>? _NullableTimeSpan; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?> NullableTimeSpan 22get => _NullableTimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?>)Options.GetTypeInfo(typeof(global::System.TimeSpan?)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?> Create_NullableTimeSpan(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan?>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan?> jsonTypeInfo)) 29global::System.Text.Json.Serialization.JsonConverter converter = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetNullableConverter<global::System.TimeSpan>(options); 30jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan?>(options, converter);
Generated\361d1da7f942c932\TestJsonSerializerContext.SpeechToTextResponse.g.cs (6)
51var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan?> 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.SpeechToTextResponse).GetProperty("StartTime", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan?), global::System.Array.Empty<global::System.Type>(), null), 69properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan?>(options, info0); 71var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan?> 86AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.SpeechToTextResponse).GetProperty("EndTime", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan?), global::System.Array.Empty<global::System.Type>(), null), 89properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan?>(options, info1);
Generated\361d1da7f942c932\TestJsonSerializerContext.SpeechToTextResponseUpdate.g.cs (6)
91var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan?> 106AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.SpeechToTextResponseUpdate).GetProperty("StartTime", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan?), global::System.Array.Empty<global::System.Type>(), null), 109properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan?>(options, info2); 111var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan?> 126AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.SpeechToTextResponseUpdate).GetProperty("EndTime", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan?), global::System.Array.Empty<global::System.Type>(), null), 129properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan?>(options, info3);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
104if (type == typeof(global::System.TimeSpan))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.TimeSpan.g.cs (8)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 24get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 31jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestJsonSerializerContext.TimeSpan.g.cs (8)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 22get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 29jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.GetJsonTypeInfo.g.cs (1)
356if (type == typeof(global::System.TimeSpan))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.TimeSpan.g.cs (8)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 24get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 31jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\StringSyntaxAttribute\StringSyntaxAttribute.cs (1)
66/// <summary>The syntax identifier for strings containing <see cref="TimeSpan"/> format specifiers.</summary>
parent\parent\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))]
SpeechToText\SpeechToTextResponseTests.cs (14)
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); 281Assert.Equal(TimeSpan.FromSeconds(1), result.StartTime); 282Assert.Equal(TimeSpan.FromSeconds(5), result.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 (8)
51update.StartTime = TimeSpan.FromSeconds(10); 52update.EndTime = TimeSpan.FromSeconds(20); 53Assert.Equal(TimeSpan.FromSeconds(10), update.StartTime); 54Assert.Equal(TimeSpan.FromSeconds(20), update.EndTime); 89StartTime = TimeSpan.FromSeconds(5), 90EndTime = TimeSpan.FromSeconds(10), 141Assert.Equal(TimeSpan.FromSeconds(1), result.StartTime); 142Assert.Equal(TimeSpan.FromSeconds(5), result.EndTime);
Utilities\AIJsonUtilitiesTests.cs (3)
1123public TimeSpan TimeSpanProp { get; set; } 1482string key3 = AIJsonUtilities.HashDataToString([TimeSpan.FromSeconds(1), null, 1.23], options); 1483string key4 = AIJsonUtilities.HashDataToString([TimeSpan.FromSeconds(1), null, 1.23], options);
Microsoft.Extensions.AI.Evaluation (11)
EvaluationMetricExtensions.cs (2)
153TimeSpan? duration = null) 200public static void AddOrUpdateDurationMetadata(this EvaluationMetric metric, TimeSpan duration)
EvaluationResultExtensions.cs (2)
182TimeSpan? duration = null) 202public static void AddOrUpdateDurationMetadataInAllMetrics(this EvaluationResult result, TimeSpan duration)
Utilities\TimingHelper.cs (7)
13internal static string ToMillisecondsText(this TimeSpan duration) => 16internal static TimeSpan ExecuteWithTiming(Action operation) 32internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 66internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 82internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>( 100internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>(
Microsoft.Extensions.AI.Evaluation.Console (14)
parent\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (7)
13internal static string ToMillisecondsText(this TimeSpan duration) => 16internal static TimeSpan ExecuteWithTiming(Action operation) 32internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 66internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 82internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>( 100internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>(
Telemetry\TelemetryExtensions.cs (7)
38TimeSpan duration = TimingHelper.ExecuteWithTiming(operation); 58(TResult result, TimeSpan duration) = TimingHelper.ExecuteWithTiming(operation); 80TimeSpan duration = await TimingHelper.ExecuteWithTimingAsync(operation).ConfigureAwait(false); 100TimeSpan duration = await TimingHelper.ExecuteWithTimingAsync(operation).ConfigureAwait(false); 120(TResult result, TimeSpan duration) = 143(TResult result, TimeSpan duration) = 159TimeSpan duration,
Microsoft.Extensions.AI.Evaluation.NLP (10)
BLEUEvaluator.cs (1)
81(double score, TimeSpan duration) =
F1Evaluator.cs (1)
72(double score, TimeSpan duration) =
GLEUEvaluator.cs (1)
81(double score, TimeSpan duration) =
parent\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (7)
13internal static string ToMillisecondsText(this TimeSpan duration) => 16internal static TimeSpan ExecuteWithTiming(Action operation) 32internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 66internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 82internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>( 100internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>(
Microsoft.Extensions.AI.Evaluation.Quality (22)
CoherenceEvaluator.cs (1)
93(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
CompletenessEvaluator.cs (1)
98(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
EquivalenceEvaluator.cs (1)
101(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) = 324TimeSpan evaluationDuration,
parent\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (7)
13internal static string ToMillisecondsText(this TimeSpan duration) => 16internal static TimeSpan ExecuteWithTiming(Action operation) 32internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 66internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 82internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>( 100internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>(
RelevanceEvaluator.cs (1)
98(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
RelevanceTruthAndCompletenessEvaluator.cs (2)
120(ChatResponse evaluationResponse, TimeSpan evaluationDuration) = 272TimeSpan evaluationDuration,
RetrievalEvaluator.cs (1)
114(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
TaskAdherenceEvaluator.cs (1)
142(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
ToolCallAccuracyEvaluator.cs (1)
142(ChatResponse evaluationResponse, TimeSpan evaluationDuration) =
Microsoft.Extensions.AI.Evaluation.Reporting (32)
ChatTurnDetails.cs (3)
19public TimeSpan Latency { get; set; } 87TimeSpan latency, 127TimeSpan 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);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.ChatTurnDetails.g.cs (6)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails((global::System.TimeSpan)args[0], (string)args[1], (string)args[2], (global::Microsoft.Extensions.AI.UsageDetails)args[3], (string)args[4], (bool?)args[5]), 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(global::System.TimeSpan), typeof(string), typeof(string), typeof(global::Microsoft.Extensions.AI.UsageDetails), typeof(string), typeof(bool?)}, modifiers: null), 53var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan> 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetProperty("Latency", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null), 71properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info0); 226ParameterType = typeof(global::System.TimeSpan),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
312if (type == typeof(global::System.TimeSpan))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.TimeSpan.g.cs (8)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 24get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 31jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
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 74TimeSpan? timeToLiveForCacheEntries = null,
Storage\DiskBasedResponseCache.cs (2)
32private readonly TimeSpan _timeToLiveForCacheEntries; 39TimeSpan? timeToLiveForCacheEntries = null)
Storage\DiskBasedResponseCacheProvider.cs (3)
20/// An optional <see cref="TimeSpan"/> that specifies the maximum amount of time that cached AI responses should 25TimeSpan? timeToLiveForCacheEntries = null) : IEvaluationResponseCacheProvider 35TimeSpan? timeToLiveForCacheEntries = null)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (26)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.ChatTurnDetails.g.cs (6)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails((global::System.TimeSpan)args[0], (string)args[1], (string)args[2], (global::Microsoft.Extensions.AI.UsageDetails)args[3], (string)args[4], (bool?)args[5]), 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(global::System.TimeSpan), typeof(string), typeof(string), typeof(global::Microsoft.Extensions.AI.UsageDetails), typeof(string), typeof(bool?)}, modifiers: null), 53var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan> 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetProperty("Latency", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null), 71properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info0); 226ParameterType = typeof(global::System.TimeSpan),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
304if (type == typeof(global::System.TimeSpan))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.TimeSpan.g.cs (8)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 24get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 31jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
parent\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 74TimeSpan? timeToLiveForCacheEntries = null,
Storage\AzureStorageResponseCache.cs (2)
28TimeSpan? timeToLiveForCacheEntries = null) : IDistributedCache 39private readonly TimeSpan _timeToLiveForCacheEntries =
Storage\AzureStorageResponseCacheProvider.cs (3)
21/// An optional <see cref="TimeSpan"/> that specifies the maximum amount of time that cached AI responses should 26TimeSpan? timeToLiveForCacheEntries = null) : IEvaluationResponseCacheProvider 36TimeSpan? 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)
119await Task.Delay(TimeSpan.FromMilliseconds(500)); 129await Task.Delay(TimeSpan.FromMilliseconds(500));
ScenarioRunResultTests.cs (5)
66latency: TimeSpan.FromSeconds(1), 75latency: TimeSpan.FromSeconds(2), 158latency: TimeSpan.FromSeconds(1), 167latency: TimeSpan.FromSeconds(2), 333expiration: DateTime.UtcNow.Add(TimeSpan.FromMinutes(5)));
Microsoft.Extensions.AI.Evaluation.Safety (9)
ContentSafetyEvaluator.cs (1)
135(ChatResponse annotationResponse, TimeSpan annotationDuration) =
ContentSafetyService.cs (1)
373TimeSpan elapsedDuration = stopwatch.Elapsed;
parent\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (7)
13internal static string ToMillisecondsText(this TimeSpan duration) => 16internal static TimeSpan ExecuteWithTiming(Action operation) 32internal static (TResult result, TimeSpan duration) ExecuteWithTiming<TResult>(Func<TResult> operation) 50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation) 66internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<ValueTask> operation) 82internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>( 100internal static async ValueTask<(TResult result, TimeSpan duration)> ExecuteWithTimingAsync<TResult>(
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
460AIFunctionFactory.Create((TimeSpan ts) => ts, createOptions()),
Microsoft.Extensions.AI.OpenAI (2)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (2)
145internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
Microsoft.Extensions.AI.OpenAI.Tests (14)
OpenAIConversionTests.cs (12)
888ChatMessageRole.User, null, null, null, new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 898Assert.Equal(new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), response.CreatedAt); 929Assert.Equal(new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), response.CreatedAt); 954null, null, null, OpenAI.Chat.ChatFinishReason.ToolCalls, new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 1529CreatedAt = new DateTimeOffset(2025, 1, 3, 14, 30, 0, TimeSpan.Zero), 1544Assert.Equal(new DateTimeOffset(2025, 1, 3, 14, 30, 0, TimeSpan.Zero), completion.CreatedAt); 1691createdAt: new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 1718CreatedAt = new DateTimeOffset(2025, 1, 1, 12, 0, 0, TimeSpan.Zero) 1733Assert.Equal(new DateTimeOffset(2025, 1, 1, 12, 0, 0, TimeSpan.Zero), streamingUpdate.CreatedAt); 1984CreatedAt = new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 2011CreatedAt = new DateTimeOffset(2025, 1, 15, 10, 30, 0, TimeSpan.Zero), 2020Assert.Equal(new DateTimeOffset(2025, 1, 15, 10, 30, 0, TimeSpan.Zero), openAIResponse.CreatedAt);
OpenAISpeechToTextClientTests.cs (2)
332Assert.Equal(TimeSpan.Zero, updates[1].StartTime); 333Assert.Equal(TimeSpan.FromSeconds(2.5), updates[1].EndTime);
Microsoft.Extensions.AI.Stabilization.Tests (1)
parent\Microsoft.Extensions.AI.Abstractions.Tests\Contents\HostedFileContentTests.cs (1)
265Assert.Equal(new DateTimeOffset(2024, 1, 15, 10, 30, 0, TimeSpan.Zero), hostedFile.CreatedAt);
Microsoft.Extensions.AI.Templates.Tests (4)
TestCommand.cs (3)
20public TimeSpan? Timeout { get; set; } 105var elapsedTime = Stopwatch.GetElapsedTime(startTimestamp); 119var elapsedTime = Stopwatch.GetElapsedTime(startTimestamp);
TestCommandExtensions.cs (1)
24public static TCommand WithTimeout<TCommand>(this TCommand command, TimeSpan timeout)
Microsoft.Extensions.AI.Tests (2)
ChatRouting\FailoverChatClientTests.cs (1)
400Assert.True(failedAttempt.Duration >= TimeSpan.Zero);
Embeddings\DistributedCachingEmbeddingGeneratorTest.cs (1)
92CreatedAt = DateTimeOffset.Parse("2024-08-01T00:00:00Z", DateTimeFormatInfo.InvariantInfo) + TimeSpan.FromHours(i),
Microsoft.Extensions.Caching.Abstractions (27)
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\HybridCacheEntryContext.cs (2)
50public TimeSpan? Expiration 70public TimeSpan? LocalCacheExpiration
Hybrid\HybridCacheEntryOptions.cs (2)
28public TimeSpan? Expiration { get; init; } 37public 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; 121_defaultExpiration = defaultEntryOptions?.Expiration ?? TimeSpan.FromMinutes(DefaultExpirationMinutes); 222internal TimeSpan GetL1AbsoluteExpirationRelativeToNow(HybridCacheEntryOptions? options) 225internal TimeSpan GetL2AbsoluteExpirationRelativeToNow(HybridCacheEntryOptions? options) => options?.Expiration ?? _defaultExpiration; 239private static TimeSpan? GetEffectiveLocalCacheExpiration(HybridCacheEntryOptions? options)
Internal\DefaultHybridCache.L2.cs (4)
21private static readonly DistributedCacheEntryOptions _tagInvalidationEntryOptions = new() { AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(MaxCacheDays) }; 179internal void SetL1<T>(string key, CacheItem<T> value, HybridCacheEntryOptions? options, TimeSpan maxRelativeTime) 191var expiry = GetL1AbsoluteExpirationRelativeToNow(options); 263TimeSpan expiration = GetL2AbsoluteExpirationRelativeToNow(options);
Internal\DefaultHybridCache.StampedeStateT.cs (4)
227result.AsArraySegment(), Key.Key, CacheItem.Tags, Cache, out ArraySegment<byte> payload, out TimeSpan remainingTime, 438private void SetResultAndRecycleIfAppropriate(ref BufferChunk value, TimeSpan remainingTime) 524private void SetResult(CacheItem<T> value) => SetResult(value, TimeSpan.MaxValue); 526private void SetResult(CacheItem<T> value, TimeSpan maxRelativeTime)
Internal\DefaultHybridCache.TagInvalidation.cs (2)
196internal static TimeSpan TicksToTimeSpan(long ticks) => TimeSpan.FromTicks(ticks);
Internal\HybridCachePayload.cs (3)
102string key, long creationTime, TimeSpan duration, PayloadFlags flags, TagSet tags, ReadOnlySequence<byte> payload) 174out ArraySegment<byte> payload, out TimeSpan remainingTime, out PayloadFlags flags, out ushort entropy, out TagSet pendingTags, out Exception? fault) 182remainingTime = TimeSpan.Zero;
Microsoft.Extensions.Caching.Hybrid.Tests (56)
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)
28HybridCacheEntryOptions options = new() { Expiration = TimeSpan.FromMinutes(2), LocalCacheExpiration = TimeSpan.FromMinutes(1) }; 44clock.Add(TimeSpan.FromSeconds(45)); // should still be fine from L1 (L1 has 1 minute expiration) 47clock.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) 50clock.Add(TimeSpan.FromSeconds(45)); // should now be expired
L2Tests.cs (2)
23private static readonly HybridCacheEntryOptions _expiry = new() { Expiration = TimeSpan.FromMinutes(3.5) }; 25private static readonly HybridCacheEntryOptions _expiryNoL1 = new() { Flags = HybridCacheEntryFlags.DisableLocalCache, Expiration = TimeSpan.FromMinutes(3.5) };
LogCollector.cs (1)
34public async Task WaitForLogsAsync(int[] expectedErrorIds, TimeSpan timeout)
PayloadTests.cs (24)
51int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 56clock.Add(TimeSpan.FromSeconds(10)); 57var 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 _); 81int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 85clock.Add(TimeSpan.FromSeconds(58)); 86var 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 _); 91clock.Add(TimeSpan.FromSeconds(4)); 115int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 119clock.Add(TimeSpan.FromSeconds(2)); 122var 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 _); 145int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 149clock.Add(TimeSpan.FromSeconds(2)); 152var 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 _); 182int actualLength = HybridCachePayload.Write(oversized, key, creation, TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 186clock.Add(TimeSpan.FromSeconds(2)); 190var 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 _); 212var 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 _); 235int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 239var 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 _); 262int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, tags, new(bytes)); 266var 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 _); 348int actualLength = HybridCachePayload.Write(oversized, key, cache.CurrentTimestamp(), TimeSpan.FromMinutes(1), 0, writeTags, new(bytes)); 351clock.Add(TimeSpan.FromSeconds(10)); 361out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _);
RedisTests.cs (1)
85TimeSpan? ttl = null;
ServiceConstructionTests.cs (9)
42options.DefaultEntryOptions = new() { Expiration = TimeSpan.FromSeconds(120), Flags = HybridCacheEntryFlags.DisableLocalCacheRead }; 50Assert.Equal(TimeSpan.FromSeconds(120), defaults.Expiration); 304Assert.Equal(TimeSpan.FromSeconds(120), defaults.LocalCacheExpiration); 596Expiration = defaultExpiration is null ? null : TimeSpan.FromMinutes(defaultExpiration.GetValueOrDefault()), 597LocalCacheExpiration = defaultLocalCacheExpiration is null ? null : TimeSpan.FromMinutes(defaultLocalCacheExpiration.GetValueOrDefault()), 611Expiration = perItemExpiration is null ? null : TimeSpan.FromMinutes(perItemExpiration.GetValueOrDefault()), 612LocalCacheExpiration = perItemLocalCacheExpiration is null ? null : TimeSpan.FromMinutes(perItemLocalCacheExpiration.GetValueOrDefault()), 618Assert.Equal(TimeSpan.FromMinutes(expectedExpiration ?? DefaultHybridCache.DefaultExpirationMinutes), cache.GetL2AbsoluteExpirationRelativeToNow(itemOptions)); 619Assert.Equal(TimeSpan.FromMinutes(expectedLocalCacheExpiration ?? DefaultHybridCache.DefaultExpirationMinutes), cache.GetL1AbsoluteExpirationRelativeToNow(itemOptions));
TestEventListener.cs (1)
182await Task.Delay(TimeSpan.FromSeconds(EventCounterIntervalSec * 2));
UnreliableL2Tests.cs (1)
48await log.WaitForLogsAsync(errorIds, TimeSpan.FromSeconds(5));
Microsoft.Extensions.Caching.Memory (9)
CacheEntry.cs (7)
23private TimeSpan _absoluteExpirationRelativeToNow; 24private TimeSpan _slidingExpiration; 72var offset = new TimeSpan(_absoluteExpirationOffsetMinutes * TimeSpan.TicksPerMinute); 91internal TimeSpan AbsoluteExpirationRelativeToNow => _absoluteExpirationRelativeToNow; 93TimeSpan? ICacheEntry.AbsoluteExpirationRelativeToNow 117public TimeSpan? SlidingExpiration
MemoryCacheOptions.cs (2)
29public TimeSpan ExpirationScanFrequency { get; set; } = TimeSpan.FromMinutes(1);
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)
26public TimeSpan? ExpiredItemsDeletionInterval { get; set; } 49public TimeSpan DefaultSlidingExpiration { get; set; } = TimeSpan.FromMinutes(20);
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.Compliance.Redaction (10)
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\StringSyntaxAttribute\StringSyntaxAttribute.cs (1)
66/// <summary>The syntax identifier for strings containing <see cref="TimeSpan"/> format specifiers.</summary>
parent\parent\parent\eng\MSBuild\parent\parent\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)
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\StringSyntaxAttribute\StringSyntaxAttribute.cs (1)
66/// <summary>The syntax identifier for strings containing <see cref="TimeSpan"/> format specifiers.</summary>
Microsoft.Extensions.Configuration.Binder.SourceGeneration (1)
Parser\KnownTypeSymbols.cs (1)
83TimeSpan = compilation.GetBestTypeByMetadataName(typeof(TimeSpan));
Microsoft.Extensions.DataIngestion.Tests (1)
Readers\DocumentReaderConformanceTests.cs (1)
17private static readonly HttpClient _httpClient = new() { Timeout = TimeSpan.FromSeconds(30) };
Microsoft.Extensions.Diagnostics (2)
Metrics\DebugConsoleMetricListener.cs (2)
34_timer.Change(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1));
Microsoft.Extensions.Diagnostics.ExceptionSummarization.Tests (2)
ExceptionSummarizerTests.cs (1)
212using var tokenSource = new CancellationTokenSource(TimeSpan.Zero);
HttpExceptionSummaryProviderTests.cs (1)
120using var tokenSource = new CancellationTokenSource(TimeSpan.Zero);
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) => 229public static void HealthCheckEnd(ILogger logger, HealthCheckRegistration registration, HealthReportEntry entry, TimeSpan duration) 250public 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) => 276public 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\aspnetcore\src\Shared\NonCapturingTimer\NonCapturingTimer.cs (2)
16public static Timer Create(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
src\aspnetcore\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.ResourceUtilization (15)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\BindingExtensions.g.cs (3)
270public static global::System.TimeSpan ParseSystemTimeSpan(string value, string? path) 274return global::System.TimeSpan.Parse(value, CultureInfo.InvariantCulture); 278throw new InvalidOperationException($"Failed to convert configuration value '{value ?? "null"}' at '{path}' to type '{typeof(global::System.TimeSpan)}'.", exception);
parent\parent\parent\eng\MSBuild\parent\parent\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)
ResourceUtilizationHealthCheckOptions.cs (3)
18internal static readonly TimeSpan DefaultSamplingWindow = TimeSpan.FromSeconds(5); 50public TimeSpan SamplingWindow { get; set; } = DefaultSamplingWindow;
Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization.Tests (32)
ResourceHealthCheckExtensionsTests.cs (30)
34TimeSpan samplingWindow = TimeSpan.FromSeconds(1); 54TimeSpan samplingWindow = TimeSpan.FromSeconds(1); 74TimeSpan samplingWindow = TimeSpan.FromSeconds(1); 98TimeSpan samplingWindow = TimeSpan.FromSeconds(1); 133TimeSpan samplingWindow = TimeSpan.FromSeconds(1); 153TimeSpan samplingWindow = TimeSpan.FromSeconds(1); 188TimeSpan samplingWindow = TimeSpan.FromSeconds(1); 229TimeSpan samplingWindow = TimeSpan.FromSeconds(1); 272TimeSpan samplingWindow = TimeSpan.FromSeconds(1); 316TimeSpan samplingWindow = TimeSpan.FromSeconds(5); 350TimeSpan samplingWindow = TimeSpan.FromSeconds(5); 387TimeSpan samplingWindow = TimeSpan.FromSeconds(5); 423TimeSpan samplingWindow = TimeSpan.FromSeconds(1); 445TimeSpan samplingWindow = TimeSpan.FromSeconds(5); 527new ResourceMonitoringOptions { CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(1) }, 551fakeClock.Advance(TimeSpan.FromMilliseconds(1));
ResourceHealthCheckTests.cs (2)
22var samplingWindow = TimeSpan.FromSeconds(1);
Microsoft.Extensions.Diagnostics.Probes (14)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\BindingExtensions.g.cs (3)
252public static global::System.TimeSpan ParseSystemTimeSpan(string value, Func<string?> getPath) 256return global::System.TimeSpan.Parse(value, CultureInfo.InvariantCulture); 260throw new InvalidOperationException($"Failed to convert configuration value at '{getPath()}' to type '{typeof(global::System.TimeSpan)}'.", exception);
parent\parent\parent\eng\MSBuild\parent\parent\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)
44public 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 (56)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\BindingExtensions.g.cs (3)
270public static global::System.TimeSpan ParseSystemTimeSpan(string value, Func<string?> getPath) 274return global::System.TimeSpan.Parse(value, CultureInfo.InvariantCulture); 278throw new InvalidOperationException($"Failed to convert configuration value at '{getPath()}' to type '{typeof(global::System.TimeSpan)}'.", exception);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Logging.g.cs (3)
77public static partial void SnapshotReceived(this global::Microsoft.Extensions.Logging.ILogger logger, global::System.TimeSpan totalTimeSinceStart, global::System.TimeSpan kernelTimeSinceStart, global::System.TimeSpan userTimeSinceStart, ulong memoryUsageInBytes)
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)
28TimeSpan totalTimeSinceStart, 29TimeSpan kernelTimeSinceStart, 30TimeSpan userTimeSinceStart,
parent\parent\parent\eng\MSBuild\parent\parent\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)
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)
23public TimeSpan TotalTimeSinceStart { get; } 28public TimeSpan KernelTimeSinceStart { get; } 33public TimeSpan UserTimeSinceStart { get; } 48TimeSpan totalTimeSinceStart, 49TimeSpan kernelTimeSinceStart, 50TimeSpan userTimeSinceStart, 73TimeSpan kernelTimeSinceStart, 74TimeSpan userTimeSinceStart, 81TotalTimeSinceStart = TimeSpan.FromTicks(timeProvider.GetUtcNow().Ticks);
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)
19private const double TicksPerSecondDouble = TimeSpan.TicksPerSecond; 32private readonly TimeSpan _cpuRefreshInterval; 33private readonly TimeSpan _memoryRefreshInterval; 164TimeSpan.FromTicks(_timeProvider.GetUtcNow().Ticks), 165TimeSpan.FromTicks(basicAccountingInfo.TotalKernelTime), 166TimeSpan.FromTicks(basicAccountingInfo.TotalUserTime),
Windows\WindowsSnapshotProvider.cs (3)
32private readonly TimeSpan _cpuRefreshInterval; 33private readonly TimeSpan _memoryRefreshInterval; 110totalTimeSinceStart: TimeSpan.FromTicks(_timeProvider.GetUtcNow().Ticks),
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes.Tests (4)
Linux\AcceptanceTest.cs (2)
93MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 94CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2),
Windows\AcceptanceTest.cs (2)
114MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 115CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2),
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (208)
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);
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)
142options.CollectionWindow = TimeSpan.FromSeconds(SamplingWindowValue); 143options.PublishingWindow = TimeSpan.FromSeconds(CalculationPeriodValue); 151Assert.Equal(TimeSpan.FromSeconds(SamplingWindowValue), options!.Value.CollectionWindow); 152Assert.Equal(TimeSpan.FromSeconds(CalculationPeriodValue), options!.Value.PublishingWindow); 168= TimeSpan.FromSeconds(SamplingWindowValue).ToString(), 170= TimeSpan.FromSeconds(SamplingPeriodValue).ToString(), 172= TimeSpan.FromSeconds(CalculationPeriod).ToString() 193Assert.Equal(TimeSpan.FromSeconds(SamplingWindowValue), options!.Value.CollectionWindow); 194Assert.Equal(TimeSpan.FromSeconds(SamplingPeriodValue), options!.Value.SamplingInterval); 195Assert.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 (79)
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) 268clock.Advance(TimeSpan.FromMilliseconds(1)); 285CollectionWindow = TimeSpan.FromMilliseconds(100), 286PublishingWindow = TimeSpan.FromMilliseconds(100) 326CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod), 327PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod), 328SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 347clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 369CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod), 370PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod), 371SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 385clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 406TimeSpan.FromTicks(clock.GetUtcNow().Ticks), 407TimeSpan.Zero, 408TimeSpan.Zero, 420TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod).Ticks), 421TimeSpan.FromMilliseconds(250), 422TimeSpan.FromMilliseconds(250), 425TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 2).Ticks), 426TimeSpan.FromMilliseconds(250), 427TimeSpan.FromMilliseconds(250), 430TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 3).Ticks), 431TimeSpan.FromMilliseconds(250), 432TimeSpan.FromMilliseconds(250), 435TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 4).Ticks), 436TimeSpan.FromMilliseconds(250), 437TimeSpan.FromMilliseconds(250), 440TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 5).Ticks), 441TimeSpan.FromMilliseconds(250), 442TimeSpan.FromMilliseconds(250), 455CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 456PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 457SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 483clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 489clock.Advance(TimeSpan.FromTicks(1)); 513TimeSpan.FromTicks(clock.GetUtcNow().Ticks), 514TimeSpan.FromMilliseconds(250), 515TimeSpan.FromMilliseconds(250), 526TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod).Ticks), 527TimeSpan.FromMilliseconds(250), 528TimeSpan.FromMilliseconds(250), 531TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 2).Ticks), 532TimeSpan.FromMilliseconds(250), 533TimeSpan.FromMilliseconds(250), 536TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 3).Ticks), 537TimeSpan.FromMilliseconds(250), 538TimeSpan.FromMilliseconds(250), 541TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 4).Ticks), 542TimeSpan.FromMilliseconds(250), 543TimeSpan.FromMilliseconds(250), 546TimeSpan.FromTicks(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 5).Ticks), 547TimeSpan.FromMilliseconds(250), 548TimeSpan.FromMilliseconds(250), 564CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 565PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 566SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 592clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 661TimeSpan.FromTicks(_clock.GetUtcNow().Ticks), 662TimeSpan.FromSeconds(1), 663TimeSpan.FromSeconds(1), 671CollectionWindow = TimeSpan.FromSeconds(1), 672SamplingInterval = TimeSpan.FromMilliseconds(100), 673PublishingWindow = TimeSpan.FromSeconds(1) 681var exception = Record.Exception(() => _ = tracker.GetUtilization(TimeSpan.FromSeconds(1))); 696CollectionWindow = TimeSpan.FromSeconds(6), 697PublishingWindow = TimeSpan.FromSeconds(5) 705var exception = Record.Exception(() => tracker.GetUtilization(TimeSpan.FromSeconds(6))); 720CollectionWindow = TimeSpan.FromSeconds(5) 728var 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)
29var fakeTimeProvider = new FakeTimeProvider { AutoAdvanceAmount = TimeSpan.FromSeconds(60) }; 76var fakeTimeProvider = new FakeTimeProvider { AutoAdvanceAmount = TimeSpan.FromSeconds(30) };
Windows\Disk\WindowsDiskIoTimePerfCounterTests.cs (1)
29var fakeTimeProvider = new FakeTimeProvider { AutoAdvanceAmount = TimeSpan.FromSeconds(60) };
Windows\Disk\WindowsDiskMetricsTests.cs (8)
87fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 97fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 106fakeTimeProvider.Advance(TimeSpan.FromSeconds(30)); 115fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 161fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 171fakeTimeProvider.Advance(TimeSpan.FromMinutes(1)); 180fakeTimeProvider.Advance(TimeSpan.FromSeconds(30)); 189fakeTimeProvider.Advance(TimeSpan.FromMinutes(1));
Windows\Tcp6TableInfoTests.cs (2)
24public static readonly TimeSpan DefaultTimeSpan = TimeSpan.FromSeconds(5);
Windows\TcpTableInfoTests.cs (2)
21public static readonly TimeSpan DefaultTimeSpan = TimeSpan.FromSeconds(5);
Windows\WindowsContainerSnapshotProviderTests.cs (23)
219var options = new ResourceMonitoringOptions { CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) }; 235Assert.Contains(_accountingInfo.TotalKernelTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 236Assert.Contains(_accountingInfo.TotalUserTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 239fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 242Assert.Contains(updatedAccountingInfo.TotalKernelTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 243Assert.Contains(updatedAccountingInfo.TotalUserTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 246fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 251Assert.Contains(updatedAccountingInfo.TotalKernelTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 252Assert.Contains(updatedAccountingInfo.TotalUserTime / (double)TimeSpan.TicksPerSecond, snapshot.Select(m => m.Value)); 288CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 308fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 314fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 321fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 365MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 385fakeClock.Advance(options.MemoryConsumptionRefreshInterval - TimeSpan.FromMilliseconds(1)); 390fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 430MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) 456fakeClock.Advance(options.MemoryConsumptionRefreshInterval - TimeSpan.FromMilliseconds(1)); 468fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 522MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 540fakeClock.Advance(options.MemoryConsumptionRefreshInterval - TimeSpan.FromMilliseconds(1)); 545fakeClock.Advance(TimeSpan.FromMilliseconds(2)); 550fakeClock.Advance(TimeSpan.FromMilliseconds(2));
Windows\WindowsCountersTests.cs (2)
27SamplingInterval = TimeSpan.FromSeconds(5) 69SamplingInterval = TimeSpan.FromSeconds(5)
Windows\WindowsSnapshotProviderTests.cs (6)
83CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 104fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 109fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 124MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 145fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 151fakeClock.Advance(TimeSpan.FromMilliseconds(1));
Microsoft.Extensions.Diagnostics.Testing (4)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\BindingExtensions.g.cs (3)
1594public static TimeSpan ParseTimeSpan(string value, Func<string?> getPath) 1598return TimeSpan.Parse(value, CultureInfo.InvariantCulture); 1602throw new InvalidOperationException($"Failed to convert configuration value at '{getPath()}' to type '{typeof(TimeSpan)}'.", exception);
Metrics\MetricCollector.cs (1)
251public async Task WaitForMeasurementsAsync(int minCount, TimeSpan timeout)
Microsoft.Extensions.Diagnostics.Testing.Tests (16)
Logging\FakeLogCollectorTests.cs (2)
43timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 85timeProvider.Advance(TimeSpan.FromMilliseconds(1));
Logging\FakeLogCollectorTests.LogEnumeration.cs (1)
132var timeout = Task.Delay(TimeSpan.FromSeconds(5));
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)
29internal static TimeSpan DefaultPollingInterval = TimeSpan.FromSeconds(4); 150_timerFactory = () => NonCapturingTimer.Create(RaiseChangeEvents, state: PollingChangeTokens, dueTime: TimeSpan.Zero, period: DefaultPollingInterval);
PollingFileChangeToken.cs (1)
45internal static TimeSpan PollingInterval { get; set; } = PhysicalFilesWatcher.DefaultPollingInterval;
PollingWildCardChangeToken.cs (1)
69internal TimeSpan PollingInterval { get; set; } = PhysicalFilesWatcher.DefaultPollingInterval;
src\runtime\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 (8)
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);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Logging.g.cs (1)
13private partial void LogTimeToLiveUp(global::System.TimeSpan timeToLive)
HostTerminatorService.cs (1)
64private partial void LogTimeToLiveUp(TimeSpan timeToLive);
Microsoft.Extensions.Hosting.Testing.Tests (9)
FakeHostTests.cs (9)
32x.TimeToLive = TimeSpan.Zero; 65var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.Zero }); 88var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.Zero }); 99var cancellationTokenSource = timeProvider.CreateCancellationTokenSource(TimeSpan.FromMilliseconds(1)); 108var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.FromMilliseconds(-1) }); 130var sut = new FakeHost(hostMock.Object, new FakeHostOptions { ShutDownTimeout = TimeSpan.Zero }); 147var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.Zero }); 159var cancellationTokenSource = timeProvider.CreateCancellationTokenSource(TimeSpan.FromMilliseconds(1)); 168var 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\runtime\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 (14)
Logging\Internal\HttpClientLogger.cs (6)
114TimeSpan elapsed, 123TimeSpan elapsed, 130public void LogRequestStop(object? context, HttpRequestMessage request, HttpResponseMessage response, TimeSpan elapsed) 133public void LogRequestFailed(object? context, HttpRequestMessage request, HttpResponseMessage? response, Exception exception, TimeSpan elapsed) 155TimeSpan elapsed, 218LogRecord 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) 73if (readTimeout == TimeSpan.Zero)
Logging\Internal\LoggingOptionsConfigureOptions.cs (1)
55static value => TimeSpan.Parse(value, CultureInfo.InvariantCulture),
Logging\LoggingOptions.cs (2)
86public TimeSpan BodyReadTimeout { get; set; } = TimeSpan.FromSeconds(1);
Microsoft.Extensions.Http.Diagnostics.Tests (52)
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 (20)
91.AddExtendedHttpClientLogging(options => options.BodyReadTimeout = TimeSpan.FromSeconds(1)) 94.AddExtendedHttpClientLogging(options => options.BodyReadTimeout = TimeSpan.FromSeconds(2)) 103optionsFirst.BodyReadTimeout.Should().Be(TimeSpan.FromSeconds(1)); 104optionsSecond.BodyReadTimeout.Should().Be(TimeSpan.FromSeconds(2)); 114.AddExtendedHttpClientLogging(options => options.BodyReadTimeout = TimeSpan.FromSeconds(1)) 117.AddExtendedHttpClientLogging(options => options.BodyReadTimeout = TimeSpan.FromSeconds(2)) 126optionsFirst.BodyReadTimeout.Should().Be(TimeSpan.FromSeconds(1)); 127optionsSecond.BodyReadTimeout.Should().Be(TimeSpan.FromSeconds(2)); 157var bodyReadTimeout = TimeSpan.FromSeconds(1); 214options.BodyReadTimeout = TimeSpan.Zero; 232var timeoutValue = TimeSpan.FromSeconds(seconds); 287options.BodyReadTimeout.Should().Be(TimeSpan.FromSeconds(2)); 377options.BodyReadTimeout.Should().Be(TimeSpan.FromSeconds(1)); 478var bodyReadTimeout = TimeSpan.FromSeconds(1); 536options.BodyReadTimeout = TimeSpan.Zero; 594var timeoutValue = TimeSpan.FromSeconds(seconds);
Logging\HttpRequestBodyReaderTest.cs (4)
129BodyReadTimeout = TimeSpan.FromMinutes(100) 153BodyReadTimeout = TimeSpan.FromMinutes(100) 254var timeout = TimeSpan.FromSeconds(274);
Logging\HttpRequestReaderTest.cs (9)
68BodyReadTimeout = TimeSpan.FromSeconds(100000), 134BodyReadTimeout = TimeSpan.FromSeconds(10), 198BodyReadTimeout = TimeSpan.FromSeconds(10), 273BodyReadTimeout = TimeSpan.FromSeconds(10), 346BodyReadTimeout = TimeSpan.FromSeconds(10), 407BodyReadTimeout = TimeSpan.FromSeconds(10), 480BodyReadTimeout = TimeSpan.FromSeconds(10), 549BodyReadTimeout = TimeSpan.FromSeconds(10), 640BodyReadTimeout = TimeSpan.FromMinutes(5),
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\aspnetcore\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.Resilience (37)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\BindingExtensions.g.cs (3)
643public static global::System.TimeSpan ParseSystemTimeSpan(string value, Func<string?> getPath) 647return global::System.TimeSpan.Parse(value, CultureInfo.InvariantCulture); 651throw new InvalidOperationException($"Failed to convert configuration value at '{getPath()}' to type '{typeof(global::System.TimeSpan)}'.", exception);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Validators.g.cs (12)
745typeof(global::System.TimeSpan), 758typeof(global::System.TimeSpan), 763typeof(global::System.TimeSpan), 836if (OperandType == typeof(global::System.TimeSpan)) 838if (!global::System.TimeSpan.TryParse((string)Minimum, culture, out global::System.TimeSpan timeSpanMinimum) || 839!global::System.TimeSpan.TryParse((string)Maximum, culture, out global::System.TimeSpan timeSpanMaximum)) 874if (OperandType == typeof(global::System.TimeSpan)) 876if (value is global::System.TimeSpan) 882if (!global::System.TimeSpan.TryParse((string)value, formatProvider, out global::System.TimeSpan timeSpanValue))
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;
parent\parent\parent\eng\MSBuild\parent\parent\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)
Polly\HttpRetryStrategyOptions.cs (2)
57HttpResponseMessage 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))
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 (61)
BuildTransitive\GrpcNetClientFactoryVersionTargetTests.cs (2)
277System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(50 * (retry + 1))); 306if (!process.WaitForExit((int)TimeSpan.FromSeconds(30).TotalMilliseconds))
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\GrpcResilienceTests.cs (1)
81var client = CreateClient(builder => builder.AddResilienceHandler("custom", builder => builder.AddTimeout(TimeSpan.FromSeconds(1))));
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)
26options.CircuitBreaker.SamplingDuration = TimeSpan.FromSeconds(1); 27options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(1); 54options.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.AttemptTimeout.Timeout.TotalMilliseconds * 2); 59options.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.AttemptTimeout.Timeout.TotalMilliseconds * 2) + TimeSpan.FromMilliseconds(10); 84options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(2); 85options.AttemptTimeout.Timeout = TimeSpan.FromSeconds(3); 89options.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(2); 94options.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); 92var delta = DateTimeOffset.UtcNow - DateTimeOffset.UnixEpoch;
src\aspnetcore\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/// Waits 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)
72return builder.FromUri(modelName, uri, TimeSpan.FromMinutes(5)); 88this PredictionEnginePoolBuilder<TData, TPrediction> builder, string uri, TimeSpan period) 112this PredictionEnginePoolBuilder<TData, TPrediction> builder, string modelName, string uri, TimeSpan period) 137this 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)
25public TimeSpan RefreshPeriod { get; set; } = TimeSpan.FromSeconds(60);
ServiceEndpointResolver.cs (2)
15private static readonly TimeSpan s_cleanupPeriod = TimeSpan.FromSeconds(10);
ServiceEndpointWatcher.cs (2)
258_pollingTimer = _timeProvider.CreateTimer(s_pollingAction, this, _options.RefreshPeriod, TimeSpan.Zero); 262_pollingTimer.Change(_options.RefreshPeriod, TimeSpan.Zero);
Microsoft.Extensions.ServiceDiscovery.Dns (47)
DnsResolverOptions.cs (2)
29public TimeSpan Timeout { get; set; } = TimeSpan.FromSeconds(3);
DnsResolverOptionsValidator.cs (3)
12private static readonly TimeSpan s_maxTimeout = TimeSpan.FromMilliseconds(int.MaxValue); 28if (options.Timeout <= TimeSpan.Zero)
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 || 134TimeSpan GetRefreshPeriod() 147return 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 (1)
891TimeSpan 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)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (14)
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)
34Timeout = TimeSpan.FromSeconds(5),
Resolver\ResolveAddressesTests.cs (3)
264Options.Timeout = TimeSpan.FromSeconds(1); 275Options.Timeout = TimeSpan.FromSeconds(1); 293Options.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);
ServiceDiscoveryDnsServiceCollectionExtensionsTests.cs (2)
71services.ConfigureDnsResolver(options => options.Timeout = TimeSpan.Zero); 84services.ConfigureDnsResolver(options => options.Timeout = TimeSpan.FromMilliseconds(1L + int.MaxValue));
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
Fuzzers\DnsResponseFuzzer.cs (1)
25Timeout = TimeSpan.FromSeconds(5),
Microsoft.Extensions.Telemetry (9)
parent\parent\parent\eng\MSBuild\parent\parent\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 (15)
FakeTimeProvider.cs (12)
19private DateTimeOffset _now = new(2000, 1, 1, 0, 0, 0, 0, TimeSpan.Zero); 59/// This defaults to <see cref="TimeSpan.Zero"/>. 61/// <exception cref="ArgumentOutOfRangeException">The time value is less than <see cref="TimeSpan.Zero"/>.</exception> 62public TimeSpan AutoAdvanceAmount 123/// <exception cref="ArgumentOutOfRangeException">The time value is less than <see cref="TimeSpan.Zero"/>.</exception> 124public void Advance(TimeSpan delta) 149var delta = value - _now; 172Debug.Assert(TimestampFrequency == TimeSpan.TicksPerSecond, "Assuming frequency equals ticks per second"); 191/// This is fixed to the value of <see cref="TimeSpan.TicksPerSecond"/>. 193public override long TimestampFrequency => TimeSpan.TicksPerSecond; 202public 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.VectorData.ConformanceTests (5)
ModelTests\NoVectorModelTests.cs (1)
95await Task.Delay(TimeSpan.FromMilliseconds(100));
Support\TestStore.cs (1)
158await Task.Delay(TimeSpan.FromMilliseconds(100));
TypeTests\DataTypeTests.cs (3)
102new DateTimeOffset(2020, 1, 1, 12, 30, 45, TimeSpan.FromHours(2)), 103new DateTimeOffset(2021, 2, 3, 13, 40, 55, TimeSpan.FromHours(3)), 104instantiationExpression: () => new DateTimeOffset(2020, 1, 1, 12, 30, 45, TimeSpan.FromHours(2)));
Microsoft.Gen.Logging.Generated.Tests (1)
parent\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)
68protected 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.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 (2)
BenchmarkBase.cs (1)
52TestDownloadUtils.DownloadFile(url, filePath, TimeSpan.FromMinutes(10));
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.TensorFlow.Tests (1)
TensorflowTests.cs (1)
1972TestDownloadUtils.DownloadFile(url, relativeFilePath, TimeSpan.FromMinutes(3));
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 (4)
AsyncTestHelper.cs (3)
12public static TimeSpan UnexpectedTimeout 16return Debugger.IsAttached ? TimeSpan.FromHours(1) : TimeSpan.FromMinutes(1);
TestDownloadUtils.cs (1)
14public static void DownloadFile(string url, string filePath, TimeSpan timeout)
Microsoft.ML.Tests (1)
Scenarios\Api\TestApi.cs (1)
412public TimeSpan TimeSpanStrat { get; set; }
Microsoft.ML.Tokenizers (8)
Normalizer\SentencePieceNormalizationStep.cs (2)
402private static readonly TimeSpan _regexTimeout = TimeSpan.FromSeconds(1);
RegexGenerator.g.cs (6)
239base.internalMatchTimeout = TimeSpan.FromMilliseconds(30000); 689base.internalMatchTimeout = TimeSpan.FromMilliseconds(30000); 1063base.internalMatchTimeout = TimeSpan.FromMilliseconds(30000); 1898base.internalMatchTimeout = TimeSpan.FromMilliseconds(30000); 2028base.internalMatchTimeout = TimeSpan.FromMilliseconds(30000); 2161base.internalMatchTimeout = TimeSpan.FromMilliseconds(30000);
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)
1057preTokenizers.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.Build.Containers (15)
_generated\0\RegexGenerator.g.cs (2)
252internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
AuthHandshakeMessageHandler.cs (1)
624await Task.Delay(TimeSpan.FromSeconds(1.0 * Math.Pow(2, retryCount)), cancellationToken).ConfigureAwait(false);
LocalDaemons\ContainerRuntime.cs (4)
23private static readonly TimeSpan s_defaultProbeTimeout = TimeSpan.FromSeconds(5); 30private readonly TimeSpan _probeTimeout; 64TimeSpan? probeTimeout = null)
Registry\DefaultRegistryAPI.cs (3)
22private static TimeSpan LongRequestTimeout = TimeSpan.FromMinutes(30); 64ConnectTimeout = TimeSpan.FromSeconds(30)
Registry\Registry.cs (5)
80private readonly Func<TimeSpan> _retryDelayProvider; 93internal Registry(string registryName, ILogger logger, IRegistryAPI registryAPI, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null) : 102internal Registry(Uri baseUri, ILogger logger, IRegistryAPI registryAPI, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null) : 110private Registry(Uri baseUri, ILogger logger, RegistryApiFactory factory, RegistrySettings? settings = null, Func<TimeSpan>? retryDelayProvider = null) 125_retryDelayProvider = retryDelayProvider ?? (() => TimeSpan.FromSeconds(1));
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 773private 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.Sdk.Publish.Tasks (13)
Tasks\Http\HttpClientExtensions.cs (2)
195TimeSpan delay, 305TimeSpan retryDelay,
Tasks\OneDeploy\OneDeployStatusService.cs (6)
11private static readonly TimeSpan s_maximumWaitForResult = TimeSpan.FromMinutes(3); 12private static readonly TimeSpan s_refreshDelay = TimeSpan.FromSeconds(3); 13private static readonly TimeSpan s_retryDelay = TimeSpan.FromSeconds(1);
Tasks\ZipDeploy\ZipDeploymentStatus.cs (5)
34var tokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(MaxMinutesToWait)); 52deploymentUrl, userName, password, RetryCount, TimeSpan.FromSeconds(RetryDelaySeconds), tokenSource); 68await System.Threading.Tasks.Task.Delay(TimeSpan.FromSeconds(StatusRefreshDelaySeconds)); 74private async Task<T?> InvokeGetRequestWithRetryAsync<T>(string url, string? userName, string? password, int retryCount, TimeSpan retryDelay, CancellationTokenSource cts) 96private async System.Threading.Tasks.Task RetryAsync(Func<System.Threading.Tasks.Task> func, int retryCount, TimeSpan retryDelay)
Microsoft.NET.Sdk.Razor.Tasks (7)
DotnetToolTask.cs (1)
93Thread.Sleep(TimeSpan.FromSeconds(3));
src\sdk\src\RazorSdk\Tool\Client.cs (2)
40public static async Task<Client> ConnectAsync(string pipeName, TimeSpan? timeout, CancellationToken cancellationToken) 169await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken);
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerConnection.cs (1)
186pipeTask = Client.ConnectAsync(pipeName, TimeSpan.FromMilliseconds(timeout), cancellationToken);
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerRequest.cs (3)
47public TimeSpan? KeepAlive 51TimeSpan? keepAlive = null; 61keepAlive = TimeSpan.FromSeconds(result);
Microsoft.NET.Sdk.StaticWebAssets.Tasks (2)
ScopedCss\RewriteCss.cs (2)
26private static readonly TimeSpan s_regexTimeout = TimeSpan.FromSeconds(1);
Microsoft.Private.Windows.Core (31)
_generated\304\System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.g.cs (1)
73/// <summary>The syntax identifier for strings containing <see cref="global::System.TimeSpan"/> format specifiers.</summary>
System\IO\BinaryReaderExtensions.cs (6)
66if (typeof(T) == typeof(decimal) || typeof(T) == typeof(DateTime) || typeof(T) == typeof(TimeSpan)) 176else if (typeof(T) == typeof(TimeSpan)) 198/// <see langword="decimal"/>, <see cref="DateTime"/>, and <see cref="TimeSpan"/>. 211|| typeof(T) == typeof(TimeSpan)) 338else if (typeof(T) == typeof(TimeSpan)) 340writer.Write(((TimeSpan)(object)values[i]).Ticks);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (9)
95/// Writes a <see cref="TimeSpan"/> in binary format. 97public static void WriteTimeSpan(Stream stream, TimeSpan value) 101new ClassInfo(1, typeof(TimeSpan).FullName!, s_ticksName), 325WriteTimeSpan(stream, (TimeSpan)primitive); 450case List<TimeSpan> typedList: 548PrimitiveType.TimeSpan => new ArraySinglePrimitive<TimeSpan>( 5491, new ListConverter<object, TimeSpan>(array, o => (TimeSpan)o!)), 698case TimeSpan 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)
53{ TypeName.Parse(Types.TimeSpanType), typeof(TimeSpan) }, 72{ Types.ToTypeName($"{Types.ListName}[[{Types.TimeSpanType}]]"), typeof(List<TimeSpan>) }, 88{ Types.ToTypeName($"{Types.TimeSpanType}[]"), typeof(TimeSpan[]) }, 121|| type == typeof(TimeSpan) 139|| type == typeof(List<TimeSpan>) 155|| type == typeof(TimeSpan[])
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (2)
334SZArrayRecord<TimeSpan> ar => ar.GetArray().CreateTrimmedList(size), 421SZArrayRecord<TimeSpan> ar => ar.GetArray(),
System\Value.cs (3)
486TimeSpan offset = value.Offset; 732DateTimeOffset dto = new(_union.Ticks, TimeSpan.Zero); 894DateTimeOffset? 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(
Microsoft.TemplateEngine.Cli (4)
Commands\create\InstantiateCommand.TabCompletion.cs (2)
15private static readonly TimeSpan ConstraintEvaluationTimeout = TimeSpan.FromMilliseconds(1000);
Commands\create\TemplateCommand.cs (2)
20private static readonly TimeSpan ConstraintEvaluationTimeout = TimeSpan.FromMilliseconds(1000);
Microsoft.TemplateEngine.Edge (2)
BuiltInManagedProvider\GlobalSettings.cs (2)
18private static readonly TimeSpan MaxNotificationDelayOnWriterLock = TimeSpan.FromSeconds(1);
Microsoft.TemplateEngine.Utils (2)
DefaultTemplateEngineHost.cs (2)
54public Action<string, TimeSpan, int>? OnLogTiming { get; set; } 136public void LogTiming(string label, TimeSpan duration, int depth)
Microsoft.TestPlatform.Build (2)
Tasks\VSTestTask2.cs (2)
165string? formattedDuration = GetFormattedDurationString(TimeSpan.FromMilliseconds(durationNumber)); 327internal static string? GetFormattedDurationString(TimeSpan duration)
Microsoft.TestPlatform.CommunicationUtilities (33)
_generated\104\TestPlatformJsonContext.GetJsonTypeInfo.g.cs (1)
410if (type == typeof(global::System.TimeSpan))
_generated\29\TestPlatformJsonContext.DiscoveryCriteria.g.cs (3)
135var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan> 150AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.DiscoveryCriteria).GetProperty("DiscoveredTestEventTimeout", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null), 153properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info4);
_generated\40\TestPlatformJsonContext.TestRunCompleteEventArgs.g.cs (3)
175var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan> 190AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.TestRunCompleteEventArgs).GetProperty("ElapsedTimeInRunningTests", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null), 193properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info6);
_generated\41\TestPlatformJsonContext.TestRunCriteria.g.cs (3)
313var info13 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan> 328AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.Client.BaseTestRunCriteria).GetProperty("RunStatsChangeEventTimeout", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null), 331properties[13] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info13);
_generated\57\TestPlatformJsonContext.TestResult.g.cs (3)
216var info8 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan> 231AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestResult).GetProperty("Duration", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null), 234properties[8] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info8);
_generated\97\TestPlatformJsonContext.TimeSpan.g.cs (8)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 22get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 29jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
Json\Jsonite\Jsonite.cs (2)
1026{typeof (TimeSpan), value => { WriteString(((TimeSpan)value).ToString()); }}, // TODO: handle correctly
Serialization\DiscoveryCriteriaConverter.cs (2)
37var timeout = DeserializeProperty<TimeSpan>(root, "DiscoveredTestEventTimeout", options);
Serialization\DiscoveryCriteriaFactory.cs (1)
17TimeSpan discoveredTestEventTimeout,
Serialization\TestExecutionContextConverter.cs (1)
31context.RunStatsChangeEventTimeout = TimeSpan.Parse(timeout.GetString()!, System.Globalization.CultureInfo.InvariantCulture);
Serialization\TestObjectBaseConverter.cs (1)
154case TimeSpan ts: writer.WriteStringValue(ts.ToString()); break;
Serialization\TestResultConverter.cs (1)
92testResult.Duration = TimeSpan.Parse(propertyData!, CultureInfo.InvariantCulture); break;
Serialization\TestResultConverterV2.cs (1)
69testResult.Duration = TimeSpan.Parse(duration.GetString()!, CultureInfo.InvariantCulture);
Serialization\TestRunCompleteEventArgsConverter.cs (2)
40var elapsedTime = DeserializeProperty<TimeSpan>(root, "ElapsedTimeInRunningTests", options);
TestRequestSender.cs (1)
705var completeArgs = new TestRunCompleteEventArgs(null, false, true, exception, null, null, TimeSpan.Zero);
Microsoft.TestPlatform.CoreUtilities (11)
Utilities\TimeSpanParser.cs (11)
13public static TimeSpan Parse(string? time) 15return TryParse(time, out var result) ? result : throw GetFormatException(time); 18public static bool TryParse(string? time, out TimeSpan result) 22result = TimeSpan.Zero; 29result = TimeSpan.Zero; 46result = TimeSpan.FromMilliseconds(number); 52result = TimeSpan.FromSeconds(number); 58result = TimeSpan.FromMinutes(number); 64result = TimeSpan.FromHours(number); 70result = TimeSpan.FromDays(number); 74result = TimeSpan.Zero;
Microsoft.TestPlatform.CrossPlatEngine (26)
Client\InProcessProxyexecutionManager.cs (1)
103var completeArgs = new TestRunCompleteEventArgs(null, false, true, exception, new Collection<AttachmentSet>(), new Collection<InvokedDataCollector>(), TimeSpan.Zero);
Client\Parallel\ParallelProxyExecutionManager.cs (1)
440var completeArgs = new TestRunCompleteEventArgs(null, false, true, null, new Collection<AttachmentSet>(), new Collection<InvokedDataCollector>(), TimeSpan.Zero);
Client\Parallel\ParallelRunDataAggregator.cs (4)
35ElapsedTime = TimeSpan.Zero; 50public TimeSpan ElapsedTime { get; set; } 141TimeSpan elapsedTime, 154ElapsedTime = TimeSpan.FromMilliseconds(Math.Max(ElapsedTime.TotalMilliseconds, elapsedTime.TotalMilliseconds));
Client\ProxyExecutionManager.cs (1)
275var completeArgs = new TestRunCompleteEventArgs(null, false, true, null, new Collection<AttachmentSet>(), new Collection<InvokedDataCollector>(), TimeSpan.Zero);
Discovery\DiscovererEnumerator.cs (2)
130var totalAdapterLoadTIme = DateTime.UtcNow - timeStart; 227var totalAdapterRunTime = DateTime.UtcNow - newTimeStart;
Discovery\DiscoveryResultCache.cs (4)
29private readonly TimeSpan _cacheTimeout; 52public DiscoveryResultCache(long cacheSize, TimeSpan discoveredTestEventTimeout, OnReportTestCases onReportTestCases) 56TPDebug.Assert(discoveredTestEventTimeout > TimeSpan.MinValue, "The cache timeout must be greater than min value."); 110var timeDelta = DateTime.UtcNow - _lastUpdate;
Execution\BaseRunTests.cs (6)
202TimeSpan? elapsedTime = null; 242RaiseTestRunComplete(exception, _isCancellationRequested, isAborted, elapsedTime ?? TimeSpan.Zero); 261RaiseTestRunComplete(exception: null, canceled: _isCancellationRequested, aborted: true, elapsedTime: TimeSpan.Zero); 331private TimeSpan? RunTestsInternal() 487var totalTimeTaken = DateTime.UtcNow - timeStartNow; 617TimeSpan elapsedTime)
Execution\ExecutionManager.cs (2)
168var testRunCompleteEventArgs = new TestRunCompleteEventArgs(null, true, false, null, null, null, TimeSpan.Zero); 184var testRunCompleteEventArgs = new TestRunCompleteEventArgs(null, false, true, null, null, null, TimeSpan.Zero);
Execution\TestRunCache.cs (5)
47private readonly TimeSpan _cacheTimeout; 80internal TestRunCache(long cacheSize, TimeSpan cacheTimeout, OnCacheHit onCacheHit) 84TPDebug.Assert(cacheTimeout > TimeSpan.MinValue, "The cache timeout must be greater than min value."); 88cacheTimeout = TimeSpan.FromMilliseconds(int.MaxValue / 2); 316var timeDelta = DateTime.UtcNow - _lastUpdate;
Microsoft.TestPlatform.Extensions.BlameDataCollector (7)
BlameCollector.cs (3)
60private TimeSpan _inactivityTimespan = TimeSpan.FromMinutes(DefaultInactivityTimeInMinutes); 406if (!attribute.Value.IsNullOrWhiteSpace() && TimeSpanParser.TryParse(attribute.Value, out var timeout))
InactivityTimer.cs (2)
24public void ResetTimer(TimeSpan inactivityTimespan) 26_timer.Change(inactivityTimespan, TimeSpan.FromMilliseconds(-1));
Interfaces\IInactivityTimer.cs (1)
14void ResetTimer(TimeSpan inactivityTimespan);
NetClientHangDumper.cs (1)
60timeout.CancelAfter(TimeSpan.FromMinutes(5));
Microsoft.TestPlatform.PlatformAbstractions (1)
common\Tracing\RollingFileTraceListener.cs (1)
140private readonly long _failedRollTimeout = TimeSpan.FromMinutes(1).Ticks;
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (2)
VsTestConsoleRequestSender.cs (2)
822null, false, true, exception, null, null, TimeSpan.Zero); 907null, false, true, exception, null, null, 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.TestPlatform.Client (7)
DesignMode\DesignModeClient.cs (1)
493TestRunCompleteArgs = new TestRunCompleteEventArgs(null, false, true, ex, null, null, TimeSpan.MinValue),
Discovery\DiscoveryRequest.cs (2)
288var discoveryFinalTimeTaken = DateTime.UtcNow - _discoveryStartTime; 428var discoveryFinalTimeTakenForDesignMode = DateTime.UtcNow - _discoveryStartTime;
Execution\TestRunRequest.cs (4)
147_timer = new Timer(OnTestSessionTimeout, null, TimeSpan.FromMilliseconds(_testSessionTimeout), TimeSpan.FromMilliseconds(0)); 438var executionTotalTimeTaken = DateTime.UtcNow - _executionStartTime; 605var executionTotalTimeTakenForDesignMode = DateTime.UtcNow - _executionStartTime;
Microsoft.VisualStudio.TestPlatform.Common (3)
Interfaces\Engine\ClientProtocol\TestExecutionContext.cs (2)
41TimeSpan runStatsChangeEventTimeout, 79public TimeSpan RunStatsChangeEventTimeout
Logging\InternalTestLoggerEvents.cs (1)
288internal void CompleteTestRun(ITestRunStatistics? stats, bool isCanceled, bool isAborted, Exception? error, Collection<AttachmentSet>? attachmentSet, Collection<InvokedDataCollector>? invokedDataCollectors, TimeSpan elapsedTime)
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (1)
HtmlLogger.cs (1)
415internal static string? GetFormattedDurationString(TimeSpan duration)
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (7)
Interfaces\ITestResult.cs (1)
24TimeSpan Duration { get; set; }
ObjectModel\TestResult.cs (6)
188private TimeSpan _duration; 269public TimeSpan Duration 279EqtTrace.WarningIf(value < TimeSpan.Zero, "TestResult.Duration: The duration is being set to {0}. Since the duration is negative the duration will be updated to zero.", value); 280_duration = value > TimeSpan.Zero ? value : TimeSpan.Zero; 505helper.SaveSimpleField(element, "@duration", _duration, default(TimeSpan));
Microsoft.VisualStudio.TestPlatform.ObjectModel (27)
Client\DiscoveryCriteria.cs (5)
47TimeSpan.MaxValue, 69TimeSpan discoveredTestEventTimeout, 98TimeSpan discoveredTestEventTimeout, 110if (discoveredTestEventTimeout <= TimeSpan.MinValue) 170public TimeSpan DiscoveredTestEventTimeout { get; private set; }
Client\Events\TestRunCompleteEventArgs.cs (3)
42TimeSpan elapsedTime) 70TimeSpan elapsedTime) 124public TimeSpan ElapsedTimeInRunningTests { get; private set; }
Client\TestRunCriteria.cs (15)
82TimeSpan.MaxValue) 104TimeSpan runStatsChangeEventTimeout) 136TimeSpan runStatsChangeEventTimeout, 173TimeSpan runStatsChangeEventTimeout, 218TimeSpan runStatsChangeEventTimeout, 293TimeSpan runStatsChangeEventTimeout, 364TimeSpan.MaxValue) 386TimeSpan runStatsChangeEventTimeout) 433TimeSpan runStatsChangeEventTimeout, 472TimeSpan runStatsChangeEventTimeout, 732TimeSpan.MaxValue) 754TimeSpan runStatsChangeEventTimeout) 783TimeSpan runStatsChangeEventTimeout, 793if (runStatsChangeEventTimeout <= TimeSpan.MinValue) 843public TimeSpan RunStatsChangeEventTimeout { get; private set; }
TestProperty\TestProperty.cs (1)
202type = typeof(TimeSpan);
TestResult.cs (3)
90public TimeSpan Duration { get; set; } 205Duration = (TimeSpan)value!; return; 292public static readonly TestProperty Duration = TestProperty.Register("TestResult.Duration", "Duration", typeof(TimeSpan), typeof(TestResult));
Mongo.AppHost (1)
AppHost.cs (1)
15await Task.Delay(TimeSpan.FromSeconds(10), ct);
MSBuild (2)
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (1)
400TimeSpan usedWaitTime = restartWaitTime - originalWaitStartTime;
XMake.cs (1)
1154TimeSpan elapsedTime = t2.Subtract(t1);
MSBuild.Coordinator (2)
CoordinatorServer.cs (1)
528DateTime threshold = DateTime.UtcNow - TimeSpan.FromMilliseconds(_settings.HeartbeatTimeoutMs);
CoordinatorServer.DefaultDebugOutput.cs (1)
70float millisecondsSinceLastLog = (float)(nowTicks - s_lastTicks) / TimeSpan.TicksPerMillisecond;
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1194[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.TimeSpan))]
Nats.ApiService (1)
Program.cs (1)
27var rtt = await nats.PingAsync();
netstandard (1)
netstandard.cs (1)
2161[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.TimeSpan))]
NuGet.Commands (7)
RestoreCommand\RequestFactory\NoOpRestoreResult.cs (1)
21public NoOpRestoreResult(bool success, string lockFilePath, Lazy<LockFile> lockFileLazy, CacheFile cacheFile, string cacheFilePath, ProjectStyle projectStyle, TimeSpan elapsedTime) :
RestoreCommand\RestoreCommand.cs (4)
595TimeSpan? cacheFileAge; 1670private (CacheFile cacheFile, bool noOpCacheFileEvaluation, TimeSpan? cacheFileAge) EvaluateCacheFile() 1674TimeSpan? cacheFileAge = null; 1717static bool CacheFileExists(string path, out TimeSpan? cacheFileAge)
RestoreCommand\RestoreResult.cs (2)
59public TimeSpan ElapsedTime { get; } 123TimeSpan elapsedTime)
NuGet.Common (11)
ConcurrencyUtilities.cs (2)
20private static readonly TimeSpan SleepDuration = TimeSpan.FromMilliseconds(10);
DatetimeUtility.cs (2)
19public static string ToReadableTimeFormat(TimeSpan time) 24internal static string ToReadableTimeFormat(TimeSpan time, IFormatProvider format)
Migrations\MigrationRunner.cs (1)
77captured = mutex.WaitOne(TimeSpan.FromMinutes(1), false);
Telemetry\TelemetryActivity.cs (3)
18private readonly List<Tuple<string, TimeSpan>> _intervalList; 55_intervalList = new List<Tuple<string, TimeSpan>>(); 72_intervalList.Add(new Tuple<string, TimeSpan>(propertyName, _intervalWatch.Elapsed));
Telemetry\TelemetryServiceUtility.cs (3)
35public static TimeSpan GetTimerElapsedTime() 39var duration = StopWatch.Elapsed; 44return TimeSpan.MinValue;
NuGet.Configuration (8)
PackageSource\PackageSource.cs (5)
24internal static readonly TimeSpan DefaultMinPublishAge = TimeSpan.Zero; 122public TimeSpan MinPublishAge 127if (value < TimeSpan.Zero) 138if (value.Ticks % TimeSpan.FromHours(1).Ticks != 0)
PackageSource\PackageSourceProvider.cs (3)
407private static TimeSpan ReadMinPublishAge(SourceItem setting) 416hours <= TimeSpan.MaxValue.TotalHours) 418return TimeSpan.FromHours(hours);
NuGet.PackageManagement (8)
NuGetPackageManager.cs (1)
2058using var tokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(5));
PackageManagementConstants.cs (2)
19public static readonly TimeSpan DefaultRequestTimeout = TimeSpan.FromMinutes(15);
Resolution\ResolverGather.cs (4)
35private readonly ConcurrentDictionary<string, TimeSpan> _timeTaken = new ConcurrentDictionary<string, TimeSpan>(StringComparer.OrdinalIgnoreCase); 71public TimeSpan RequestTimeout { get; set; } 239foreach ((var key, var time) in _timeTaken)
Utility\Constants.cs (1)
27public static readonly DateTimeOffset Unpublished = new DateTimeOffset(1900, 1, 1, 0, 0, 0, TimeSpan.FromHours(-8));
NuGet.Packaging (17)
PackageCreation\Utility\PackageIdValidator.cs (1)
20matchTimeout: TimeSpan.FromSeconds(10));
PackageExtraction\PackageExtractionResult.cs (6)
12public TimeSpan SignVerifyDelay { get; } 18public TimeSpan Duration { get; set; } 27TimeSpan signVerifyDelay, 32this(cached, signVerifyDelay, packageType, success, TimeSpan.Zero) 37public PackageExtractionResult(bool cached, TimeSpan signVerifyDelay, PackageSignType packageType, bool success, TimeSpan duration)
Signing\ChainBuilding\RetriableX509ChainBuildPolicy.cs (3)
15internal TimeSpan SleepInterval { get; } 17internal RetriableX509ChainBuildPolicy(IX509ChainBuildPolicy innerPolicy, int retryCount, TimeSpan sleepInterval) 29if (sleepInterval < TimeSpan.Zero)
Signing\ChainBuilding\X509ChainBuildPolicyFactory.cs (2)
65TimeSpan sleepInterval = TimeSpan.FromMilliseconds(sleepIntervalInMilliseconds);
Signing\SignatureException.cs (1)
20public TimeSpan VerifyDuration { get; set; }
Signing\Timestamp\IRfc3161TimestampRequest.cs (1)
11Task<IRfc3161TimestampToken> SubmitRequestAsync(Uri timestampUri, TimeSpan timeout);
Signing\Timestamp\Rfc3161TimestampProvider.cs (2)
25private static readonly TimeSpan RequestTimeout = TimeSpan.FromSeconds(10);
Signing\Timestamp\Rfc3161TimestampRequestNetstandard21Wrapper.cs (1)
37public async Task<IRfc3161TimestampToken> SubmitRequestAsync(Uri timestampUri, TimeSpan timeout)
NuGet.Protocol (146)
_generated\68\PluginJsonContext.InitializeRequest.g.cs (6)
32ObjectWithParameterizedConstructorCreator = static args => new global::NuGet.Protocol.Plugins.InitializeRequest((string)args[0], (string)args[1], (global::System.TimeSpan)args[2]), 35ConstructorAttributeProviderFactory = static () => typeof(global::NuGet.Protocol.Plugins.InitializeRequest).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string), typeof(global::System.TimeSpan)}, modifiers: null), 95var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan> 110AttributeProviderFactory = static () => typeof(global::NuGet.Protocol.Plugins.InitializeRequest).GetProperty("RequestTimeout", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null), 113properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info2); 171ParameterType = typeof(global::System.TimeSpan),
_generated\90\PluginJsonContext.TimeSpan.g.cs (8)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 22get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 29jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
_generated\95\PluginJsonContext.GetJsonTypeInfo.g.cs (1)
210if (type == typeof(global::System.TimeSpan))
EnhancedHttpRetryHelper.cs (4)
74private Lazy<TimeSpan> _maxRetryAfterDelay; 88_maxRetryAfterDelay = new Lazy<TimeSpan>(() => 91return TimeSpan.FromSeconds(maxRetryAfterDelay); 129internal TimeSpan MaxRetryAfterDelayOrDefault => _maxRetryAfterDelay.Value;
Events\ProtocolDiagnosticHttpEvent.cs (4)
11public TimeSpan EventDuration { get; } 19TimeSpan? headerDuration, 20TimeSpan eventDuration, 45TimeSpan eventDuration,
Events\ProtocolDiagnosticHttpEventBase.cs (2)
12public TimeSpan? HeaderDuration { get; } 32TimeSpan? headerDuration,
Events\ProtocolDiagnosticInProgressHttpEvent.cs (1)
13TimeSpan? headerDuration,
Events\ProtocolDiagnosticResourceEvent.cs (2)
14public TimeSpan Duration { get; } 21TimeSpan duration)
HttpSource\DownloadTimeoutStreamContent.cs (1)
18public DownloadTimeoutStreamContent(string downloadName, Stream networkStream, TimeSpan timeout)
HttpSource\HttpCacheResult.cs (2)
11public HttpCacheResult(TimeSpan maxAge, string newFile, string cacheFule) 28public TimeSpan MaxAge { get; }
HttpSource\HttpCacheUtility.cs (1)
26if (context.MaxAge > TimeSpan.Zero)
HttpSource\HttpRetryHandler.cs (4)
71request.RetryDelay = TimeSpan.FromMilliseconds((double)_enhancedHttpRetryHelper.DelayInMilliseconds!); 76TimeSpan? retryAfter = null; 92await Task.Delay(TimeSpan.FromMilliseconds((Math.Pow(2, tries) * request.RetryDelay.TotalMilliseconds) + new Random().Next(200)), cancellationToken); 296private static TimeSpan? GetRetryAfter(RetryConditionHeaderValue? retryAfter)
HttpSource\HttpRetryHandlerRequest.cs (7)
17public static readonly TimeSpan DefaultDownloadTimeout = TimeSpan.FromSeconds(60); 35RequestTimeout = TimeSpan.FromSeconds(100); 36RetryDelay = TimeSpan.FromSeconds(1); 55public TimeSpan RequestTimeout { get; set; } 59public TimeSpan RetryDelay { get; set; } 62public TimeSpan DownloadTimeout { get; set; }
HttpSource\HttpSource.cs (3)
328TimeSpan requestTimeout, 329TimeSpan downloadTimeout, 430protected virtual Stream? TryReadCacheFile(string uri, TimeSpan maxAge, string cacheFile)
HttpSource\HttpSourceCachedRequest.cs (2)
84public TimeSpan RequestTimeout { get; set; } = HttpSourceRequest.DefaultRequestTimeout; 87public TimeSpan DownloadTimeout { get; set; } = HttpRetryHandlerRequest.DefaultDownloadTimeout;
HttpSource\HttpSourceRequest.cs (4)
15public static readonly TimeSpan DefaultRequestTimeout = TimeSpan.FromSeconds(100); 55public TimeSpan RequestTimeout { get; set; } = DefaultRequestTimeout; 61public TimeSpan DownloadTimeout { get; set; } = HttpRetryHandlerRequest.DefaultDownloadTimeout;
HttpSourceCacheContext.cs (5)
11private HttpSourceCacheContext(string? rootTempFolder, TimeSpan maxAge, bool directDownload, SourceCacheContext cacheContext) 13if (maxAge <= TimeSpan.Zero) 33public TimeSpan MaxAge { get; } 60if (isFirstAttempt && cacheContext.MaxAgeTimeSpan > TimeSpan.Zero) 72TimeSpan.Zero,
LegacyFeed\ODataServiceDocumentResourceV2Provider.cs (3)
15private static readonly TimeSpan _defaultCacheDuration = TimeSpan.FromMinutes(40); 22public TimeSpan MaxCacheDuration { get; protected set; }
Plugins\AutomaticProgressReporter.cs (2)
26TimeSpan interval, 115TimeSpan interval,
Plugins\ConnectionOptions.cs (7)
19public TimeSpan HandshakeTimeout { get; } 34public TimeSpan RequestTimeout { get; private set; } 60TimeSpan handshakeTimeout, 61TimeSpan requestTimeout) 114public void SetRequestTimeout(TimeSpan requestTimeout) 139var handshakeTimeout = TimeoutUtilities.GetTimeout(handshakeTimeoutInSeconds, ProtocolConstants.HandshakeTimeout); 140var requestTimeout = TimeoutUtilities.GetTimeout(requestTimeoutInSeconds, ProtocolConstants.RequestTimeout);
Plugins\InboundRequestProcessingHandler.cs (1)
37var thread = new DedicatedAsynchronousProcessingThread(TimeSpan.FromMilliseconds(50));
Plugins\MessageDispatcher.cs (3)
468var timeout = GetRequestTimeout(connection, type, method); 694TimeSpan? timeout, 718private static TimeSpan GetRequestTimeout(IConnection connection, MessageType type, MessageMethod method)
Plugins\Messages\InitializeRequest.cs (2)
30public TimeSpan RequestTimeout { get; } 46public InitializeRequest(string clientVersion, string culture, TimeSpan requestTimeout)
Plugins\OutboundRequestContext`1.cs (3)
30private readonly TimeSpan? _timeout; 56TimeSpan? timeout, 84TimeSpan? timeout,
Plugins\Plugin.cs (3)
16private readonly TimeSpan _idleTimeout; 83public Plugin(string filePath, IConnection connection, IPluginProcess process, bool isOwnProcess, TimeSpan idleTimeout) 88internal Plugin(string filePath, IConnection connection, IPluginProcess process, bool isOwnProcess, TimeSpan idleTimeout, string? id)
Plugins\PluginCacheEntry.cs (2)
30internal TimeSpan MaxAge { get; set; } = TimeSpan.FromDays(30);
Plugins\PluginConstants.cs (8)
17public static readonly TimeSpan CloseTimeout = TimeSpan.FromSeconds(2); 22public static readonly TimeSpan IdleTimeout = TimeSpan.FromMinutes(1); 33public static readonly TimeSpan ProgressInterval = TimeSpan.FromSeconds(10); 38public static readonly TimeSpan RequestTimeout = TimeSpan.FromSeconds(30);
Plugins\PluginFactory.cs (3)
25private readonly TimeSpan _pluginIdleTimeout; 35public PluginFactory(TimeSpan pluginIdleTimeout) 49internal PluginFactory(TimeSpan pluginIdleTimeout, IEnvironmentVariableReader environmentVariableReader)
Plugins\PluginManager.cs (5)
74(TimeSpan idleTimeout) => new PluginFactory(idleTimeout), 81Func<TimeSpan, PluginFactory> pluginFactoryCreator, 331Func<TimeSpan, IPluginFactory> pluginFactoryCreator, 346var idleTimeout = TimeoutUtilities.GetTimeout(idleTimeoutInSeconds, PluginConstants.IdleTimeout); 434TimeSpan requestTimeout,
Plugins\ProtocolConstants.cs (8)
27public static readonly TimeSpan HandshakeTimeout = TimeSpan.FromSeconds(30); 33public static readonly TimeSpan MaxTimeout = TimeSpan.FromMilliseconds(int.MaxValue); 38public static readonly TimeSpan MinTimeout = TimeSpan.FromTicks(1); 43public static readonly TimeSpan RequestTimeout = TimeSpan.FromSeconds(30);
Plugins\RequestHandlers\SymmetricHandshake.cs (2)
21private readonly TimeSpan _handshakeTimeout; 43TimeSpan handshakeTimeout,
Plugins\TimeoutUtilities.cs (6)
18/// <returns>A <see cref="TimeSpan" /> object that represents a timeout interval.</returns> 21public static TimeSpan GetTimeout(string? timeoutInSeconds, TimeSpan fallbackTimeout) 36var timeout = TimeSpan.FromSeconds(seconds); 56public static bool IsValid(TimeSpan timeout)
Providers\ServiceIndexResourceV3Provider.cs (4)
28private static readonly TimeSpan DefaultCacheDuration = TimeSpan.FromMinutes(40); 37public TimeSpan MaxCacheDuration { get; protected set; } 180await Task.Delay(TimeSpan.FromMilliseconds(_enhancedHttpRetryHelper.DelayInMillisecondsOrDefault), token);
RemoteRepositories\HttpFileSystemBasedFindPackageByIdResource.cs (1)
563await Task.Delay(TimeSpan.FromMilliseconds(_enhancedHttpRetryHelper.DelayInMillisecondsOrDefault), cancellationToken);
Resources\PackageUpdateResource.cs (7)
99var requestTimeout = TimeSpan.FromSeconds(timeoutInSecond); 210TimeSpan requestTimeout, 271TimeSpan requestTimeout, 356TimeSpan requestTimeout, 429TimeSpan requestTimeout, 914TimeSpan requestTimeout,
SourceCacheContext.cs (10)
25private static readonly TimeSpan DefaultMaxAge = TimeSpan.FromMinutes(30); 62public TimeSpan MaxAgeTimeSpan 70private TimeSpan GetCacheTime(DateTimeOffset? maxAge, TimeSpan defaultTime) 72var timeSpan = TimeSpan.Zero; 82var difference = DateTimeOffset.UtcNow.Subtract(maxAge.Value); 84Debug.Assert(difference >= TimeSpan.Zero, "Invalid cache time"); 86if (difference >= TimeSpan.Zero)
Utility\CachingUtility.cs (2)
37public static Stream? ReadCacheFile(TimeSpan maxAge, string cacheFile) 43var age = DateTime.UtcNow.Subtract(fileInfo.LastWriteTimeUtc);
Utility\DedicatedAsynchronousProcessingThread.cs (2)
22private TimeSpan _pollingDelay; 29public DedicatedAsynchronousProcessingThread(TimeSpan pollingDelay)
Utility\DownloadTimeoutStream.cs (2)
16private readonly TimeSpan _timeout; 18public DownloadTimeoutStream(string downloadName, Stream networkStream, TimeSpan timeout)
Utility\FindPackagesByIdNupkgDownloader.cs (1)
313await Task.Delay(TimeSpan.FromMilliseconds(_enhancedHttpRetryHelper.DelayInMillisecondsOrDefault), token);
Utility\TimeoutUtility.cs (2)
18TimeSpan timeout, 60TimeSpan timeout,
Pipelines.Library (1)
DistributedApplicationPipelineExtensions.cs (1)
150httpClient.Timeout = TimeSpan.FromMinutes(30);
PresentationBuildTasks (3)
MS\Internal\MarkupCompiler\VersionHelper.cs (1)
203TimeSpan days = time.Date - new DateTime(2000, 1, 1);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypes.cs (1)
5506case KnownElements.TimeSpan: t = typeof(TimeSpan); break;
src\wpf\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); 895internal void SetPosition(TimeSpan value) 905private TimeSpan GetPosition() 911return 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(),
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)
2565timer.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)
2707timer.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\wpf\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\wpf\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\wpf\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\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
108Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds)), // Repeat every 3 seconds
Producer (2)
ContinuousProducerWorker.cs (1)
12using var timer = new PeriodicTimer(TimeSpan.FromSeconds(10));
IntermittentProducerWorker.cs (1)
25await Task.Delay(TimeSpan.FromSeconds(10), stoppingToken);
ReachFramework (1)
AlphaFlattener\Utility.cs (1)
36 TimeSpan elapsed = DateTime.Now - s_startTime;
RepoTasks (4)
_generated\0\RegexGenerator.g.cs (2)
607internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
272TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
Roslyn.Diagnostics.Analyzers (14)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SharedStopwatch.cs (3)
16private readonly TimeSpan _started; 18private SharedStopwatch(TimeSpan started) 23public TimeSpan Elapsed => s_stopwatch.Elapsed - _started;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
143internal bool WaitForOutstandingObjectsToBeFreed(TimeSpan timeout)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
18TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (2)
18TimeSpan delay, 25TimeSpan delay,
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (2)
34private readonly TimeSpan _delay; 112TimeSpan delay,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (2)
37private readonly TimeSpan _delay; 73TimeSpan delay,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
752or nameof(TimeSpan))
rzc (25)
Client.cs (2)
40public static async Task<Client> ConnectAsync(string pipeName, TimeSpan? timeout, CancellationToken cancellationToken) 169await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken);
ConnectionHost.cs (1)
105await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken);
ConnectionResult.cs (2)
9public readonly TimeSpan? KeepAlive; 11public ConnectionResult(Reason closeReason, TimeSpan? keepAlive = null)
DebugMode.cs (1)
19Thread.Sleep(TimeSpan.FromSeconds(3));
DefaultRequestDispatcher.cs (5)
33TimeSpan? keepAlive = null) 41var keepAliveTimeout = DefaultServerKeepAlive; 449public TimeSpan TimeSpan; 452public KeepAlive(TimeSpan timeSpan, bool isDefault) 458public KeepAlive Update(TimeSpan timeSpan)
EventBus.cs (1)
13public virtual void UpdateKeepAlive(TimeSpan timeSpan)
RequestDispatcher.cs (5)
11public static readonly TimeSpan DefaultServerKeepAlive = TimeSpan.FromMinutes(10); 17public static readonly TimeSpan GCTimeout = TimeSpan.FromSeconds(30); 21public static RequestDispatcher Create(ConnectionHost connectionHost, CompilerHost compilerHost, CancellationToken cancellationToken, EventBus eventBus, TimeSpan? keepAlive = null)
ServerCommand.cs (3)
95TimeSpan? keepAlive = null; 99keepAlive = TimeSpan.FromSeconds(result); 117protected virtual void ExecuteServerCore(ConnectionHost host, CompilerHost compilerHost, CancellationToken cancellationToken, EventBus eventBus, TimeSpan? keepAlive)
ServerProtocol\ServerConnection.cs (1)
186pipeTask = Client.ConnectAsync(pipeName, TimeSpan.FromMilliseconds(timeout), cancellationToken);
ServerProtocol\ServerRequest.cs (3)
47public TimeSpan? KeepAlive 51TimeSpan? keepAlive = null; 61keepAlive = TimeSpan.FromSeconds(result);
ShutdownCommand.cs (1)
43using (var client = await Client.ConnectAsync(Pipe.Value(), timeout: TimeSpan.FromSeconds(5), cancellationToken: Cancelled))
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));
Shared (20)
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 (2)
61public TimeSpan? ReconnectionInterval 66if (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 (46)
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);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.GetJsonTypeInfo.g.cs (1)
372if (type == typeof(global::System.TimeSpan))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestTypesContext.TimeSpan.g.cs (8)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>? _TimeSpan; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> TimeSpan 24get => _TimeSpan ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan>)Options.GetTypeInfo(typeof(global::System.TimeSpan)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> Create_TimeSpan(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.TimeSpan>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.TimeSpan> jsonTypeInfo)) 31jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.TimeSpan>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.TimeSpanConverter);
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))]
Stress.ApiService (3)
LargeTelemetryGenerator.cs (1)
489var timeSinceEpoch = dateTime.ToUniversalTime() - DateTime.UnixEpoch;
Program.cs (2)
154await Task.Delay(TimeSpan.FromSeconds(0.5)); 295while (stopwatch.Elapsed < TimeSpan.FromMinutes(1))
Stress.AppHost (1)
TestResource.cs (1)
173using var timer = new PeriodicTimer(TimeSpan.FromSeconds(seconds));
Stress.TelemetryService (2)
TelemetryStresser.cs (2)
43await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken); 186var 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) 1697private static void ValidateTimeout(TimeSpan timeout)
System.Collections.Immutable (1)
System\Collections\Frozen\Constants.cs (1)
59typeof(T) == typeof(TimeSpan) ||
System.CommandLine (7)
Binding\ArgumentConverter.StringConverters.cs (3)
278[typeof(TimeSpan)] = (string input, out object? value) => 280if (TimeSpan.TryParse(input, out var timeSpan))
Invocation\ProcessTerminationHandler.cs (2)
18private readonly TimeSpan _processTerminationTimeout; 27TimeSpan processTerminationTimeout)
InvocationConfiguration.cs (2)
25public TimeSpan? ProcessTerminationTimeout { get; set; } = TimeSpan.FromSeconds(2);
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 (13)
_generated\0\RegexGenerator.g.cs (2)
139internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
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)
176[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 (75)
_generated\0\RegexGenerator.g.cs (2)
581internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
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 (18)
36private const int TicksPerMinute = TicksPerSecond * (int)TimeSpan.SecondsPerMinute; 37private const int TicksPerHour = TicksPerSecond * (int)TimeSpan.SecondsPerHour; 38private const int TicksPerDay = TicksPerSecond * (int)TimeSpan.SecondsPerDay; 57private static TimeSpan MinTimeSpan 63private static TimeSpan MaxTimeSpan 208private static TimeSpan ToTimeSpan(SqlDateTime value) 211return new TimeSpan(value.m_day * TimeSpan.TicksPerDay + 212millisecond * TimeSpan.TicksPerMillisecond); 227long dayticks = daypart * TimeSpan.TicksPerDay; 228long timeticks = ((long)(timepart / TicksPerMillisecond + 0.5)) * TimeSpan.TicksPerMillisecond; 235private static SqlDateTime FromTimeSpan(TimeSpan value) 242long ticks = value.Ticks - day * TimeSpan.TicksPerDay; 247ticks += TimeSpan.TicksPerDay; 250int time = (int)((double)ticks / TimeSpan.TicksPerMillisecond * TicksPerMillisecond + 0.5); 379public static SqlDateTime operator +(SqlDateTime x, TimeSpan t) 385public static SqlDateTime operator -(SqlDateTime x, TimeSpan t) 395public static SqlDateTime Add(SqlDateTime x, TimeSpan t) 401public 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)
1820new NameType("duration", typeof(TimeSpan) ), /* XSD Apr */
System.Data.Odbc (15)
_generated\1\RegexGenerator.g.cs (2)
581internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
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\runtime\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 (16)
_generated\4\RegexGenerator.g.cs (2)
581internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
ColumnBinding.cs (3)
565Value_DBTIME((TimeSpan)value); 837private TimeSpan Value_DBTIME() 843private void Value_DBTIME(TimeSpan value)
OleDb_Enum.cs (2)
137private static readonly NativeDBType D_DBTime = new NativeDBType(0xff, 6, true, false, OleDbType.DBTime, NativeDBType.DBTIME, S_DBTIME, typeof(System.TimeSpan), NativeDBType.DBTIME, DbType.Time); // 7 - (tagDBTime) 302else if (value is System.TimeSpan)
OleDbDataReader.cs (2)
1080public TimeSpan GetTimeSpan(int ordinal) 1082return (TimeSpan)GetValue(ordinal);
System\Data\Common\AdapterUtil.cs (2)
963long result = checked((long)seconds * TimeSpan.TicksPerSecond); 982long result = timerValue / TimeSpan.TicksPerMillisecond;
System\Data\ProviderBase\DbBuffer.cs (2)
647internal TimeSpan ReadTime(int offset) 656internal void WriteTime(int offset, TimeSpan value)
System\Data\ProviderBase\DbConnectionPool.cs (1)
440internal TimeSpan LoadBalanceTimeout
System\Data\ProviderBase\DbConnectionPoolOptions.cs (2)
12private readonly TimeSpan _loadBalanceTimeout; 46public TimeSpan LoadBalanceTimeout
System.Diagnostics.DiagnosticSource (14)
System\Diagnostics\Activity.cs (4)
211/// <see cref="TimeSpan.Zero"/>. 213public TimeSpan Duration { get; private set; } 866if (Duration == TimeSpan.Zero) 2273public TimeSpan Duration => activity.Duration;
System\Diagnostics\DiagnosticSourceActivity.cs (1)
57if (activity.Duration == TimeSpan.Zero)
System\Diagnostics\DsesActivitySourceListener.cs (2)
161[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)
504_aggregationManager.SetCollectionPeriod(TimeSpan.FromSeconds(refreshIntervalSecs));
System.Diagnostics.EventLog (5)
System\Diagnostics\Reader\EventLogReader.cs (4)
127private bool GetNextBatch(TimeSpan ts) 130if (ts != TimeSpan.MaxValue) 154return ReadEvent(TimeSpan.MaxValue); 157public EventRecord? ReadEvent(TimeSpan timeout)
System\Diagnostics\Reader\ProviderMetadataCachedInformation.cs (1)
114TimeSpan timeDifference = timeNow.Subtract(kvp.Value.TheTime);
System.Diagnostics.Process (32)
Microsoft\Win32\SafeHandles\SafeProcessHandle.cs (2)
302public bool TryWaitForExit(TimeSpan timeout, [NotNullWhen(true)] out ProcessExitStatus? exitStatus) 326public ProcessExitStatus WaitForExitOrKillOnTimeout(TimeSpan timeout)
System\Diagnostics\Process.cs (8)
246public partial TimeSpan PrivilegedProcessorTime { get; } 264public partial TimeSpan TotalProcessorTime { get; } 282public partial TimeSpan UserProcessorTime { get; } 826/// Use <see cref="WaitForInputIdle(TimeSpan)"/> to force the processing of your application 835public bool WaitForInputIdle(TimeSpan timeout) => WaitForInputIdle(ProcessUtils.ToTimeoutMilliseconds(timeout)); 1660public bool WaitForExit(TimeSpan timeout) => WaitForExit(ProcessUtils.ToTimeoutMilliseconds(timeout)); 1836/// <inheritdoc cref="SafeProcessHandle.TryWaitForExit(TimeSpan, out ProcessExitStatus?)"/> 1840public bool TryWaitForExitStatus(TimeSpan timeout, [NotNullWhen(true)] out ProcessExitStatus? exitStatus)
System\Diagnostics\Process.Linux.cs (4)
16public partial TimeSpan PrivilegedProcessorTime 33internal static DateTime BootTimeToDateTime(TimeSpan timespanAfterBoot) 82public partial TimeSpan TotalProcessorTime 96public partial TimeSpan UserProcessorTime
System\Diagnostics\Process.Multiplexing.cs (4)
44public (string StandardOutput, string StandardError) ReadAllText(TimeSpan? timeout = default) 93public (byte[] StandardOutput, byte[] StandardError) ReadAllBytes(TimeSpan? timeout = default) 146public IEnumerable<ProcessOutputLine> ReadAllLines(TimeSpan? timeout = default) 628TimeSpan? timeout,
System\Diagnostics\Process.Scenarios.cs (8)
103public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeout = default) 140public static ProcessExitStatus Run(string fileName, IEnumerable<string>? arguments = null, bool silent = false, TimeSpan? timeout = default) 234public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, TimeSpan? timeout = default) 259TimeSpan elapsed = Stopwatch.GetElapsedTime(startTimestamp); 260TimeSpan remaining = timeout.Value - elapsed; 261remaining = remaining >= TimeSpan.Zero ? remaining : TimeSpan.Zero; 292public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable<string>? arguments = null, TimeSpan? timeout = default)
System\Diagnostics\Process.Unix.cs (2)
460internal static TimeSpan TicksToTimeSpan(double ticks) 476return TimeSpan.FromSeconds(ticks / (double)ticksPerSecond);
System\Diagnostics\ProcessThread.Linux.cs (3)
39public TimeSpan PrivilegedProcessorTime 58public TimeSpan TotalProcessorTime 74public TimeSpan UserProcessorTime
System\Diagnostics\ProcessUtils.cs (1)
50internal static int ToTimeoutMilliseconds(TimeSpan timeout)
System.DirectoryServices (13)
System\DirectoryServices\ActiveDirectory\ActiveDirectorySchedule.cs (1)
54_utcOffSet = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now).Ticks / TimeSpan.TicksPerHour;
System\DirectoryServices\ActiveDirectory\ActiveDirectorySiteLink.cs (3)
22private readonly TimeSpan _systemDefaultInterval = new TimeSpan(0, 15, 0); 283public TimeSpan ReplicationInterval 310if (value < TimeSpan.Zero)
System\DirectoryServices\ActiveDirectory\ADSearcher.cs (1)
11private static readonly TimeSpan s_defaultTimeSpan = new TimeSpan(0, 120, 0);
System\DirectoryServices\ActiveDirectory\ConfigSet.cs (1)
30private static readonly TimeSpan s_locationTimeout = new TimeSpan(0, 4, 0);
System\DirectoryServices\DirectorySearcher.cs (7)
23private static readonly TimeSpan s_minusOneSecond = new TimeSpan(0, 0, -1); 29private TimeSpan _serverTimeLimit = s_minusOneSecond; 30private TimeSpan _clientTimeout = s_minusOneSecond; 32private TimeSpan _serverPageTimeLimit = s_minusOneSecond; 171public TimeSpan ClientTimeout 284public TimeSpan ServerPageTimeLimit 303public TimeSpan ServerTimeLimit
System.DirectoryServices.Protocols (31)
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) 193public DirectoryResponse SendRequest(DirectoryRequest request, TimeSpan requestTimeout) 263public IAsyncResult BeginSendRequest(DirectoryRequest request, TimeSpan requestTimeout, PartialResultProcessing partialMode, AsyncCallback callback, object state) 724int searchTimeLimit = (int)(searchRequest.TimeLimit.Ticks / TimeSpan.TicksPerSecond); 1344internal async ValueTask<DirectoryResponse> ConstructResponseAsync(int messageId, LdapOperation operation, ResultAll resultType, TimeSpan requestTimeOut, bool exceptionOnTimeOut, bool sync) 1348tv_sec = (int)(requestTimeOut.Ticks / TimeSpan.TicksPerSecond)
System\DirectoryServices\Protocols\ldap\LdapConnection.Linux.cs (3)
85tv_sec = (int)(_connectionTimeOut.Ticks / TimeSpan.TicksPerSecond), 86tv_usec = (int)((_connectionTimeOut.Ticks % TimeSpan.TicksPerSecond) / TimeSpan.TicksPerMicrosecond) // Convert 100ns ticks to microseconds
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)
118new DateTimeOffset((secondsSinceUnixEpoch * TimeSpan.TicksPerSecond) + DateTime.UnixEpoch.Ticks, TimeSpan.Zero); 122new DateTimeOffset((long)(secondsSinceUnixEpoch * TimeSpan.TicksPerSecond) + DateTime.UnixEpoch.Ticks, TimeSpan.Zero); 126((decimal)(dateTimeOffset.UtcDateTime - DateTime.UnixEpoch).Ticks) / TimeSpan.TicksPerSecond;
System.IO.FileSystem.Watcher (2)
System\IO\FileSystemWatcher.cs (2)
614public WaitForChangedResult WaitForChanged(WatcherChangeTypes changeType, TimeSpan timeout) => 617private 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)
133public void Connect(TimeSpan timeout) => Connect(ToTimeoutMilliseconds(timeout)); 205public Task ConnectAsync(TimeSpan timeout, CancellationToken cancellationToken = default) => 208private 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 (64)
System\Management\ManagementDateTime.cs (24)
10/// <see cref='System.DateTime'/> and <see cref='System.TimeSpan'/> format and vice versa. 177ticks = (long.Parse(tempString, (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long)))) * (TimeSpan.TicksPerMillisecond / 1000); 201datetime = datetime.AddMinutes(-(utcOffset - TimeZoneInfo.Local.GetUtcOffset(datetime).Ticks / TimeSpan.TicksPerMinute)); 238TimeSpan tickOffset = date.Kind == DateTimeKind.Utc ? TimeSpan.Zero : TimeZoneInfo.Local.GetUtcOffset(date); 239long OffsetMins = (tickOffset.Ticks / System.TimeSpan.TicksPerMinute); 252UtcString = "+" + ((tickOffset.Ticks / System.TimeSpan.TicksPerMinute)).ToString(frmInt32).PadLeft(3, '0'); 272long microsec = ((date.Ticks - dtTemp.Ticks) * 1000) / System.TimeSpan.TicksPerMillisecond; 287/// <para>Converts a given DMTF time interval to <see cref='System.TimeSpan'/> object.</para> 291/// <para>A <see cref='System.TimeSpan'/> object that represents the given DMTF time interval.</para> 296/// <see cref='System.TimeSpan.MaxValue'/> then <see cref='System.ArgumentOutOfRangeException'/> is thrown. 309public static TimeSpan ToTimeSpan(string dmtfTimespan) 318TimeSpan timespan = TimeSpan.MinValue; 355ticks = (long.Parse(tempString, (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long)))) * (System.TimeSpan.TicksPerMillisecond / 1000); 371TimeSpan tsTemp = System.TimeSpan.FromTicks(ticks); 378/// <para>Converts a given <see cref='System.TimeSpan'/> object to DMTF time interval.</para> 380/// <param name='timespan'> A <see cref='System.TimeSpan'/> object representing the datetime to be converted to DMTF time interval. 388/// DMTF is microseconds and in <see cref='System.TimeSpan'/> is Ticks , which is equivalent 405public static string ToDmtfTimeInterval(TimeSpan timespan) 414if (timespan.Days > MAXDATE_INTIMESPAN || timespan < TimeSpan.Zero) 426TimeSpan tsTemp = new TimeSpan(timespan.Days, timespan.Hours, timespan.Minutes, timespan.Seconds, 0); 427long microsec = ((timespan.Ticks - tsTemp.Ticks) * 1000) / System.TimeSpan.TicksPerMillisecond;
System\Management\ManagementOptions.cs (15)
125public static readonly TimeSpan InfiniteTimeout = TimeSpan.MaxValue; 129internal TimeSpan timeout; 204public TimeSpan Timeout 221internal ManagementOptions(ManagementNamedValueCollection context, TimeSpan timeout) : this(context, timeout, 0) { } 222internal ManagementOptions(ManagementNamedValueCollection context, TimeSpan timeout, int flags) 535TimeSpan timeout, 700public EventWatcherOptions(ManagementNamedValueCollection context, TimeSpan timeout, int blockSize) 846public ObjectGetOptions(ManagementNamedValueCollection context, TimeSpan timeout, bool useAmendedQualifiers) : base(context, timeout) 1005public PutOptions(ManagementNamedValueCollection context, TimeSpan timeout, bool useAmendedQualifiers, PutType putType) : base(context, timeout) 1096public DeleteOptions(ManagementNamedValueCollection context, TimeSpan timeout) : base(context, timeout) { } 1183public InvokeMethodOptions(ManagementNamedValueCollection context, TimeSpan timeout) : base(context, timeout) { } 1578ManagementNamedValueCollection context, TimeSpan timeout) : base(context, timeout) 1622ManagementNamedValueCollection context, TimeSpan timeout) : base(context, timeout) 1689internal ConnectionOptions(ManagementNamedValueCollection context, TimeSpan timeout, int flags) : base(context, timeout, flags) { }
System\Management\ManagementQuery.cs (25)
2424private TimeSpan withinInterval; 2426private TimeSpan groupWithinInterval; 2439public WqlEventQuery() : this(null, TimeSpan.Zero, null, TimeSpan.Zero, null, null) { } 2514public WqlEventQuery(string eventClassName, string condition) : this(eventClassName, TimeSpan.Zero, condition, TimeSpan.Zero, null, null) { } 2538public WqlEventQuery(string eventClassName, TimeSpan withinInterval) : 2539this(eventClassName, withinInterval, null, TimeSpan.Zero, null, null) 2570public WqlEventQuery(string eventClassName, TimeSpan withinInterval, string condition) : 2571this(eventClassName, withinInterval, condition, TimeSpan.Zero, null, null) 2602public WqlEventQuery(string eventClassName, string condition, TimeSpan groupWithinInterval) : 2603this(eventClassName, TimeSpan.Zero, condition, groupWithinInterval, null, null) 2641public WqlEventQuery(string eventClassName, string condition, TimeSpan groupWithinInterval, string[] groupByPropertyList) : 2642this(eventClassName, TimeSpan.Zero, condition, groupWithinInterval, groupByPropertyList, null) 2682public WqlEventQuery(string eventClassName, TimeSpan withinInterval, string condition, TimeSpan groupWithinInterval, 2802/// valid <see cref='System.TimeSpan'/> 2827public TimeSpan WithinInterval 2863public TimeSpan GroupWithinInterval 2975if (withinInterval != TimeSpan.Zero) 2983if (groupWithinInterval != TimeSpan.Zero) 3019withinInterval = TimeSpan.Zero; 3021groupWithinInterval = TimeSpan.Zero; 3053withinInterval = TimeSpan.FromSeconds(((IConvertible)intervalString).ToDouble(null)); 3066groupWithinInterval = TimeSpan.FromSeconds(((IConvertible)intervalString).ToDouble(null));
System.Net.Http (123)
src\runtime\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; 105public TimeSpan Timeout 112ArgumentOutOfRangeException.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)
245TimeSpan 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)
915TimeSpan pooledConnectionLifetime = _poolManager.Settings._pooledConnectionLifetime; 931TimeSpan lifetime = _poolManager.Settings._pooledConnectionLifetime; 934return lifetime == TimeSpan.Zero || connection.Age > lifetime; 1087TimeSpan pooledConnectionLifetime = _poolManager.Settings._pooledConnectionLifetime; 1088TimeSpan pooledConnectionIdleTimeout = _poolManager.Settings._pooledConnectionIdleTimeout;
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (2)
430private 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)
656private 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)
562private static int ScavengeHttp3ConnectionList(List<Http3Connection> list, ref List<HttpConnectionBase>? toDispose, long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout) 650internal void HandleAltSvc(IEnumerable<string> altSvcHeaderValues, TimeSpan? responseAge) 653TimeSpan nextAuthorityMaxAge = default; 693TimeSpan authorityMaxAge = value.MaxAge; 701if (authorityMaxAge <= TimeSpan.Zero) 718if (nextAuthorityMaxAge.Ticks > (30 * TimeSpan.TicksPerDay)) 720nextAuthorityMaxAge = 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)
182static 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)
977TimeSpan duration = Stopwatch.GetElapsedTime(_startTimestamp);
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (6)
234internal TimeSpan Age => TimeSpan.FromMilliseconds(GetLifetimeTicks(Environment.TickCount64)); 341public bool IsUsable(long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout) 356if (NetEventSource.Log.IsEnabled()) Trace($"Scavenging connection. Idle {TimeSpan.FromMilliseconds(idleTicks)} > {pooledConnectionIdleTimeout}."); 367if (NetEventSource.Log.IsEnabled()) Trace($"Scavenging connection. Lifetime {TimeSpan.FromMilliseconds(lifetimeTicks)} > {pooledConnectionLifetime}.");
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (8)
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); 105_cleanPoolTimeout = TimeSpan.FromSeconds(MaxEvictionIntervalSeconds); 506private 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)
168public void RequestLeftQueue(HttpRequestMessage request, HttpConnectionPool pool, TimeSpan duration, int versionMajor)
System\Net\Http\SocketsHttpHandler\SocketsHttpConnectionEvictionContext.cs (2)
80public TimeSpan Age => TimeSpan.FromMilliseconds(Environment.TickCount64 - _creationTickCount);
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) || 347public TimeSpan KeepAlivePingDelay 352if (value.Ticks < TimeSpan.TicksPerSecond && value != Timeout.InfiniteTimeSpan) 354throw new ArgumentOutOfRangeException(nameof(value), value, SR.Format(SR.net_http_value_must_be_greater_than_or_equal, value, TimeSpan.FromSeconds(1))); 372public TimeSpan KeepAlivePingTimeout 377if (value.Ticks < TimeSpan.TicksPerSecond && value != Timeout.InfiniteTimeSpan) 379throw 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 (30)
src\runtime\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\WinHttpHandler.cs (22)
49private static readonly TimeSpan s_maxTimeout = TimeSpan.FromMilliseconds(int.MaxValue); 52private static readonly TimeSpan s_cleanCachedCertificateTimeout = TimeSpan.FromMilliseconds((int?)AppDomain.CurrentDomain.GetData("System.Net.Http.WinHttpCertificateCachingCleanupTimerInterval") ?? 60_000); 82private TimeSpan _sendTimeout = TimeSpan.FromSeconds(30); 83private TimeSpan _receiveHeadersTimeout = TimeSpan.FromSeconds(30); 84private TimeSpan _receiveDataTimeout = TimeSpan.FromSeconds(30); 88private TimeSpan _tcpKeepAliveTime = TimeSpan.FromHours(2); 89private TimeSpan _tcpKeepAliveInterval = TimeSpan.FromSeconds(1); 406public TimeSpan SendTimeout 422public TimeSpan ReceiveHeadersTimeout 437public TimeSpan ReceiveDataTimeout 481public TimeSpan TcpKeepAliveTime 503public TimeSpan TcpKeepAliveInterval 1604private static void CheckTimeSpanPropertyValue(TimeSpan timeSpan) 1606if (timeSpan != Timeout.InfiniteTimeSpan && (timeSpan <= TimeSpan.Zero || timeSpan > s_maxTimeout)) 1739private void ChangeCleanerTimer(TimeSpan timeout)
System.Net.HttpListener (18)
System\Net\HttpListenerContext.cs (1)
30public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync(string? subProtocol, TimeSpan keepAliveInterval)
System\Net\Managed\HttpListenerContext.Managed.cs (2)
87public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync(string? subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval) 92public 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 (58)
System\Net\DnsRecords.cs (14)
14public TimeSpan Ttl { get; } 16internal AddressRecord(IPAddress address, TimeSpan ttl) 40public TimeSpan Ttl { get; } 44internal SrvRecord(string target, ushort port, ushort priority, ushort weight, TimeSpan ttl, IReadOnlyList<AddressRecord>? addresses) 64public TimeSpan Ttl { get; } 66internal MxRecord(string exchange, ushort preference, TimeSpan ttl) 82public TimeSpan Ttl { get; } 84internal TxtRecord(IReadOnlyList<string> values, TimeSpan ttl) 97public TimeSpan Ttl { get; } 99internal CNameRecord(string canonicalName, TimeSpan ttl) 112public TimeSpan Ttl { get; } 114internal PtrRecord(string name, TimeSpan ttl) 127public TimeSpan Ttl { get; } 129internal NsRecord(string name, TimeSpan ttl)
System\Net\DnsResolver.cs (9)
492return new DnsResult<AddressRecord>(DnsResponseCode.NoError, merged, TimeSpan.Zero); 498TimeSpan negTtl = MinNonZero(a.NegativeCacheTtl, b.NegativeCacheTtl); 503private static TimeSpan MinNonZero(TimeSpan x, TimeSpan y) 505if (x <= TimeSpan.Zero) 507return y > TimeSpan.Zero ? y : TimeSpan.Zero; 510if (y <= TimeSpan.Zero)
System\Net\DnsResolverPal.Managed.cs (28)
42private static readonly TimeSpan s_queryTimeout = TimeSpan.FromSeconds(3); 153records.Add(new AddressRecord(a.ToIPAddress(), TimeSpan.FromSeconds(record.TimeToLive))); 162records.Add(new AddressRecord(aaaa.ToIPAddress(), TimeSpan.FromSeconds(record.TimeToLive))); 168TimeSpan negTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 218list.Add(new AddressRecord(address, TimeSpan.FromSeconds(record.TimeToLive))); 230records.Add(new SrvRecord(target, port, priority, weight, TimeSpan.FromSeconds(ttl), attached)); 233TimeSpan negTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 259records.Add(new TxtRecord(values, TimeSpan.FromSeconds(record.TimeToLive))); 263TimeSpan txtNegTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 284records.Add(new MxRecord(mx.Exchange.ToString(), mx.Preference, TimeSpan.FromSeconds(record.TimeToLive))); 288TimeSpan mxNegTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 309records.Add(new CNameRecord(cname.CName.ToString(), TimeSpan.FromSeconds(record.TimeToLive))); 313TimeSpan cnameNegTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 334records.Add(new PtrRecord(ptr.Name.ToString(), TimeSpan.FromSeconds(record.TimeToLive))); 338TimeSpan ptrNegTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 359records.Add(new NsRecord(ns.Name.ToString(), TimeSpan.FromSeconds(record.TimeToLive))); 363TimeSpan nsNegTtl = records.Count == 0 ? ExtractNegativeCacheTtl(response) : TimeSpan.Zero; 369private static TimeSpan ExtractNegativeCacheTtl(ReadOnlySpan<byte> response) 383return TimeSpan.FromSeconds(negTtl); 387return TimeSpan.Zero;
System\Net\DnsResult.cs (3)
31/// Availability is best-effort and platform-dependent; the value is <see cref="TimeSpan.Zero"/> 34public TimeSpan NegativeCacheTtl { get; } 36internal DnsResult(DnsResponseCode responseCode, IReadOnlyList<T>? records, TimeSpan negativeCacheTtl)
System\Net\DnsSocket.cs (1)
147public void ConnectWithTimeout(EndPoint remoteEndPoint, TimeSpan timeout)
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) 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\runtime\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\runtime\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)
105TimeSpan? reconnectionInterval) 132Debug.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)
32/// <summary>The maximum number of milliseconds representible by <see cref="System.TimeSpan"/>.</summary> 33private readonly long TimeSpan_MaxValueMilliseconds = (long)TimeSpan.MaxValue.TotalMilliseconds; 86private TimeSpan? _nextReconnectionInterval; 456TimeSpan timeSpan = milliseconds == TimeSpan_MaxValueMilliseconds ? TimeSpan.MaxValue : TimeSpan.FromMilliseconds(milliseconds); 483public 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)
2385public bool Poll(TimeSpan timeout, SelectMode mode) => 2440public static void Select(IList? checkRead, IList? checkWrite, IList? checkError, TimeSpan timeout) => 2443private static int ToTimeoutMicroseconds(TimeSpan timeout) 2450ArgumentOutOfRangeException.ThrowIfLessThan(timeout, TimeSpan.Zero);
System.Net.WebSockets (34)
src\runtime\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) 1160await 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 (2)
System\Net\WebSockets\BrowserWebSockets\ClientWebSocketOptions.cs (2)
118public TimeSpan KeepAliveInterval 125public TimeSpan KeepAliveTimeout
System.Private.CoreLib (803)
src\runtime\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\runtime\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) 181public SystemTimeProviderTimer(TimeSpan dueTime, TimeSpan period, TimerCallback callback, object? state) 207public bool Change(TimeSpan dueTime, TimeSpan period)
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppDomain.Unix.cs (1)
8public TimeSpan MonitoringTotalProcessorTime
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (1)
116private static TimeSpan NullOffset => new TimeSpan(DateTimeFormat.NullOffset);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.Helpers.cs (4)
34long offsetTicks = (((long)offsetHours) * 3600 + ((long)offsetMinutes) * 60) * TimeSpan.TicksPerSecond; 167long ticks = totalDays * TimeSpan.TicksPerDay; 169ticks += totalSeconds * TimeSpan.TicksPerSecond; 175ticks += TimeSpan.TicksPerDay;
src\runtime\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\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\ComponentModel\DefaultValueAttribute.cs (2)
63else if (type == typeof(TimeSpan) && value != null) 65_value = TimeSpan.Parse(value);
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\DateTime.cs (78)
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); 1520public int Second => (int)((UTicks / TimeSpan.TicksPerSecond) % 60); 1531public TimeSpan TimeOfDay => new TimeSpan((long)(UTicks % TimeSpan.TicksPerDay)); 1641public TimeSpan Subtract(DateTime value) 1646public DateTime Subtract(TimeSpan value) 1658if (value < TimeSpan.TicksPerDay) // This is a fix for VB. They want the default day to be 1/1/0001 rather than 12/30/1899. 1664long millis = (value - DoubleDateOffset) / TimeSpan.TicksPerMillisecond; 1667long frac = millis % TimeSpan.MillisecondsPerDay; 1668if (frac != 0) millis -= (TimeSpan.MillisecondsPerDay + frac) * 2; 1670return (double)millis / TimeSpan.MillisecondsPerDay; 1846public static DateTime operator +(DateTime d, TimeSpan t) 1853public static DateTime operator -(DateTime d, TimeSpan t) 1860public static TimeSpan operator -(DateTime d1, DateTime d2) => new TimeSpan(d1.Ticks - d2.Ticks); 1996if ((uint)hour > 24 || (uint)minute >= 60 || (uint)millisecond >= TimeSpan.MillisecondsPerSecond) 2006ulong ticks = (DaysToYear((uint)year) + days[month - 1] + (uint)day - 1) * (ulong)TimeSpan.TicksPerDay; 2010ticks += TimeToTicks(hour, minute, second) + (uint)millisecond * (uint)TimeSpan.TicksPerMillisecond; 2019ticks += TimeToTicks(hour, minute, 59) + 999 * TimeSpan.TicksPerMillisecond; 2032ticks += TimeSpan.TicksPerDay;
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\CodeAnalysis\StringSyntaxAttribute.cs (1)
71/// <summary>The syntax identifier for strings containing <see cref="TimeSpan"/> format specifiers.</summary>
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (17)
96|| (_pollingInterval == TimeSpan.Zero && !s_counterGroupEnabledList!.Contains(this)) 147private TimeSpan _timeSinceCollectionStarted; 148private TimeSpan _pollingInterval; 149private TimeSpan _nextPollingOffset; 158TimeSpan interval = TimeSpan.FromSeconds(pollingIntervalInSeconds); 159if (_pollingInterval == TimeSpan.Zero || interval < _pollingInterval) 166_timeSinceCollectionStarted = TimeSpan.Zero; 196_pollingInterval = TimeSpan.Zero; 235TimeSpan nowOffset; 236TimeSpan elapsed; 237TimeSpan pollingInterval; 279TimeSpan delta = nowOffset - _nextPollingOffset; 285if (_pollingInterval > TimeSpan.Zero) 319TimeSpan nowOffset = Stopwatch.GetElapsedTime(counterGroup._baseTimestamp); 320TimeSpan timeUntilNextPoll = counterGroup._nextPollingOffset - nowOffset; 321if (timeUntilNextPoll < TimeSpan.FromMilliseconds(1))
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (6)
121private PropertyValue(TimeSpan value) : this(new Scalar() { AsTimeSpan = value }, sizeof(TimeSpan)) { } 143if (type == typeof(TimeSpan)) return value => new PropertyValue((TimeSpan)value!); 268if (type == typeof(TimeSpan)) { var f = GetGetMethod<TimeSpan>(property); return container => new PropertyValue(f((TContainer)container.ReferenceValue!)); }
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (1)
264public TimeSpanTypeInfo() : base(typeof(TimeSpan)) { }
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\Statics.cs (1)
557else if (dataType == typeof(TimeSpan))
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\GC.cs (2)
16public static GCNotificationStatus WaitForFullGCApproach(TimeSpan timeout) 25public static GCNotificationStatus WaitForFullGCComplete(TimeSpan timeout)
src\runtime\src\libraries\System.Private.CoreLib\src\System\GCMemoryInfo.cs (2)
75internal InlineArray2<TimeSpan> _pauseDurations; 181public ReadOnlySpan<TimeSpan> PauseDurations => _data._pauseDurations;
src\runtime\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\runtime\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\runtime\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 unsafe string Format(DateTime dateTime, string? format, IFormatProvider? provider, TimeSpan offset) 1048internal static bool TryFormat<TChar>(DateTime dateTime, Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider, TimeSpan offset) where TChar : unmanaged, IUtfChar<TChar> 1176dateTime.Ticks < TimeSpan.TicksPerDay && 1187private static void PrepareFormatU(ref DateTime dateTime, ref DateTimeFormatInfo dtfi, TimeSpan offset) 1471internal static unsafe bool TryFormatO<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1522int offsetTotalMinutes = (int)(offset.Ticks / TimeSpan.TicksPerMinute); 1586internal static unsafe bool TryFormatu<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1627internal static unsafe bool TryFormatR<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1692internal static unsafe bool TryFormatInvariantG<TChar>(DateTime value, TimeSpan offset, Span<TChar> destination, out int bytesWritten) where TChar : unmanaged, IUtfChar<TChar> 1728int offsetMinutes = (int)(offset.Ticks / TimeSpan.TicksPerMinute);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (32)
35internal static DateTime ParseExact(ReadOnlySpan<char> s, ReadOnlySpan<char> format, DateTimeFormatInfo dtfi, DateTimeStyles style, out TimeSpan offset) 66internal static bool TryParseExact(ReadOnlySpan<char> s, ReadOnlySpan<char> format, DateTimeFormatInfo dtfi, DateTimeStyles style, out DateTime result, out TimeSpan offset) 80offset = TimeSpan.Zero; 119DateTimeFormatInfo dtfi, DateTimeStyles style, out TimeSpan offset) 136DateTimeFormatInfo dtfi, DateTimeStyles style, out DateTime result, out TimeSpan offset) 150offset = TimeSpan.Zero; 505private static bool ParseTimeZone(ref __DTString str, scoped ref TimeSpan result) 2443internal static DateTime Parse(ReadOnlySpan<char> s, DateTimeFormatInfo dtfi, DateTimeStyles styles, out TimeSpan offset) 2474internal static bool TryParse(ReadOnlySpan<char> s, DateTimeFormatInfo dtfi, DateTimeStyles styles, out DateTime result, out TimeSpan offset) 2488offset = TimeSpan.Zero; 2716if (!time.TryAddTicks((long)Math.Round(raw.fraction * TimeSpan.TicksPerSecond), out time)) 2727if (!time.TryAddTicks(TimeSpan.TicksPerDay, out time)) 2817result.timeZoneOffset = TimeSpan.Zero; 2851result.timeZoneOffset = TimeSpan.Zero; 2889result.timeZoneOffset = TimeSpan.Zero; 2896result.timeZoneOffset = TimeSpan.Zero; 2914resultTicks += TimeSpan.TicksPerDay; 2939if (resultTicks < TimeSpan.TicksPerDay) 2952resultTicks += TimeSpan.TicksPerDay; 3047result.timeZoneOffset = TimeSpan.Zero; 3104if (!time.TryAddTicks((long)Math.Round(partSecond * TimeSpan.TicksPerSecond), out time)) 3113if (!time.TryAddTicks(TimeSpan.TicksPerDay, out time)) 3285private static bool ParseTimeZoneOffset(ref __DTString str, int len, scoped ref TimeSpan result) 4355TimeSpan tempTimeZoneOffset = new TimeSpan(0); 4371if ((result.flags & ParseFlags.TimeZoneUsed) != 0 && result.timeZoneOffset != TimeSpan.Zero) 4397if ((result.flags & ParseFlags.TimeZoneUsed) != 0 && result.timeZoneOffset != TimeSpan.Zero) 4410TimeSpan tempTimeZoneOffset = new TimeSpan(0); 4490result.timeZoneOffset = TimeSpan.Zero; 4552result.timeZoneOffset = TimeSpan.Zero; 4844if (!result.parsedDate.TryAddTicks((long)Math.Round(result.fraction * TimeSpan.TicksPerSecond), out result.parsedDate)) 4854if (!result.parsedDate.TryAddTicks(TimeSpan.TicksPerDay, out result.parsedDate)) 6207internal TimeSpan timeZoneOffset;
src\runtime\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\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\ISOWeek.cs (1)
158return jan4.AddTicks((ordinal - 4) * TimeSpan.TicksPerDay);
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (13)
19internal static unsafe string Format(TimeSpan value, string? format, IFormatProvider? formatProvider) 51internal static unsafe bool TryFormat<TChar>(TimeSpan value, Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? formatProvider) where TChar : unmanaged, IUtfChar<TChar> 84internal static unsafe string FormatC(TimeSpan value) 91private static unsafe 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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (1)
578return (time.UtcDateTime.Ticks - DateTimeOffset.UnixEpoch.Ticks - seconds * TimeSpan.TicksPerSecond) * NanosecondsPerTick;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (1)
594else if (type == typeof(TimeSpan))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\JitInfo.cs (2)
17public static TimeSpan GetCompilationTime(bool currentThread = false) 20return TimeSpan.FromTicks(GetCompilationTimeInTicks(currentThread));
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (2)
250/// of milliseconds by casting <see cref="TimeSpan.TotalMilliseconds"/> of the timeout to an integer value. A value 272public bool TryEnter(TimeSpan timeout) => TryEnter_Outlined(WaitHandle.ToTimeoutMilliseconds(timeout));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (8)
408/// <see cref="TimeSpan"/> to measure the time interval. 410/// <param name="timeout">A <see cref="TimeSpan"/> that represents the number of milliseconds 411/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 424public bool Wait(TimeSpan timeout) 436/// <see cref="TimeSpan"/> to measure the time interval, while observing a <see 439/// <param name="timeout">A <see cref="TimeSpan"/> that represents the number of milliseconds 440/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 457public bool Wait(TimeSpan timeout, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Monitor.cs (4)
13public static bool TryEnter(object obj, TimeSpan timeout) 16public static void TryEnter(object obj, TimeSpan timeout, ref bool lockTaken) 22public static bool Wait(object obj, TimeSpan timeout) => Wait(obj, WaitHandle.ToTimeoutMilliseconds(timeout)); 40public static bool Wait(object obj, TimeSpan timeout, bool exitContext)
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (17)
200/// cref="TimeSpan"/> to measure the time interval. 202/// <param name="timeout">A <see cref="TimeSpan"/> that represents the number of milliseconds 203/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 210public bool Wait(TimeSpan timeout) 226/// cref="TimeSpan"/> to measure the time interval, while observing a <see 229/// <param name="timeout">A <see cref="TimeSpan"/> that represents the number of milliseconds 230/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 240public bool Wait(TimeSpan timeout, CancellationToken cancellationToken) 564/// cref="TimeSpan"/> to measure the time interval, while observing a 568/// A <see cref="TimeSpan"/> that represents the number of milliseconds 569/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 582public Task<bool> WaitAsync(TimeSpan timeout) 598/// cref="TimeSpan"/> to measure the time interval. 601/// A <see cref="TimeSpan"/> that represents the number of milliseconds 602/// to wait, or a <see cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 615public Task<bool> WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) 773TimeSpan.FromMilliseconds(millisecondsTimeout),
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (2)
272/// A <see cref="TimeSpan"/> that represents the number of milliseconds to wait, 279public static bool SpinUntil(Func<bool> condition, TimeSpan timeout)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task_T.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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (25)
2793/// A <see cref="TimeSpan"/> that represents the number of milliseconds to wait, or a <see 2794/// cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 2808public bool Wait(TimeSpan timeout) => Wait(timeout, default); 2832public bool Wait(TimeSpan timeout, CancellationToken cancellationToken) 2954public Task WaitAsync(TimeSpan timeout) => WaitAsync(ValidateTimeout(timeout, ExceptionArgument.timeout), TimeProvider.System, default); 2961public Task WaitAsync(TimeSpan timeout, TimeProvider timeProvider) 2971public Task WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) => 2980public Task WaitAsync(TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken) 3045_timer = timeProvider.CreateTimer(callback, this, TimeSpan.FromMilliseconds(millisecondsDelay), Timeout.InfiniteTimeSpan); 4932/// A <see cref="TimeSpan"/> that represents the number of milliseconds to wait, or a <see 4933/// cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 4952public static bool WaitAll(Task[] tasks, TimeSpan timeout) 5360/// A <see cref="TimeSpan"/> that represents the number of milliseconds to wait, or a <see 5361/// cref="TimeSpan"/> that represents -1 milliseconds to wait indefinitely. 5379public static int WaitAny(Task[] tasks, TimeSpan timeout) 5852public static Task Delay(TimeSpan delay) => Delay(delay, TimeProvider.System, default); 5855/// <param name="delay">The <see cref="TimeSpan"/> to wait before completing the returned task, or <see cref="Timeout.InfiniteTimeSpan"/> to wait indefinitely.</param> 5859/// <exception cref="ArgumentOutOfRangeException"><paramref name="delay"/>'s <see cref="TimeSpan.TotalMilliseconds"/> property is greater than 4294967294.</exception> 5861public static Task Delay(TimeSpan delay, TimeProvider timeProvider) => Delay(delay, timeProvider, default); 5881public static Task Delay(TimeSpan delay, CancellationToken cancellationToken) => 5885/// <param name="delay">The <see cref="TimeSpan"/> to wait before completing the returned task, or <see cref="Timeout.InfiniteTimeSpan"/> to wait indefinitely.</param> 5890/// <exception cref="ArgumentOutOfRangeException"><paramref name="delay"/>'s <see cref="TimeSpan.TotalMilliseconds"/> property is greater than 4294967294.</exception> 5892public static Task Delay(TimeSpan delay, TimeProvider timeProvider, CancellationToken cancellationToken) 5946internal static uint ValidateTimeout(TimeSpan timeout, ExceptionArgument argument) 5983_timer = timeProvider.CreateTimer(s_timerCallback, this, TimeSpan.FromMilliseconds(millisecondsDelay), Timeout.InfiniteTimeSpan);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (2)
561public bool Join(TimeSpan timeout) => Join(WaitHandle.ToTimeoutMilliseconds(timeout)); 563public static void Sleep(TimeSpan timeout) => Sleep(WaitHandle.ToTimeoutMilliseconds(timeout));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (2)
1501TimeSpan timeout, 1522TimeSpan timeout,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Timeout.cs (1)
11public static readonly TimeSpan InfiniteTimeSpan = new TimeSpan(0, 0, 0, 0, Infinite);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (16)
482internal TimerQueueTimer(TimerCallback timerCallback, object? state, TimeSpan dueTime, TimeSpan period, bool flowExecutionContext) : 487private static uint GetMilliseconds(TimeSpan time, [CallerArgumentExpression(nameof(time))] string? parameter = null) 524"DueTime = " + (_dueTime == Timeout.UnsignedInfinite ? "(not set)" : TimeSpan.FromMilliseconds(_dueTime)) + ", " + 525"Period = " + (_period == Timeout.UnsignedInfinite ? "(not set)" : TimeSpan.FromMilliseconds(_period)) + ", " + 530public bool Change(TimeSpan dueTime, TimeSpan period) => 754return (TimerQueue.s_tickCountToTimeMap.Time + TimeSpan.FromMilliseconds(msOffset)); 761public TimeSpan? DueTime => _timer._dueTime == Timeout.UnsignedInfinite ? null : TimeSpan.FromMilliseconds(_timer._dueTime); 763public TimeSpan? Period => _timer._period == Timeout.UnsignedInfinite ? null : TimeSpan.FromMilliseconds(_timer._period); 844TimeSpan dueTime, 845TimeSpan period) 910public bool Change(TimeSpan dueTime, TimeSpan period) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (8)
79internal static int ToTimeoutMilliseconds(TimeSpan timeout) 501public virtual bool WaitOne(TimeSpan timeout) => WaitOneNoCheck(ToTimeoutMilliseconds(timeout)); 504public virtual bool WaitOne(TimeSpan timeout, bool exitContext) => WaitOneNoCheck(ToTimeoutMilliseconds(timeout)); 508public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout) => 514public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext) => 523public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout) => 529public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext) => 534public static bool SignalAndWait(WaitHandle toSignal, WaitHandle toWaitOn, TimeSpan timeout, bool exitContext) =>
src\runtime\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\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Cache.cs (18)
203private bool IsAmbiguousLocalTime(DateTime localDateTime, Span<TimeSpan> offsets = default) 237TimeSpan offset = offsets[0]; 299if (TryGetUtcOffset(localDateTime, out TimeSpan offset)) 315private TimeSpan GetOffsetForUtcDate(DateTime utcDateTime, out bool isDaylightSavingTime) 351private TimeSpan GetOffsetForUtcDate(DateTime utcDateTime, out bool isDaylightSavingTime, out bool isAmbiguous) 353TimeSpan offset = GetOffsetForUtcDate(utcDateTime, out isDaylightSavingTime); 383private bool TryGetUtcOffset(DateTime localDateTime, out TimeSpan offset) 407TimeSpan nextOffset = _baseUtcOffset + transition.Offset; 564TimeSpan timeOfDay = transitionTime.TimeOfDay.TimeOfDay; 762new TimeTransition(transitionStart, SafeCreateDateTimeFromTicks(rule.DateStart.Ticks - 1), TimeSpan.Zero, false)); 890new TimeTransition(allTransitions[transitionCount - 1].DateEnd.AddTicks(1), endOfNextYear, TimeSpan.Zero, false)); 1016new TimeTransition(previousYearStart, startOfCurrentYearUtc.AddTicks(-1), TimeSpan.Zero, false)); 1120new TimeTransition(endOfCurrentYearUtc.AddTicks(1), endOfCurrentYear, TimeSpan.Zero, false)); 1213new TimeTransition(currentYearStart, startOfCurrentYearUtc.AddTicks(-1), TimeSpan.Zero, false)); 1321new TimeTransition(endOfCurrentYearUtc.AddTicks(1), endOfCurrentYear, TimeSpan.Zero, false)); 1391private static TimeSpan GetRuleFullUtcOffset(AdjustmentRule rule) => 1392rule.BaseUtcOffsetDelta + (rule.HasDaylightSaving ? rule.DaylightDelta : TimeSpan.Zero); 1408TimeSpan Offset, // Usually rule.BaseUtcOffsetDelta + rule.DaylightDelta
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (45)
50private readonly TimeSpan _baseUtcOffset; 211public TimeSpan BaseUtcOffset => _baseUtcOffset; 219public unsafe TimeSpan[] GetAmbiguousTimeOffsets(DateTimeOffset dateTimeOffset) 221Span<TimeSpan> offsets = stackalloc TimeSpan[2]; 235public unsafe TimeSpan[] GetAmbiguousTimeOffsets(DateTime dateTime) 258Span<TimeSpan> offsets = stackalloc TimeSpan[2]; 270public TimeSpan GetUtcOffset(DateTimeOffset dateTimeOffset) => 276public TimeSpan GetUtcOffset(DateTime dateTime) => 280internal static TimeSpan GetLocalUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags) 289internal TimeSpan GetUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags) => 292private TimeSpan GetUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags, CachedData cachedData) 336return TryGetUtcOffset(dateTime, out TimeSpan offset) ? offset : _baseUtcOffset; 601TimeSpan destinationOffset = destinationTimeZone.GetOffsetForUtcDate(utcDateTime, out _); 681TimeSpan destOffset = destinationTimeZone.GetOffsetForUtcDate(utcForLookup, out bool isDaylightSaving); 880TimeSpan baseUtcOffset, 906TimeSpan baseUtcOffset, 930TimeSpan baseUtcOffset, 951TimeSpan baseUtcOffset, 1043_baseUtcOffset = (TimeSpan)info.GetValue("BaseUtcOffset", typeof(TimeSpan))!; // Do not rename (binary serialization) 1102private DateTime ConvertToUtc(DateTime dateTime, TimeSpan daylightDelta, TimeSpan baseUtcOffsetDelta) => 1108private DateTime ConvertFromUtc(DateTime dateTime, TimeSpan daylightDelta, TimeSpan baseUtcOffsetDelta) => 1114private DateTime ConvertToFromUtc(DateTime dateTime, TimeSpan daylightDelta, TimeSpan baseUtcOffsetDelta, bool convertToUtc) 1116TimeSpan offset = BaseUtcOffset + daylightDelta + baseUtcOffsetDelta; 1134private static TimeSpan GetUtcOffsetFromUtc(DateTime time, TimeZoneInfo zone) => 1141private static TimeSpan GetUtcOffsetFromUtc(DateTime time, TimeZoneInfo zone, out bool isDaylightSavings) => 1148internal static TimeSpan GetUtcOffsetFromUtc(DateTime time, TimeZoneInfo zone, out bool isDaylightSavings, out bool isAmbiguousLocalDst) 1314private static void ValidateTimeZoneInfo(string id, TimeSpan baseUtcOffset, AdjustmentRule[]? adjustmentRules, out bool adjustmentRulesSupportDst) 1323if (baseUtcOffset.Ticks % TimeSpan.TicksPerMinute != 0) 1364private static TimeSpan MaxOffset => TimeSpan.FromHours(14); 1365private static TimeSpan MinOffset => TimeSpan.FromHours(-14); 1370internal static bool UtcOffsetOutOfRange(TimeSpan offset) => 1373private static TimeSpan GetUtcOffset(TimeSpan baseUtcOffset, AdjustmentRule adjustmentRule) 1377+ (adjustmentRule.HasDaylightSaving ? adjustmentRule.DaylightDelta : TimeSpan.Zero); 1383private static bool IsValidAdjustmentRuleOffset(TimeSpan baseUtcOffset, AdjustmentRule adjustmentRule) 1385TimeSpan utcOffset = GetUtcOffset(baseUtcOffset, adjustmentRule); 1394return CreateCustomTimeZone(UtcId, TimeSpan.Zero, displayName, standardDisplayName);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.FullGlobalizationData.Unix.cs (3)
156private static unsafe 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\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.StringSerializer.cs (8)
101if (rule.BaseUtcOffsetDelta != TimeSpan.Zero || rule.NoDaylightTransitions) 111serializedText.AppendSpanFormattable(rule.BaseUtcOffsetDelta.Ticks / TimeSpan.TicksPerMinute, format: default, CultureInfo.InvariantCulture); 151TimeSpan baseUtcOffset = s.GetNextTimeSpanValue(); 256internalRule.BaseUtcOffsetDelta.Ticks % TimeSpan.TicksPerMinute != 0 || 549private TimeSpan GetNextTimeSpanValue() 780TimeSpan daylightDelta = GetNextTimeSpanValue(); 783TimeSpan baseUtcOffsetDelta = TimeSpan.Zero;
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.TransitionTime.cs (2)
102if (timeOfDay.Ticks >= TimeSpan.TicksPerDay || (ulong)timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (47)
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}"); 500private static void TZif_GenerateAdjustmentRules(out AdjustmentRule[]? rules, TimeSpan baseUtcOffset, DateTime[] dts, byte[] typeOfLocalTime, 523private static void TZif_GenerateAdjustmentRule(ref int index, TimeSpan timeZoneBaseUtcOffset, List<AdjustmentRule> rulesList, DateTime[] dts, 553TimeSpan transitionOffset = TZif_CalculateTransitionOffsetFromBase(transitionType.UtcOffset, timeZoneBaseUtcOffset); 554TimeSpan daylightDelta = transitionType.IsDst ? transitionOffset : TimeSpan.Zero; 555TimeSpan baseUtcDelta = transitionType.IsDst ? TimeSpan.Zero : transitionOffset; 580TimeSpan transitionOffset = TZif_CalculateTransitionOffsetFromBase(startTransitionType.UtcOffset, timeZoneBaseUtcOffset); 581TimeSpan daylightDelta = startTransitionType.IsDst ? transitionOffset : TimeSpan.Zero; 582TimeSpan baseUtcDelta = startTransitionType.IsDst ? TimeSpan.Zero : transitionOffset; 632TimeSpan transitionOffset = TZif_CalculateTransitionOffsetFromBase(transitionType.UtcOffset, timeZoneBaseUtcOffset); 633TimeSpan daylightDelta = transitionType.IsDst ? transitionOffset : TimeSpan.Zero; 634TimeSpan baseUtcDelta = transitionType.IsDst ? TimeSpan.Zero : transitionOffset; 657private static TimeSpan TZif_CalculateTransitionOffsetFromBase(TimeSpan transitionOffset, TimeSpan timeZoneBaseUtcOffset) 659TimeSpan result = transitionOffset - timeZoneBaseUtcOffset; 663if (result.Ticks % TimeSpan.TicksPerMinute != 0) 706private static AdjustmentRule? TZif_CreateAdjustmentRuleForPosixFormat(string posixFormat, DateTime startTransitionDate, TimeSpan timeZoneBaseUtcOffset) 720TimeSpan? parsedBaseOffset = TZif_ParseOffsetString(standardOffset); 723TimeSpan baseOffset = parsedBaseOffset.GetValueOrDefault().Negate(); // offsets are backwards in POSIX notation 729TimeSpan? parsedDaylightSavings = TZif_ParseOffsetString(daylightSavingsOffset); 730TimeSpan daylightSavingsTimeSpan; 766TimeSpan.Zero, 778private static TimeSpan? TZif_ParseOffsetString(ReadOnlySpan<char> offset) 780TimeSpan? result = null; 800TimeSpan parsedTimeSpan; 801if (TimeSpan.TryParseExact(offset, "g", CultureInfo.InvariantCulture, out parsedTimeSpan)) 819TimeSpan? timeOffset = TZif_ParseOffsetString(time); 827if (timeOffset.GetValueOrDefault() < TimeSpan.Zero) 1252private static void NormalizeAdjustmentRuleOffset(TimeSpan baseUtcOffset, [NotNull] ref AdjustmentRule adjustmentRule) 1272TimeSpan utcOffset = GetUtcOffset(baseUtcOffset, adjustmentRule); 1275TimeSpan adjustment = TimeSpan.Zero; 1286if (adjustment != TimeSpan.Zero) 1303public readonly TimeSpan UtcOffset;
System\GC.NativeAot.cs (1)
876public static TimeSpan GetTotalPauseDuration()
System.Private.DataContractSerialization (80)
_generated\0\RegexGenerator.g.cs (2)
413internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
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)
1017internal TimeSpanDataContract(XmlDictionaryString name, XmlDictionaryString ns) : base(typeof(TimeSpan), name, ns) 1028writer.WriteTimeSpan((TimeSpan)obj); 1043writer.WriteTimeSpan((TimeSpan)obj!, name, ns);
System\Runtime\Serialization\XmlReaderDelegator.cs (3)
323return new DataNode<TimeSpan>(ReadContentAsTimeSpan()); 742internal TimeSpan ReadElementContentAsTimeSpan() 751internal TimeSpan ReadContentAsTimeSpan()
System\Runtime\Serialization\XmlWriterDelegator.cs (4)
343WriteTimeSpan((TimeSpan)value); 426WriteTimeSpan(((DataNode<TimeSpan>)dataNode).GetValue()); 650internal void WriteTimeSpan(TimeSpan value) 655internal 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 (30)
System\IO\BinaryReaderExtensions.cs (6)
66if (typeof(T) == typeof(decimal) || typeof(T) == typeof(DateTime) || typeof(T) == typeof(TimeSpan)) 176else if (typeof(T) == typeof(TimeSpan)) 198/// <see langword="decimal"/>, <see cref="DateTime"/>, and <see cref="TimeSpan"/>. 211|| typeof(T) == typeof(TimeSpan)) 338else if (typeof(T) == typeof(TimeSpan)) 340writer.Write(((TimeSpan)(object)values[i]).Ticks);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (9)
95/// Writes a <see cref="TimeSpan"/> in binary format. 97public static void WriteTimeSpan(Stream stream, TimeSpan value) 101new ClassInfo(1, typeof(TimeSpan).FullName!, s_ticksName), 325WriteTimeSpan(stream, (TimeSpan)primitive); 450case List<TimeSpan> typedList: 548PrimitiveType.TimeSpan => new ArraySinglePrimitive<TimeSpan>( 5491, new ListConverter<object, TimeSpan>(array, o => (TimeSpan)o!)), 698case TimeSpan 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)
53{ TypeName.Parse(Types.TimeSpanType), typeof(TimeSpan) }, 72{ Types.ToTypeName($"{Types.ListName}[[{Types.TimeSpanType}]]"), typeof(List<TimeSpan>) }, 88{ Types.ToTypeName($"{Types.TimeSpanType}[]"), typeof(TimeSpan[]) }, 121|| type == typeof(TimeSpan) 139|| type == typeof(List<TimeSpan>) 155|| type == typeof(TimeSpan[])
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (2)
334SZArrayRecord<TimeSpan> ar => ar.GetArray().CreateTrimmedList(size), 421SZArrayRecord<TimeSpan> ar => ar.GetArray(),
System\Value.cs (3)
486TimeSpan offset = value.Offset; 732DateTimeOffset dto = new(_union.Ticks, TimeSpan.Zero); 894DateTimeOffset? 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.Xml (110)
_generated\0\RegexGenerator.g.cs (2)
2545internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
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 (9)
124private static readonly long s_maxDateTimeTicksForEndOfDay = DateTime.MaxValue.Ticks - TimeSpan.TicksPerDay; 214TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(dateTime); 246TimeSpan zoneOffset = dateTimeOffset.Offset; 423TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day); 483TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day); 505TimeSpan offset = TimeZoneInfo.Local.GetUtcOffset(dt); 506if (dt == DateTime.MinValue && offset >= TimeSpan.Zero) 510else if (dt == DateTime.MaxValue && offset <= TimeSpan.Zero) 608int 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)
237TimeSpan timeSpan = (TimeSpan)o; 767o = default(TimeSpan);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (2)
934else if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan) && Reader.IsEmptyElement) 937value = default(TimeSpan);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (3)
269if (elementType == typeof(TimeSpan)) 270return TryWritePrimitiveItems<TimeSpan>(o, element, mapping, static value => XmlConvert.ToString(value)); 1415"TimeSpan" => XmlConvert.ToString((TimeSpan)o),
System\Xml\Serialization\Types.cs (2)
533AddNonXsdPrimitive(typeof(TimeSpan), "TimeSpan", UrtTypes.Namespace, "TimeSpan", new XmlQualifiedName("duration", XmlSchema.Namespace), Array.Empty<XmlSchemaFacet>(), TypeFlags.CanBeAttributeValue | TypeFlags.CanBeElementValue | TypeFlags.XmlEncodingNotRequired); 591else if (type == typeof(TimeSpan))
System\Xml\Serialization\XmlSerializationReader.cs (3)
781value = default(Nullable<TimeSpan>); 4804if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan) || element.Mapping.TypeDesc!.Type == typeof(DateTimeOffset) 4811if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan))
System\Xml\Serialization\XmlSerializationReaderILGen.cs (1)
3261if ((element.Mapping.TypeDesc!.Type == typeof(TimeSpan)) || element.Mapping.TypeDesc!.Type == typeof(DateTimeOffset)
System\Xml\Serialization\XmlSerializationWriter.cs (5)
260else if (type == typeof(TimeSpan)) 394else if (t == typeof(TimeSpan)) 396tryFormatResult = XmlConvert.TryFormat((TimeSpan)o, _primitivesBuffer, out charsWritten); 4425else if (type == typeof(TimeSpan)) 4430Writer.Write(((TimeSpan)value).Ticks.ToString(CultureInfo.InvariantCulture));
System\Xml\Serialization\XmlSerializer.cs (2)
935else if (_primitiveType == typeof(TimeSpan)) 1025else 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\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
456else if (type == typeof(TimeSpan)) 569writer.Write(((TimeSpan)value!).Ticks);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (1)
594else 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\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
456else if (type == typeof(TimeSpan)) 569writer.Write(((TimeSpan)value!).Ticks);
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
868[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.InteropServices.JavaScript (2)
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.DateTime.cs (2)
110slot.DoubleValue = new DateTimeOffset(value.Ticks, TimeSpan.Zero).ToUnixTimeMilliseconds(); 144slot.DoubleValue = new DateTimeOffset(value.Value.Ticks, TimeSpan.Zero).ToUnixTimeMilliseconds();
System.Runtime.Serialization.Formatters (1)
System\Runtime\Serialization\Formatter.cs (1)
175protected abstract void WriteTimeSpan(TimeSpan val, string name);
System.Security.Cryptography (13)
src\runtime\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)
120if (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.Windows.BuildChain.cs (1)
28TimeSpan timeout,
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 (196)
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.NetNamedPipe (41)
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.NetTcp (50)
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.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) 1095private Action<TimeSpan> _operationWithTimeout; 1097public 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)
185internal TimeSpan? InternalTimeToLive { get; private set; } 187public TimeSpan? TimeToLive 258private static TimeSpan? TryReadTimeToLiveFromExtension(SyndicationElementExtensionCollection elementExtensions) 273return TimeSpan.FromMinutes(timeToLive);
System.ServiceModel.UnixDomainSocket (54)
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.ServiceProcess.ServiceController (4)
System\ServiceProcess\ServiceBase.cs (2)
83public void RequestAdditionalTime(TimeSpan time) => RequestAdditionalTime(ToIntMilliseconds(time)); 85private static int ToIntMilliseconds(TimeSpan time)
System\ServiceProcess\ServiceController.cs (2)
972WaitForStatus(desiredStatus, TimeSpan.MaxValue); 980public void WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout)
System.Speech (130)
Internal\SapiInterop\SapiRecoInterop.cs (4)
438wordUnits[i] = new RecognizedWordUnit(null, 1.0f, null, words[i], DisplayAttributes.OneTrailingSpace, TimeSpan.Zero, TimeSpan.Zero); 469ulAudioTimeOffset = unchecked((uint)(word._audioPosition.Ticks * 10000 / TimeSpan.TicksPerMillisecond)), 470ulAudioSizeTime = unchecked((uint)(word._audioDuration.Ticks * 10000 / TimeSpan.TicksPerMillisecond))
Internal\SapiInterop\SpeechEvent.cs (5)
38_audioPosition = TimeSpan.Zero; 42_audioPosition = audioFormat.AverageBytesPerSecond > 0 ? new TimeSpan((long)((sapiEvent.ullAudioStreamOffset * TimeSpan.TicksPerSecond) / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero; 144internal TimeSpan AudioPosition 158private TimeSpan _audioPosition;
Internal\Synthesis\AudioBase.cs (1)
287internal abstract TimeSpan Duration { get; }
Internal\Synthesis\AudioDeviceOut.cs (2)
331internal override TimeSpan Duration 339return new TimeSpan((_bytesWritten * TimeSpan.TicksPerSecond) / _nAvgBytesPerSec);
Internal\Synthesis\AudioFileOut.cs (2)
202internal override TimeSpan Duration 210return new TimeSpan((_bytesWritten * TimeSpan.TicksPerSecond) / _wfxIn.nAvgBytesPerSec);
Internal\Synthesis\EngineSite.cs (2)
289TimeSpan.FromMilliseconds(sapiEvent.Param1 >> 16), 481TimeSpan.FromTicks(totalDurationTicks),
Internal\Synthesis\TTSEvent.cs (7)
22internal TTSEvent(TtsEventId id, Prompt prompt, Exception? exception, VoiceInfo? voice, TimeSpan audioPosition, long streamPosition, string? bookmark, uint wParam, IntPtr lParam) 32TimeSpan duration, SynthesizerEmphasis emphasis, 33Prompt prompt, TimeSpan audioPosition) 80internal TimeSpan AudioPosition 140internal TimeSpan PhonemeDuration 155private TimeSpan _audioPosition; 166private TimeSpan _phonemeDuration;
Internal\Synthesis\VoiceSynthesis.cs (1)
1572TimeSpan.FromMilliseconds(ttsEvent.WParam >> 16), // duration
Recognition\AudioSignalProblemOccurredEventArgs.cs (6)
12internal AudioSignalProblemOccurredEventArgs(AudioSignalProblem audioSignalProblem, int audioLevel, TimeSpan audioPosition, TimeSpan recognizerPosition) 31public TimeSpan AudioPosition 35public TimeSpan RecognizerAudioPosition 45private TimeSpan _recognizerPosition; 46private TimeSpan _audioPosition;
Recognition\RecognizeCompletedEventArgs.cs (3)
13bool inputStreamEnded, TimeSpan audioPosition, 43public TimeSpan AudioPosition 56private TimeSpan _audioPosition;
Recognition\RecognizerBase.cs (36)
423internal void RequestRecognizerUpdate(object userToken, TimeSpan audioPositionAheadToRaiseUpdate) 425if (audioPositionAheadToRaiseUpdate < TimeSpan.Zero) 519InitialSilenceTimeout = TimeSpan.FromSeconds(30); 579internal RecognitionResult? Recognize(TimeSpan initialSilenceTimeout) 594TimeSpan oldInitialSilenceTimeout = _initialSilenceTimeout; 601TimeSpan eventTimeout = TimeSpan.FromTicks(Math.Max(initialSilenceTimeout.Ticks, _defaultTimeout.Ticks)); 940internal TimeSpan InitialSilenceTimeout 946if (value < TimeSpan.Zero) 962internal TimeSpan BabbleTimeout 968if (value < TimeSpan.Zero) 1119internal TimeSpan AudioPosition 1126return TimeSpan.Zero; 1139return audioFormat.AverageBytesPerSecond > 0 ? new TimeSpan((long)((recoStatus.AudioStatus.CurDevicePos * TimeSpan.TicksPerSecond) / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero; 1149internal TimeSpan RecognizerAudioPosition 1156return TimeSpan.Zero; 2069RecognizeCompletedEventArgs eventArgs = new(null, false, false, false, TimeSpan.Zero, exception, cancelled, null); 2165TimeSpan initialSilenceTimeout = InitialSilenceTimeout; // This gets the value in a thread-safe manner. 2168if (_recognizeMode == RecognizeMode.Single && initialSilenceTimeout != TimeSpan.Zero) 2200TimeSpan babbleTimeout = BabbleTimeout; // This gets the value in a thread-safe manner. 2203if (_recognizeMode == RecognizeMode.Single && babbleTimeout != TimeSpan.Zero) 2613private ulong TimeSpanToStreamPosition(TimeSpan time) 2615return (ulong)(time.Ticks * AudioFormat!.AverageBytesPerSecond) / TimeSpan.TicksPerSecond; 2803TimeSpan recognizerPosition = TimeSpan.Zero; 2804TimeSpan audioPosition = TimeSpan.Zero; 2815audioPosition = audioFormat.AverageBytesPerSecond > 0 ? new TimeSpan((long)((recoStatus.AudioStatus.CurDevicePos * TimeSpan.TicksPerSecond) / (ulong)audioFormat.AverageBytesPerSecond)) : TimeSpan.Zero; 2852private void FireSpeechDetectedEvent(TimeSpan audioPosition) 2901private void FireRecognizeCompletedEvent(RecognitionResult? result, bool initialSilenceTimeoutReached, bool babbleTimeoutReached, bool isStreamReleased, TimeSpan audioPosition, Exception? exception, bool isRecognizeCancelled) 3008private TimeSpan _initialSilenceTimeout; 3009private TimeSpan _babbleTimeout; 3045private TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30);
Recognition\SpeechDetectedEventArgs.cs (3)
12internal SpeechDetectedEventArgs(TimeSpan audioPosition) 20public TimeSpan AudioPosition 29private TimeSpan _audioPosition;
Recognition\SpeechRecognitionEngine.cs (10)
140public TimeSpan InitialSilenceTimeout 146public TimeSpan BabbleTimeout 152public TimeSpan EndSilenceTimeout 154get { return TimeSpan.FromMilliseconds(RecoBase.QueryRecognizerSettingAsInt(SapiConstants.SPPROP_RESPONSE_SPEED)); } 165public TimeSpan EndSilenceTimeoutAmbiguous 167get { return TimeSpan.FromMilliseconds(RecoBase.QueryRecognizerSettingAsInt(SapiConstants.SPPROP_COMPLEX_RESPONSE_SPEED)); } 203public TimeSpan RecognizerAudioPosition 209public TimeSpan AudioPosition 264public RecognitionResult? Recognize(TimeSpan initialSilenceTimeout) 386public void RequestRecognizerUpdate(object userToken, TimeSpan audioPositionAheadToRaiseUpdate)
Recognition\SpeechRecognizer.cs (4)
91public TimeSpan AudioPosition 97public TimeSpan RecognizerAudioPosition 206public void RequestRecognizerUpdate(object userToken, TimeSpan audioPositionAheadToRaiseUpdate) 419if (AudioPosition != TimeSpan.Zero)
Recognition\UpdateEventArgs.cs (3)
12internal RecognizerUpdateReachedEventArgs(object? userToken, TimeSpan audioPosition) 27public TimeSpan AudioPosition 37private TimeSpan _audioPosition;
Result\RecognitionResult.cs (6)
257internal TimeSpan AudioPosition 262return (TimeSpan)_audioPosition; 266internal TimeSpan AudioDuration 271return (TimeSpan)_audioDuration; 552private TimeSpan? _audioPosition; 553private TimeSpan? _audioDuration;
Result\RecognizedAudio.cs (10)
13internal RecognizedAudio(byte[] rawAudioData, SpeechAudioFormatInfo audioFormat, DateTime startTime, TimeSpan audioPosition, TimeSpan audioDuration) 34public TimeSpan AudioPosition 40public TimeSpan Duration 73public RecognizedAudio GetRange(TimeSpan audioPosition, TimeSpan duration) 94int startPosition = (int)((_audioFormat.BitsPerSample * _audioFormat.SamplesPerSecond * audioPosition.Ticks) / (TimeSpan.TicksPerSecond * 8)); 95int length = (int)((_audioFormat.BitsPerSample * _audioFormat.SamplesPerSecond * duration.Ticks) / (TimeSpan.TicksPerSecond * 8)); 149private TimeSpan _audioPosition; 150private TimeSpan _audioDuration;
Result\RecognizedPhrase.cs (2)
204wordList.Add(new RecognizedWordUnit(displayForm, element.SREngineConfidence, pronunciation, lexicalForm!, displayAttributes, new TimeSpan(element.ulAudioTimeOffset * TimeSpan.TicksPerMillisecond / 10000), new TimeSpan(element.ulAudioSizeTime * TimeSpan.TicksPerMillisecond / 10000)));
Result\RecognizedWordUnit.cs (4)
20public RecognizedWordUnit(string? text, float confidence, string? pronunciation, string lexicalForm, DisplayAttributes displayAttributes, TimeSpan audioPosition, TimeSpan audioDuration) 89internal TimeSpan _audioPosition; 90internal TimeSpan _audioDuration;
Synthesis\BookmarkEventArgs.cs (3)
9internal BookmarkReachedEventArgs(Prompt prompt, string? bookmark, TimeSpan audioPosition) 26public TimeSpan AudioPosition 41private TimeSpan _audioPosition;
Synthesis\PhonemeEventArgs.cs (6)
9internal PhonemeReachedEventArgs(Prompt prompt, string? currentPhoneme, TimeSpan audioPosition, TimeSpan duration, SynthesizerEmphasis emphasis, string? nextPhoneme) : base(prompt) 25public TimeSpan AudioPosition 29public TimeSpan Duration 50private TimeSpan _audioPosition; 53private TimeSpan _duration;
Synthesis\PromptBuilder.cs (1)
639public void AppendBreak(TimeSpan duration)
Synthesis\SpeakProgressEventArgs.cs (3)
9internal SpeakProgressEventArgs(Prompt prompt, TimeSpan audioPosition, int iWordPos, int cWordLen) : base(prompt) 18public TimeSpan AudioPosition 59private TimeSpan _audioPosition;
Synthesis\VisemeEventArgs.cs (6)
9internal VisemeReachedEventArgs(Prompt speakPrompt, int currentViseme, TimeSpan audioPosition, TimeSpan duration, SynthesizerEmphasis emphasis, int nextViseme) : base(speakPrompt) 25public TimeSpan AudioPosition 29public TimeSpan Duration 50private TimeSpan _audioPosition; 53private TimeSpan _duration;
System.Text.Json (22)
_generated\0\RegexGenerator.g.cs (1)
52base.internalMatchTimeout = TimeSpan.FromMilliseconds(200);
System\Text\Json\JsonHelpers.Date.cs (4)
426long offsetTicks = (((long)parseData.OffsetHours) * 3600 + ((long)parseData.OffsetMinutes) * 60) * TimeSpan.TicksPerSecond; 560long ticks = totalDays * TimeSpan.TicksPerDay; 562ticks += totalSeconds * TimeSpan.TicksPerSecond; 568ticks += TimeSpan.TicksPerDay;
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 unsafe TimeSpan ReadCore(ref Utf8JsonReader reader) 62bool result = Utf8Parser.TryParse(source, out TimeSpan tmpValue, out int bytesConsumed, 'c'); 77public override unsafe void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options) 87internal override unsafe void WriteAsPropertyNameCore(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (2)
228/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="TimeSpan"/> values. 231public static JsonConverter<TimeSpan> TimeSpanConverter => field ??= new TimeSpanConverter();
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.Cache.cs (4)
18private readonly TimeSpan _evictionInterval; // min duration needed to trigger a new evict operation. 19private readonly TimeSpan _slidingExpiration; // max duration allowed for cache entries to remain inactive. 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)
136public INamedTypeSymbol? TimeSpanType => GetOrResolveType(typeof(TimeSpan), ref _TimeSpanType);
System.Text.RegularExpressions (69)
System\Text\RegularExpressions\Regex.Cache.cs (3)
152public static Regex GetOrAdd(string pattern, RegexOptions options, TimeSpan matchTimeout) 302private readonly TimeSpan _matchTimeout; 304public 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)
124public Regex([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) : 147internal Regex(string pattern, RegexOptions options, TimeSpan matchTimeout, CultureInfo? culture) 179private RegexTree Init(string pattern, RegexOptions options, TimeSpan matchTimeout, [NotNull] ref CultureInfo? culture) 223protected 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 (16)
132/// The <see cref="IsMatch(string, string, RegexOptions, TimeSpan)"/> method is typically used to validate 135/// <see cref="Match(string, string, RegexOptions, TimeSpan)"/> or 136/// <see cref="Matches(string, string, RegexOptions, TimeSpan)"/> method instead. 139/// The static <see cref="IsMatch(string, string, RegexOptions, TimeSpan)"/> method is equivalent to 153public static bool IsMatch(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 176public static bool IsMatch(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 199/// <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor. If you do not set a time-out interval 365/// The static <see cref="Match(string, string, RegexOptions, TimeSpan)"/> method is equivalent to 367/// <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor and calling the instance 385public static Match Match(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 415/// <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor. If you do not set a time-out interval 679/// The <see cref="Matches(string, string, RegexOptions, TimeSpan)"/> method is similar to the 680/// <see cref="Match(string, string, RegexOptions, TimeSpan)"/> method, except that it returns information 688/// The <see cref="Matches(string, string, RegexOptions, TimeSpan)"/> method uses lazy evaluation to 696/// <see cref="Matches(string, string, RegexOptions, TimeSpan)"/> method does not throw a 702public static MatchCollection Matches(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.Replace.cs (3)
151/// The static <see cref="Replace(string, string, string, RegexOptions, TimeSpan)"/> methods are equivalent 180public static string Replace(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, string replacement, RegexOptions options, TimeSpan matchTimeout) => 465public static string Replace(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, MatchEvaluator evaluator, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.Split.cs (2)
119/// The static <see cref="Split(string, string, RegexOptions, TimeSpan)"/> methods are 147public static string[] Split(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.Timeout.cs (9)
36/// The <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor and a number of static matching 50public static readonly TimeSpan InfiniteMatchTimeout = Timeout.InfiniteTimeSpan; 60internal static readonly TimeSpan s_defaultMatchTimeout = InitDefaultMatchTimeout(); 66protected internal TimeSpan internalMatchTimeout; 87/// object by calling the <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor; and you can 89/// the <see cref="AppDomain.SetData(string, object?)"/> method and providing a <see cref="TimeSpan"/> 97public TimeSpan MatchTimeout => internalMatchTimeout; 105private static TimeSpan InitDefaultMatchTimeout() 109if (defaultTimeout is not TimeSpan defaultMatchTimeOut)
System\Text\RegularExpressions\RegexAssemblyCompiler.cs (5)
45internal void GenerateRegexType(string pattern, RegexOptions options, string name, bool isPublic, RegexTree tree, TimeSpan matchTimeout) 85_ilg = regexTypeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new Type[] { typeof(TimeSpan) }).GetILGenerator(); 104TimeSpan matchTimeout) 134Call(typeof(TimeSpan).GetMethod(nameof(TimeSpan.FromTicks), BindingFlags.Public | BindingFlags.Static)!);
System\Text\RegularExpressions\RegexCompilationInfo.cs (3)
18private TimeSpan _matchTimeout; 61public RegexCompilationInfo(string pattern, RegexOptions options, string name, string fullnamespace, bool ispublic, TimeSpan matchTimeout) 82public TimeSpan MatchTimeout
System\Text\RegularExpressions\RegexMatchTimeoutException.cs (6)
69public RegexMatchTimeoutException(string regexInput, string regexPattern, TimeSpan matchTimeout) 161/// <see cref="RegexMatchTimeoutException(string, string, TimeSpan)"/> constructor. If this 182/// <see cref="RegexMatchTimeoutException(string, string, TimeSpan)"/> constructor. If the 193/// <see cref="RegexMatchTimeoutException(string, string, TimeSpan)"/> constructor. If the 203public TimeSpan MatchTimeout { get; } = TimeSpan.FromTicks(-1);
System\Text\RegularExpressions\RegexRunner.cs (4)
173protected internal Match? Scan(Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick, TimeSpan timeout) 341internal void InitializeTimeout(TimeSpan timeout) 349void ConfigureTimeout(TimeSpan timeout) 367void 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)
526/// <see cref="System.TimeSpan"/> to measure the time interval. 528/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of 529/// milliseconds to wait, or a <see cref="System.TimeSpan"/> that represents -1 milliseconds to 546public bool SignalAndWait(TimeSpan timeout) 554/// <see cref="System.TimeSpan"/> to measure the time interval, while observing a <see 557/// <param name="timeout">A <see cref="System.TimeSpan"/> that represents the number of 558/// milliseconds to wait, or a <see cref="System.TimeSpan"/> that represents -1 milliseconds to 578public 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 (66)
System\Threading\RateLimiting\ChainedRateLimiter.cs (1)
28public override TimeSpan? IdleDuration
System\Threading\RateLimiting\ChainedRateLimiterShared.cs (3)
47internal static TimeSpan? GetIdleDurationCore(RateLimiter[] limiters) 49TimeSpan? lowestIdleDuration = null; 53TimeSpan? idleDuration = limiter.IdleDuration;
System\Threading\RateLimiting\ChainedReplenishingRateLimiter.cs (9)
18private readonly TimeSpan _replenishmentPeriod; 27TimeSpan lowestPeriod = TimeSpan.MaxValue; 40TimeSpan period = replenishing.ReplenishmentPeriod; 41if (period > TimeSpan.Zero && period < lowestPeriod) 50_replenishmentPeriod = lowestPeriod == TimeSpan.MaxValue ? TimeSpan.Zero : lowestPeriod; 55public override TimeSpan ReplenishmentPeriod => _replenishmentPeriod; 93public override TimeSpan? IdleDuration
System\Threading\RateLimiting\ConcurrencyLimiter.cs (1)
35public override TimeSpan? IdleDuration => RateLimiterHelper.GetElapsedTime(_idleSince);
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (7)
16private static readonly TimeSpan s_idleTimeLimit = TimeSpan.FromSeconds(10); 37: this(partitioner, equalityComparer, TimeSpan.FromMilliseconds(100)) 43IEqualityComparer<TKey>? equalityComparer, TimeSpan timerInterval) 251if (GetIdleDuration(limiterEntry) is TimeSpan idleDuration && idleDuration > s_idleTimeLimit) 256idleDuration = GetIdleDuration(limiterEntry) ?? TimeSpan.Zero; 305private static TimeSpan? GetIdleDuration(LimiterEntry limiterEntry)
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (9)
30private readonly Func<long?, TimeSpan?> _getElapsedTime = RateLimiterHelper.GetElapsedTime; 42public override TimeSpan? IdleDuration => RateLimiterHelper.GetElapsedTime(_idleSince); 48public override TimeSpan ReplenishmentPeriod => _options.Window; 65if (options.Window <= TimeSpan.Zero) 221TimeSpan? remainingTime = _options.Window - _getElapsedTime(lastReplenishmentTick); 224if (remainingTime < TimeSpan.Zero) 226remainingTime = TimeSpan.Zero; 437private readonly TimeSpan? _retryAfter; 439public 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)
70public abstract TimeSpan? IdleDuration { get; }
System\Threading\RateLimiting\RateLimiterHelper.cs (3)
10public static TimeSpan? GetElapsedTime(long? startTimestamp) 20public static TimeSpan GetElapsedTime(long startTimestamp) 25public static TimeSpan GetElapsedTime(long startTimestamp, long endTimestamp)
System\Threading\RateLimiting\ReplenishingRateLimiter.cs (1)
15public abstract TimeSpan ReplenishmentPeriod { get; }
System\Threading\RateLimiting\SlidingWindowRateLimiter.cs (9)
32private readonly Func<long?, TimeSpan?> _getElapsedTime = RateLimiterHelper.GetElapsedTime; 36private readonly TimeSpan _replenishmentPeriod; 46public override TimeSpan? IdleDuration => RateLimiterHelper.GetElapsedTime(_idleSince); 52public override TimeSpan ReplenishmentPeriod => _replenishmentPeriod; 73if (options.Window <= TimeSpan.Zero) 271TimeSpan? elapsedInCurrentPeriod = _getElapsedTime(_lastReplenishmentTick); 281return new SlidingWindowLease(false, TimeSpan.FromTicks(remainingTicks)); 499private readonly TimeSpan? _retryAfter; 501public 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\InternalTransaction.cs (1)
232internal InternalTransaction(TimeSpan timeout, CommittableTransaction committableTransaction)
System\Transactions\Oletx\DtcTransactionManager.cs (1)
111internal static uint AdjustTimeout(TimeSpan timeout)
System\Transactions\Oletx\OletxTransactionManager.cs (1)
15private readonly TimeSpan _timeoutProperty;
System\Transactions\TransactionManager.cs (13)
281private static long s_defaultTimeoutTicks = TimeSpan.FromMinutes(1).Ticks; 282public static TimeSpan DefaultTimeout 305TimeSpan validatedTimeout = ValidateTimeout(value); 325private static long s_maximumTimeoutTicks = TimeSpan.FromMinutes(10).Ticks; 326public static TimeSpan MaximumTimeout 346ArgumentOutOfRangeException.ThrowIfLessThan(value, TimeSpan.Zero); 353TimeSpan timeout = new TimeSpan(s_defaultTimeoutTicks); 354TimeSpan validatedTimeout = ValidateTimeout(timeout); 507internal static TimeSpan ValidateTimeout(TimeSpan transactionTimeout) 509ArgumentOutOfRangeException.ThrowIfLessThan(transactionTimeout, TimeSpan.Zero); 511if (MaximumTimeout != TimeSpan.Zero) 513if (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 (14)
_generated\2\RegexGenerator.g.cs (2)
145internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
System\Windows\Forms\Rendering\Animation\AnimationManager.AnimationRendererItem.cs (1)
25public TimeSpan? TargetTimestamp { get; set; }
System\Windows\Forms\Rendering\Animation\AnimationManager.cs (9)
31private TimeSpan _lastTickTimestamp; 168private static void ProcessRenderer(AnimationRendererItem item, TimeSpan timestamp) 175item.TargetTimestamp ??= timestamp + TimeSpan.FromMilliseconds(item.AnimationDuration); 176TimeSpan targetTimestamp = item.TargetTimestamp.Value; 177TimeSpan remaining = targetTimestamp - timestamp; 191item.TargetTimestamp = timestamp + TimeSpan.FromMilliseconds(item.AnimationDuration); 197item.TargetTimestamp = timestamp + TimeSpan.FromMilliseconds(item.AnimationDuration); 217private TimeSpan? GetTargetTimestamp(int animationDuration) 219? _lastTickTimestamp + TimeSpan.FromMilliseconds(animationDuration)
System\Windows\Forms\Rendering\Button\PopupButtonRenderOptions.cs (2)
47public TimeSpan AnimationDuration { get; set; } = TimeSpan.FromMilliseconds(160);
System.Windows.Forms.Design (2)
_generated\2\RegexGenerator.g.cs (2)
158internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
System.Windows.Forms.Primitives (11)
System\Windows\Forms\Animation\HighPrecisionTimer.cs (9)
574=> (stopwatchTicks / Stopwatch.Frequency * TimeSpan.TicksPerSecond) 575+ ((stopwatchTicks % Stopwatch.Frequency * TimeSpan.TicksPerSecond) 579=> (timeSpanTicks / TimeSpan.TicksPerSecond * Stopwatch.Frequency) 580+ ((timeSpanTicks % TimeSpan.TicksPerSecond * Stopwatch.Frequency) 581/ TimeSpan.TicksPerSecond); 583private static TimeSpan StopwatchTicksToTimeSpan(long stopwatchTicks) 584=> TimeSpan.FromTicks(StopwatchTicksToTimeSpanTicks(stopwatchTicks)); 598internal static void DispatchCallbacksForTesting(TimeSpan timestamp) 612internal static void TraceResidualSpinForTesting(TimeSpan duration)
System\Windows\Forms\Animation\HighPrecisionTimerTick.cs (2)
14public TimeSpan Timestamp { get; init; } 19public TimeSpan Elapsed { get; init; }
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\wpf\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);
Testing.Tests (6)
WaitFailures.cs (6)
16cts.CancelAfter(TimeSpan.FromMinutes(1)); 86cts.CancelAfter(TimeSpan.FromMilliseconds(100)); 101cts.CancelAfter(TimeSpan.FromMilliseconds(100)); 116cts.CancelAfter(TimeSpan.FromMilliseconds(100)); 135cts.CancelAfter(TimeSpan.FromMilliseconds(100)); 205cts.CancelAfter(TimeSpan.FromMilliseconds(100));
TestProject.IntegrationServiceA (2)
ResilienceUtils.cs (2)
20Delay = TimeSpan.FromSeconds(1), 24.AddTimeout(TimeSpan.FromSeconds(overallTimeoutSecs))
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
vbc (1)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
173await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false);
VBCSCompiler (24)
src\roslyn\src\Compilers\Server\VBCSCompiler\BuildServerController.cs (6)
48internal static TimeSpan GetDefaultKeepAlive(ICompilerServerLogger logger, NameValueCollection? appSettings = null) 70return TimeSpan.FromSeconds(keepAliveValue); 104TimeSpan? keepAlive = null, 145TimeSpan? keepAlive = null, 256options.KeepAlive = parsedTimeout == 0 ? Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(parsedTimeout); 369internal TimeSpan? KeepAlive { get; set; }
src\roslyn\src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (3)
182private static TimeSpan? CheckForNewKeepAlive(BuildRequest request) 184TimeSpan? timeout = null; 196timeout = TimeSpan.FromSeconds(result);
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCache.cs (2)
573return new DateTimeOffset(Directory.GetCreationTimeUtc(entryDir), TimeSpan.Zero); 601return new DateTimeOffset(Directory.GetCreationTimeUtc(entryDir), TimeSpan.Zero);
src\roslyn\src\Compilers\Server\VBCSCompiler\CompletionData.cs (2)
37internal TimeSpan? NewKeepAlive { get; } 40internal CompletionData(CompletionReason reason, TimeSpan? newKeepAlive = null, bool shutdownRequested = false)
src\roslyn\src\Compilers\Server\VBCSCompiler\DiagnosticListener.cs (2)
19void UpdateKeepAlive(TimeSpan keepAlive); 39public void UpdateKeepAlive(TimeSpan keepAlive)
src\roslyn\src\Compilers\Server\VBCSCompiler\NamedPipeClientConnectionHost.cs (1)
198var cancelTask = Task.Delay(TimeSpan.FromMilliseconds(-1), cancellationToken);
src\roslyn\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) 324private void ChangeKeepAlive(TimeSpan keepAlive)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (1)
173await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false);
vstest.console (11)
CommandLine\CommandLineOptions.cs (2)
45private readonly TimeSpan _defaultRetrievalTimeout = new(0, 0, 0, 1, 500); 146public TimeSpan TestStatsEventTimeout { get; set; }
Internal\ConsoleLogger.cs (4)
244private static void PrintTimeSpan(TimeSpan timeSpan) 640private static string? GetFormattedDurationString(TimeSpan duration) 723sourceSummary.Duration = !results.Any() ? TimeSpan.Zero : results.Max(r => r.EndTime) - results.Min(r => r.StartTime); 894if (e.ElapsedTimeInRunningTests.Equals(TimeSpan.Zero))
Internal\MSBuildLogger.cs (2)
376internal static string GetFormattedDurationString(TimeSpan duration) 511s_regex = new Regex(@$"^ {atString} (?<code>.+) {inPattern}$", RegexOptions.Compiled, matchTimeout: TimeSpan.FromSeconds(1));
Internal\SourceSummary.cs (1)
36public TimeSpan Duration { get; set; }
Processors\AeDebuggerArgumentProcessor.cs (1)
195return !process.WaitForExit(TimeSpan.FromSeconds(ProcDumpTimeoutSeconds).Seconds)
Processors\EnableBlameArgumentProcessor.cs (1)
241hangDumpParameters.Add("TestTimeout", TimeSpan.FromHours(1).TotalMilliseconds.ToString(CultureInfo.CurrentCulture));
vstest.console.arm64 (11)
src\vstest\src\vstest.console\CommandLine\CommandLineOptions.cs (2)
45private readonly TimeSpan _defaultRetrievalTimeout = new(0, 0, 0, 1, 500); 146public TimeSpan TestStatsEventTimeout { get; set; }
src\vstest\src\vstest.console\Internal\ConsoleLogger.cs (4)
244private static void PrintTimeSpan(TimeSpan timeSpan) 640private static string? GetFormattedDurationString(TimeSpan duration) 723sourceSummary.Duration = !results.Any() ? TimeSpan.Zero : results.Max(r => r.EndTime) - results.Min(r => r.StartTime); 894if (e.ElapsedTimeInRunningTests.Equals(TimeSpan.Zero))
src\vstest\src\vstest.console\Internal\MSBuildLogger.cs (2)
376internal static string GetFormattedDurationString(TimeSpan duration) 511s_regex = new Regex(@$"^ {atString} (?<code>.+) {inPattern}$", RegexOptions.Compiled, matchTimeout: TimeSpan.FromSeconds(1));
src\vstest\src\vstest.console\Internal\SourceSummary.cs (1)
36public TimeSpan Duration { get; set; }
src\vstest\src\vstest.console\Processors\AeDebuggerArgumentProcessor.cs (1)
195return !process.WaitForExit(TimeSpan.FromSeconds(ProcDumpTimeoutSeconds).Seconds)
src\vstest\src\vstest.console\Processors\EnableBlameArgumentProcessor.cs (1)
241hangDumpParameters.Add("TestTimeout", TimeSpan.FromHours(1).TotalMilliseconds.ToString(CultureInfo.CurrentCulture));