521 references to FromMilliseconds
aspire (2)
Aspire.Confluent.Kafka.Tests (2)
Aspire.Dashboard (4)
Aspire.Dashboard.Components.Tests (8)
Aspire.Dashboard.Tests (12)
Aspire.Hosting (4)
Aspire.Hosting.GitHub.Models.Tests (8)
Aspire.Hosting.Kafka.Tests (8)
Aspire.Hosting.MySql.Tests (8)
Aspire.Hosting.NodeJs.Tests (8)
Aspire.Hosting.OpenAI.Tests (8)
Aspire.Hosting.PostgreSQL.Tests (8)
Aspire.Hosting.RabbitMQ.Tests (8)
Aspire.Hosting.Tests (15)
Aspire.Hosting.Valkey.Tests (8)
Aspire.MongoDB.Driver (1)
Aspire.Playground.Tests (8)
dotnet-svcutil-lib (51)
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\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));
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Microsoft.CodeAnalysis.EditorFeatures (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (12)
Microsoft.CodeAnalysis.Features (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Microsoft.DotNet.XliffTasks (1)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (2)
Microsoft.Extensions.AI.OpenAI (1)
Microsoft.Extensions.Compliance.Redaction (2)
Microsoft.Extensions.Diagnostics.Probes (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (86)
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),
Microsoft.Extensions.Diagnostics.Testing.Tests (6)
Microsoft.Extensions.Hosting.Testing.Tests (5)
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Microsoft.Extensions.Http.Resilience (5)
Microsoft.Extensions.Http.Resilience.Tests (9)
Microsoft.Extensions.ML.Tests (2)
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (1)
Microsoft.Extensions.Telemetry (2)
Microsoft.Extensions.TimeProvider.Testing.Tests (100)
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)
Microsoft.Maui.Essentials (1)
Microsoft.Maui.Resizetizer (1)
Microsoft.ML.Parquet (1)
Microsoft.ML.Tokenizers (6)
Microsoft.ML.Tokenizers.Tests (1)
Microsoft.VisualStudio.LanguageServices (2)
PresentationCore (43)
PresentationFramework (4)
PresentationFramework.AeroLite (1)
PresentationFramework.Classic (1)
PresentationFramework.Luna (1)
PresentationFramework.Royale (1)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Roslyn.VisualStudio.Next.UnitTests (5)
RunTests (4)
Shared (2)
Shared.Tests (9)
SignalRSamples (3)
Sockets.FunctionalTests (2)
System.Private.CoreLib (1)
System.ServiceModel.Federation (2)
System.ServiceModel.NetFramingBase (1)
System.ServiceModel.NetNamedPipe (3)
System.ServiceModel.Primitives (2)
UnitTests.Common (1)
WindowsBase.Tests (1)