521 references to FromMilliseconds
aspire (2)
Backchannel\ExtensionBackchannel.cs (1)
88using var timer = new PeriodicTimer(TimeSpan.FromMilliseconds(50));
DotNet\DotNetCliRunner.cs (1)
582using var timer = new PeriodicTimer(TimeSpan.FromMilliseconds(50));
Aspire.Confluent.Kafka.Tests (2)
ProducerConformanceTests.cs (1)
58service.Flush(TimeSpan.FromMilliseconds(1000));
ProducerExtensions.cs (1)
12while (producer.Flush(TimeSpan.FromMilliseconds(100)) != 0)
Aspire.Dashboard (4)
Otlp\Storage\TelemetryRepository.cs (1)
33internal TimeSpan _subscriptionMinExecuteInterval = TimeSpan.FromMilliseconds(100);
ServiceClient\DashboardClient.cs (2)
591await foreach (var batch in channel.GetBatchesAsync(minReadInterval: TimeSpan.FromMilliseconds(100), cancellationToken: enumeratorCancellationToken).ConfigureAwait(false)) 685await foreach (var batch in channel.GetBatchesAsync(TimeSpan.FromMilliseconds(100), combinedTokens.Token).ConfigureAwait(false))
Utils\DashboardUIHelpers.cs (1)
30public static readonly TimeSpan ToastTimeout = TimeSpan.FromMilliseconds(5000);
Aspire.Dashboard.Components.Tests (8)
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Aspire.Dashboard.Tests (12)
ChannelExtensionsTests.cs (2)
69var minReadInterval = TimeSpan.FromMilliseconds(500); 113var minReadInterval = TimeSpan.FromMilliseconds(50000);
CustomAssert.cs (1)
13Assert.True(duration >= minInterval.Subtract(TimeSpan.FromMilliseconds(50)), $"Elapsed time {duration} should be greater than min interval {minInterval}.");
TelemetryRepositoryTests\LogTests.cs (1)
705var minExecuteInterval = TimeSpan.FromMilliseconds(500);
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Aspire.Hosting (4)
Dcp\DcpPipelineBuilder.cs (1)
18Delay = TimeSpan.FromMilliseconds(200),
Dcp\KubernetesService.cs (3)
84private static readonly TimeSpan s_initialRetryDelay = TimeSpan.FromMilliseconds(100); 536MaxDelay = TimeSpan.FromMilliseconds(dcpOptions.Value.KubernetesConfigReadRetryIntervalMilliseconds), 586await Task.Delay(TimeSpan.FromMilliseconds(dcpOptions.Value.KubernetesConfigReadRetryIntervalMilliseconds), cancellationToken).ConfigureAwait(false);
Aspire.Hosting.GitHub.Models.Tests (8)
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Aspire.Hosting.Kafka.Tests (8)
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Aspire.Hosting.MySql.Tests (8)
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Aspire.Hosting.NodeJs.Tests (8)
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Aspire.Hosting.OpenAI.Tests (8)
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Aspire.Hosting.PostgreSQL.Tests (8)
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Aspire.Hosting.RabbitMQ.Tests (8)
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Aspire.Hosting.Tests (15)
Dcp\DcpHostNotificationTests.cs (3)
129using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); 184using var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)); 366await Task.Delay(TimeSpan.FromMilliseconds(100));
Health\ResourceHealthCheckServiceTests.cs (1)
263rhcs.NonHealthyHealthCheckStepInterval = TimeSpan.FromMilliseconds(10);
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Utils\PeriodicRestartAsyncEnumerableTests.cs (3)
20var innerFactory = (int? lastValue, CancellationToken cancellationToken) => Task.FromResult(CountingAsyncEnumerable(0, TimeSpan.FromMilliseconds(50), cancellationToken)); 43var innerFactory = (int? lastValue, CancellationToken cancellationToken) => Task.FromResult(RefCountingAsyncEnumerable(0, TimeSpan.FromMilliseconds(10), cancellationToken)); 45await foreach (var _ in PeriodicRestartAsyncEnumerable.CreateAsync(innerFactory, restartInterval: TimeSpan.FromMilliseconds(100), cancellationToken: cts.Token).ConfigureAwait(false))
Aspire.Hosting.Valkey.Tests (8)
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
Aspire.MongoDB.Driver (1)
AspireMongoDBDriverExtensions.cs (1)
184settings.HealthCheckTimeout > 0 ? TimeSpan.FromMilliseconds(settings.HealthCheckTimeout.Value) : null));
Aspire.Playground.Tests (8)
tests\Shared\AsyncTestHelpers.cs (8)
27public static TimeSpan DefaultTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(DefaultTimeoutDuration); 28public static TimeSpan LongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(LongTimeoutDuration); 29public static TimeSpan ExtraLongTimeoutTimeSpan { get; } = TimeSpan.FromMilliseconds(ExtraLongTimeoutDuration); 46cts.CancelAfter(TimeSpan.FromMilliseconds(milliseconds)); 73return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 88return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 103return task.TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber); 118return task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(milliseconds), filePath, lineNumber);
dotnet-svcutil-lib (51)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InputQueue.cs (6)
814_timer = new Timer(new TimerCallback(s_timerCallback), this, timeout, TimeSpan.FromMilliseconds(-1)); 840_timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 871_timer = new Timer(new TimerCallback(s_timerCallback), this, timeout, TimeSpan.FromMilliseconds(-1)); 896timely = (_timer == null) || _timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1));
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TimeoutHelper.cs (2)
14public static readonly TimeSpan MaxWait = TimeSpan.FromMilliseconds(Int32.MaxValue); 81return TimeSpan.FromMilliseconds(milliseconds);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferedConnection.cs (5)
46_flushTimer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 96_flushTimer = new Timer(new TimerCallback(new Action<object>(OnFlushTimer)), null, TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 99_flushTimer.Change(_flushTimeout, TimeSpan.FromMilliseconds(-1));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (10)
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)); 828ReceiveTimer.Change(timeout, TimeSpan.FromMilliseconds(-1)); 865SendTimer.Change(timeout, TimeSpan.FromMilliseconds(-1));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IdlingCommunicationPool.cs (5)
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\LifetimeManager.cs (5)
288_timer = new Timer(new TimerCallback(new Action<object>(TimeoutCallback)), this, timeout, TimeSpan.FromMilliseconds(-1)); 313_timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); 352_timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ReliableSessionBindingElementImporter.cs (1)
274interval = TimeSpan.FromMilliseconds(Convert.ToDouble(milliseconds));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannel.cs (9)
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))) 2345_timer = new Timer(new TimerCallback(GetTimerCallback()), this, idle, TimeSpan.FromMilliseconds(-1)); 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\UdpRetransmissionSettings.cs (1)
269return diff < TimeSpan.FromMilliseconds(1).Ticks || (max > 0 && diff / (double)max < 1e-3);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (3)
824_timer = new Timer(new TimerCallback(AsyncDuplexRequest.s_timerCallback), this, timeout, TimeSpan.FromMilliseconds(-1)); 885_timer.Change(TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1));
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\TimeBoundedCache.cs (4)
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));
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Logging\AcceptanceTests.cs (3)
122fakeTimeProvider.Advance(TimeSpan.FromMilliseconds(ErrorRouteProcessingTimeMs)); 129fakeTimeProvider.Advance(TimeSpan.FromMilliseconds(SlashRouteProcessingTimeMs)); 182var spinTime = TimeSpan.FromMilliseconds(50);
Logging\ApiRoutingController.cs (1)
32fakeTimeProvider.Advance(TimeSpan.FromMilliseconds(AcceptanceTests.ControllerProcessingTimeMs));
Microsoft.CodeAnalysis.EditorFeatures (1)
Shared\Utilities\ResettableDelay.cs (1)
63if (!await expeditableDelaySource.Delay(TimeSpan.FromMilliseconds(_delayInMilliseconds), cancellationToken).ConfigureAwait(false))
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (12)
Utilities\AsynchronousOperationListenerTests.cs (12)
66Thread.Sleep(TimeSpan.FromMilliseconds(10)); 111sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 116sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 144sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 177sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 181sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 185sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 212sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 217sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 221sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 302sleepHelper.Sleep(TimeSpan.FromMilliseconds(500)); 312sleepHelper.Sleep(TimeSpan.FromMilliseconds(500));
Microsoft.CodeAnalysis.Features (1)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingIdleProcessor.cs (1)
106var delayTimeSpan = TimeSpan.FromMilliseconds(Math.Max(s_minimumDelay.TotalMilliseconds, timeLeft.TotalMilliseconds));
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Handler\AbstractRefreshQueue.cs (1)
68delay: TimeSpan.FromMilliseconds(2000),
Handler\Diagnostics\AbstractWorkspacePullDiagnosticsHandler.cs (1)
113await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false);
Protocol\Internal\Converters\RegexConverter.cs (1)
20return new Regex(reader.GetString(), RegexOptions.Compiled | RegexOptions.ECMAScript, matchTimeout: TimeSpan.FromMilliseconds(1000));
Microsoft.DotNet.XliffTasks (1)
ExponentialRetry.cs (1)
43yield return TimeSpan.FromMilliseconds(milliseconds);
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (2)
ResultStoreTester.cs (2)
123await Task.Delay(TimeSpan.FromMilliseconds(500)); 133await Task.Delay(TimeSpan.FromMilliseconds(500));
Microsoft.Extensions.AI.OpenAI (1)
src\Shared\ServerSentEvents\SseParser_1.cs (1)
451TimeSpan timeSpan = milliseconds == TimeSpan_MaxValueMilliseconds ? TimeSpan.MaxValue : TimeSpan.FromMilliseconds(milliseconds);
Microsoft.Extensions.Compliance.Redaction (2)
src\Shared\Data.Validation\TimeSpanAttribute.cs (2)
28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 39return TimeSpan.FromMilliseconds((double)_maxMs);
Microsoft.Extensions.Diagnostics.Probes (2)
src\Shared\Data.Validation\TimeSpanAttribute.cs (2)
28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 39return TimeSpan.FromMilliseconds((double)_maxMs);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
src\Shared\Data.Validation\TimeSpanAttribute.cs (2)
28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 39return TimeSpan.FromMilliseconds((double)_maxMs);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (86)
ResourceMonitoringOptionsTests.cs (2)
16CollectionWindow = TimeSpan.FromMilliseconds(100), 17SamplingInterval = TimeSpan.FromMilliseconds(10),
ResourceMonitoringOptionsValidatorTests.cs (9)
17CollectionWindow = TimeSpan.FromMilliseconds(100), 18SamplingInterval = TimeSpan.FromMilliseconds(10), 49CollectionWindow = TimeSpan.FromMilliseconds(100), 50SamplingInterval = TimeSpan.FromMilliseconds(0), 64CollectionWindow = TimeSpan.FromMilliseconds(100), 65SamplingInterval = TimeSpan.FromMilliseconds(1), 109CollectionWindow = TimeSpan.FromMilliseconds(samplingWindow), 110SamplingInterval = TimeSpan.FromMilliseconds(samplingPeriod), 111PublishingWindow = TimeSpan.FromMilliseconds(calculationPeriod)
ResourceMonitoringServiceTests.cs (52)
112CollectionWindow = TimeSpan.FromMilliseconds(int.MaxValue), 113SamplingInterval = TimeSpan.FromMilliseconds(int.MaxValue) 202CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod), 203SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod), 204PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod) 217await Task.Delay(TimeSpan.FromMilliseconds(TimerPeriod * 3)); 243CollectionWindow = TimeSpan.FromMilliseconds(100), 244PublishingWindow = TimeSpan.FromMilliseconds(100), 245SamplingInterval = TimeSpan.FromMilliseconds(1) 258clock.Advance(TimeSpan.FromMilliseconds(1)); 259clock.Advance(TimeSpan.FromMilliseconds(1)); 276CollectionWindow = TimeSpan.FromMilliseconds(100), 277PublishingWindow = TimeSpan.FromMilliseconds(100) 317CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod), 318PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod), 319SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 338clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 360CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod), 361PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod), 362SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 370clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 403TimeSpan.FromMilliseconds(250), 404TimeSpan.FromMilliseconds(250), 408TimeSpan.FromMilliseconds(250), 409TimeSpan.FromMilliseconds(250), 413TimeSpan.FromMilliseconds(250), 414TimeSpan.FromMilliseconds(250), 418TimeSpan.FromMilliseconds(250), 419TimeSpan.FromMilliseconds(250), 423TimeSpan.FromMilliseconds(250), 424TimeSpan.FromMilliseconds(250), 437CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 438PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 439SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 465clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 496TimeSpan.FromMilliseconds(250), 497TimeSpan.FromMilliseconds(250), 509TimeSpan.FromMilliseconds(250), 510TimeSpan.FromMilliseconds(250), 514TimeSpan.FromMilliseconds(250), 515TimeSpan.FromMilliseconds(250), 519TimeSpan.FromMilliseconds(250), 520TimeSpan.FromMilliseconds(250), 524TimeSpan.FromMilliseconds(250), 525TimeSpan.FromMilliseconds(250), 529TimeSpan.FromMilliseconds(250), 530TimeSpan.FromMilliseconds(250), 546CollectionWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 547PublishingWindow = TimeSpan.FromMilliseconds(TimerPeriod * 2), 548SamplingInterval = TimeSpan.FromMilliseconds(TimerPeriod) 574clock.Advance(TimeSpan.FromMilliseconds(TimerPeriod)); 654SamplingInterval = TimeSpan.FromMilliseconds(100),
Windows\WindowsContainerSnapshotProviderTests.cs (17)
217var options = new ResourceMonitoringOptions { CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) }; 237fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 244fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 283CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 303fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 309fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 316fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 352MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 372fakeClock.Advance(options.MemoryConsumptionRefreshInterval - TimeSpan.FromMilliseconds(1)); 377fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 411MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) 437fakeClock.Advance(options.MemoryConsumptionRefreshInterval - TimeSpan.FromMilliseconds(1)); 449fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 489MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 507fakeClock.Advance(options.MemoryConsumptionRefreshInterval - TimeSpan.FromMilliseconds(1)); 512fakeClock.Advance(TimeSpan.FromMilliseconds(2)); 517fakeClock.Advance(TimeSpan.FromMilliseconds(2));
Windows\WindowsSnapshotProviderTests.cs (6)
82CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 103fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 108fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 123MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2), 144fakeClock.Advance(TimeSpan.FromMilliseconds(1)); 150fakeClock.Advance(TimeSpan.FromMilliseconds(1));
Microsoft.Extensions.Diagnostics.Testing.Tests (6)
Logging\FakeLogCollectorTests.cs (2)
32timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 74timeProvider.Advance(TimeSpan.FromMilliseconds(1));
Logging\FakeLoggerTests.cs (3)
259timeProvider.Advance(TimeSpan.FromMilliseconds(1)); 266Assert.Equal(start + TimeSpan.FromMilliseconds(1), records[2].Timestamp); 267Assert.Equal(start + TimeSpan.FromMilliseconds(1), records[3].Timestamp);
Metrics\MetricCollectorTests.cs (1)
341await Assert.ThrowsAnyAsync<OperationCanceledException>(() => collector.WaitForMeasurementsAsync(1, TimeSpan.FromMilliseconds(50)));
Microsoft.Extensions.Hosting.Testing.Tests (5)
FakeHostTests.cs (5)
51await Task.Delay(TimeSpan.FromMilliseconds(100)); 77var cancellationTokenSource = timeProvider.CreateCancellationTokenSource(TimeSpan.FromMilliseconds(1)); 86var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.FromMilliseconds(-1) }); 137var cancellationTokenSource = timeProvider.CreateCancellationTokenSource(TimeSpan.FromMilliseconds(1)); 146var sut = new FakeHost(hostMock.Object, new FakeHostOptions { StartUpTimeout = TimeSpan.FromMilliseconds(-1) });
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\HttpClientLoggerTest.cs (1)
919fakeTimeProvider.Advance(TimeSpan.FromMilliseconds(1000));
Microsoft.Extensions.Http.Resilience (5)
Hedging\Internals\Validators\HttpStandardHedgingResilienceOptionsCustomValidator.cs (2)
24var timeout = TimeSpan.FromMilliseconds(options.Endpoint.Timeout.Timeout.TotalMilliseconds * CircuitBreakerTimeoutMultiplier); 36var maxHedgingDelay = TimeSpan.FromMilliseconds(options.Hedging.MaxHedgedAttempts * options.Hedging.Delay.TotalMilliseconds);
Resilience\Internal\Validators\HttpStandardResilienceOptionsCustomValidator.cs (1)
24if (options.CircuitBreaker.SamplingDuration < TimeSpan.FromMilliseconds(options.AttemptTimeout.Timeout.TotalMilliseconds * CircuitBreakerTimeoutMultiplier))
src\Shared\Data.Validation\TimeSpanAttribute.cs (2)
28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 39return TimeSpan.FromMilliseconds((double)_maxMs);
Microsoft.Extensions.Http.Resilience.Tests (9)
Hedging\HttpStandardHedgingResilienceOptionsCustomValidatorTests.cs (4)
47options.Endpoint.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.Endpoint.Timeout.Timeout.TotalMilliseconds * 2); 53TimeSpan.FromMilliseconds(options.Endpoint.Timeout.Timeout.TotalMilliseconds * 2) + TimeSpan.FromMilliseconds(10); 92options.Endpoint.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.Endpoint.Timeout.Timeout.TotalMilliseconds / 2);
Hedging\StandardHedgingTests.cs (1)
40options.Hedging.Delay = TimeSpan.FromMilliseconds(5);
Resilience\HttpStandardResilienceOptionsCustomValidatorTests.cs (4)
53options.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.AttemptTimeout.Timeout.TotalMilliseconds * 2); 58options.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.AttemptTimeout.Timeout.TotalMilliseconds * 2) + TimeSpan.FromMilliseconds(10); 93options.CircuitBreaker.SamplingDuration = TimeSpan.FromMilliseconds(options.AttemptTimeout.Timeout.TotalMilliseconds / 2);
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.Dns (1)
Resolver\DnsResolver.cs (1)
23private static readonly TimeSpan s_maxTimeout = TimeSpan.FromMilliseconds(int.MaxValue);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (1)
Resolver\TcpFailoverTests.cs (1)
70Options.Timeout = TimeSpan.FromMilliseconds(100000);
Microsoft.Extensions.Telemetry (2)
src\Shared\Data.Validation\TimeSpanAttribute.cs (2)
28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 39return TimeSpan.FromMilliseconds((double)_maxMs);
Microsoft.Extensions.TimeProvider.Testing.Tests (100)
FakeTimeProviderTests.cs (27)
63AutoAdvanceAmount = TimeSpan.FromMilliseconds(msToElapse) 105timeProvider.Advance(TimeSpan.FromMilliseconds(8)); 121timeProvider.Advance(TimeSpan.FromMilliseconds(8)); 191timeProvider.Advance(TimeSpan.FromMilliseconds(1234)); 234tp.AdjustTime(tp.GetUtcNow() + TimeSpan.FromMilliseconds(999)); 237tp.AdjustTime(tp.GetUtcNow() + TimeSpan.FromMilliseconds(1)); 243tp.Advance(TimeSpan.FromMilliseconds(999)); 246tp.Advance(TimeSpan.FromMilliseconds(1)); 261tp.AdjustTime(tp.GetUtcNow() - TimeSpan.FromMilliseconds(999)); 264tp.AdjustTime(tp.GetUtcNow() - TimeSpan.FromMilliseconds(1)); 270tp.Advance(TimeSpan.FromMilliseconds(999)); 273tp.Advance(TimeSpan.FromMilliseconds(1)); 286private readonly TimeSpan _infiniteTimeout = TimeSpan.FromMilliseconds(-1); 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)); 366await Assert.ThrowsAsync<ArgumentOutOfRangeException>(() => source.Task.WaitAsync(TimeSpan.FromMilliseconds(-2), 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)); 515th.Join(TimeSpan.FromMilliseconds(200));
TimerTests.cs (73)
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)); 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); 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)),
Microsoft.Maui.Controls (1)
Cells\Cell.cs (1)
274 await Task.Delay(TimeSpan.FromMilliseconds(16));
Microsoft.Maui.Essentials (1)
Vibration\Vibration.shared.cs (1)
94 vibration.Vibrate(TimeSpan.FromMilliseconds(duration));
Microsoft.Maui.Resizetizer (1)
AsyncTask.cs (1)
286 var index = (WaitHandleIndex)System.Threading.WaitHandle.WaitAny(handles, TimeSpan.FromMilliseconds(10));
Microsoft.ML.Parquet (1)
ParquetLoader.cs (1)
749dst = TimeSpan.FromDays(src.Months * 30 + src.Days) + TimeSpan.FromMilliseconds(src.Millis);
Microsoft.ML.Tokenizers (6)
Model\TiktokenTokenizer.cs (3)
1270private static Regex Cl100kBaseRegex() => _cl100kBaseRegex ??= new Regex(Cl100kBaseRegexPattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(PreTokenizer.DefaultTimeOutInMilliseconds)); 1273internal static Regex P50kBaseRegex() => _p50kBaseRegex ??= new Regex(P50kBaseRegexPattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(PreTokenizer.DefaultTimeOutInMilliseconds)); 1276internal static Regex O200kBaseRegex() => _o200kBaseRegex ??= new Regex(O200kBaseRegexPattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(PreTokenizer.DefaultTimeOutInMilliseconds));
PreTokenizer\PreTokenizer.cs (3)
52private static Regex WhiteSpaceOrPunctuationRegex() => new Regex(WhiteSpaceOrPunctuationPattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds)); 81private static Regex WordOrNonWordRegex() => new Regex(WordOrNonWordPattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds)); 111private static Regex WhiteSpaceRegex() => new Regex(WhiteSpacePattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds));
Microsoft.ML.Tokenizers.Tests (1)
BpeTests.cs (1)
984preTokenizers.Add(new RegexPreTokenizer(new Regex(pattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds)), null));
Microsoft.VisualStudio.LanguageServices (2)
Interop\CleanableWeakComHandleTable.cs (1)
28private static readonly TimeSpan s_defaultCleanUpTimeSlice = TimeSpan.FromMilliseconds(15);
ProjectSystem\FileChangeWatcher.cs (1)
52TimeSpan.FromMilliseconds(500),
PresentationCore (43)
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (2)
651_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 887_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (2)
651_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 887_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (2)
651_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 887_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (2)
651_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 887_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (2)
651_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 887_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
System\Windows\Media\Animation\TimeManager.cs (1)
266TimeSpan offsetTime = TimeSpan.FromMilliseconds((double)offset);
PresentationFramework (4)
System\Windows\Controls\ItemsControl.cs (1)
3314return TimeSpan.FromMilliseconds(MS.Win32.SafeNativeMethods.GetDoubleClickTime() * 0.8);
System\Windows\Controls\VirtualizingStackPanel.cs (1)
8850_cleanupDelay.Interval = TimeSpan.FromMilliseconds(500.0);
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (2)
743_sortedResolvedKeyFrames[index]._resolvedKeyTime = TimeSpan.FromMilliseconds( 979_sortedResolvedKeyFrames[currentKeyFrameIndex]._resolvedKeyTime = prePacedBlockKeyTime + TimeSpan.FromMilliseconds(
PresentationFramework.AeroLite (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
108Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds)), // Repeat every 3 seconds
PresentationFramework.Classic (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
108Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds)), // Repeat every 3 seconds
PresentationFramework.Luna (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
108Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds)), // Repeat every 3 seconds
PresentationFramework.Royale (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
108Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds)), // Repeat every 3 seconds
Roslyn.VisualStudio.DiagnosticsWindow (1)
PerfMargin\PerfMarginPanel.cs (1)
51_timer = new DispatcherTimer(TimeSpan.FromMilliseconds(500), DispatcherPriority.Background, UpdateUI, Dispatcher);
Roslyn.VisualStudio.Next.UnitTests (5)
Services\PerformanceTrackerServiceTests.cs (1)
183yield return new AnalyzerPerformanceInfo(kv.Key, true, TimeSpan.FromMilliseconds(timeSpan));
Services\SolutionAssetCacheTests.cs (4)
46remoteWorkspace: null, cleanupInterval: TimeSpan.FromMilliseconds(1), purgeAfter: TimeSpan.FromMilliseconds(2)); 79workspace, cleanupInterval: TimeSpan.FromMilliseconds(1), purgeAfter: TimeSpan.FromMilliseconds(2));
RunTests (4)
AssemblyScheduler.cs (2)
100var averageExecutionTime = TimeSpan.FromMilliseconds(testHistory.Values.Average(t => t.TotalMilliseconds)); 153var totalExpectedRunTime = TimeSpan.FromMilliseconds(updated.Values.SelectMany(types => types).SelectMany(type => type.Tests).Sum(test => test.ExecutionTime.TotalMilliseconds));
TestHistoryManager.cs (2)
103if (!testInfos.TryAdd(testName, TimeSpan.FromMilliseconds(testResult.DurationInMs))) 123var totalTestRuntime = TimeSpan.FromMilliseconds(testInfos.Values.Sum(t => t.TotalMilliseconds));
Shared (2)
Data.Validation\TimeSpanAttribute.cs (2)
28public TimeSpan Minimum => _minMs.HasValue ? TimeSpan.FromMilliseconds((double)_minMs) : TimeSpan.Parse(_min!, CultureInfo.InvariantCulture); 39return TimeSpan.FromMilliseconds((double)_maxMs);
Shared.Tests (9)
Data.Validation\TimeSpanAttributeTests.cs (9)
42options.Time = TimeSpan.FromTicks(TimeSpan.FromMilliseconds(10).Ticks + 1); 54options.Time = TimeSpan.FromMilliseconds(10); 72options.Time2 = TimeSpan.FromMilliseconds(int.MaxValue); 107options.Time = TimeSpan.FromMilliseconds(10); 114options.Time = TimeSpan.FromMilliseconds(5); 135options.Time2 = TimeSpan.FromMilliseconds(int.MaxValue); 170options.Time = TimeSpan.FromTicks(TimeSpan.FromMilliseconds(10).Ticks + 1); 182options.Time = TimeSpan.FromMilliseconds(10); 200options.Time2 = TimeSpan.FromMilliseconds(int.MaxValue);
SignalRSamples (3)
Hubs\Streaming.cs (3)
17await Task.Delay(TimeSpan.FromMilliseconds(delay)); 23var observable = Observable.Interval(TimeSpan.FromMilliseconds(delay)) 39await Task.Delay(TimeSpan.FromMilliseconds(delay));
Sockets.FunctionalTests (2)
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (2)
120var bytesWrittenPollingInterval = TimeSpan.FromMilliseconds(bytesWrittenTimeout.TotalMilliseconds / 10); 213var bytesWrittenPollingInterval = TimeSpan.FromMilliseconds(bytesWrittenTimeout.TotalMilliseconds / 10);
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (1)
265_nextPollingTimeStamp += TimeSpan.FromMilliseconds(_pollingIntervalInMilliseconds * Math.Ceiling(delta.TotalMilliseconds / _pollingIntervalInMilliseconds));
System.ServiceModel.Federation (2)
System\Runtime\TaskHelpers.cs (1)
159private static readonly TimeSpan s_maxWait = TimeSpan.FromMilliseconds(int.MaxValue);
System\Runtime\TimeoutHelper.cs (1)
11public static readonly TimeSpan MaxWait = TimeSpan.FromMilliseconds(int.MaxValue);
System.ServiceModel.NetFramingBase (1)
System\ServiceModel\Channels\TransportDefaults.cs (1)
41public static TimeSpan MaxOutputDelay => TimeSpan.FromMilliseconds(200);
System.ServiceModel.NetNamedPipe (3)
System\Runtime\BackoffTimeoutHelper.cs (1)
12private static readonly TimeSpan s_defaultInitialWaitTime = TimeSpan.FromMilliseconds(1);
System\ServiceModel\Channels\PipeConnectionInitiator.cs (2)
156if (timeout >= TimeSpan.FromMilliseconds(backoffBufferMilliseconds * 2)) 158backoffTimeout = TimeoutHelper.Add(timeout, TimeSpan.Zero - TimeSpan.FromMilliseconds(backoffBufferMilliseconds));
System.ServiceModel.Primitives (2)
Internals\System\Runtime\TimeoutHelper.cs (2)
15public static readonly TimeSpan MaxWait = TimeSpan.FromMilliseconds(int.MaxValue); 78return TimeSpan.FromMilliseconds(milliseconds);
UnitTests.Common (1)
TestData.cs (1)
23{ TimeSpan.FromMilliseconds(0)},
WindowsBase.Tests (1)
System\Windows\Threading\DispatcherTimerTests.cs (1)
115yield return new object[] { TimeSpan.FromMilliseconds((double)int.MaxValue + 1) };