Base:
17 references to CreateTimer
Microsoft.Extensions.TimeProvider.Testing.Tests (17)
FakeTimeProviderTests.cs (4)
166
var t1 = tp.
CreateTimer
(_ =>
193
var t1 = tp.
CreateTimer
(_ =>
403
var timer = timeProvider.
CreateTimer
(_ =>
420
using var timer = provider.
CreateTimer
(calls.Add, "timer-1", TimeSpan.FromSeconds(3), TimeSpan.Zero);
TimerTests.cs (13)
25
using var timer = timeProvider.
CreateTimer
(_ => { counter++; }, null, TimeSpan.FromMilliseconds(10), TimeSpan.Zero);
47
using var timer = timeProvider.
CreateTimer
(_ => { counter++; }, null, TimeSpan.FromMilliseconds(10), Timeout.InfiniteTimeSpan);
69
using var timer = timeProvider.
CreateTimer
(_ => { counter++; }, null, TimeSpan.Zero, Timeout.InfiniteTimeSpan);
91
var timer = timeProvider.
CreateTimer
(_ => { counter++; }, null, Timeout.InfiniteTimeSpan, TimeSpan.FromMilliseconds(10));
113
var timer = timeProvider.
CreateTimer
(_ => { counter++; }, null, TimeSpan.Zero, TimeSpan.FromMilliseconds(10));
220
var timer1 = timeProvider.
CreateTimer
(_ => timer1Counter++, null, TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1));
221
var timer2 = timeProvider.
CreateTimer
(_ => timer2Counter++, null, TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1));
280
using var timer = timeProvider.
CreateTimer
(_ => { callbackTime = timeProvider.GetUtcNow(); }, null, TimeSpan.Zero, TimeSpan.FromMilliseconds(10));
303
var timer = timeProvider.
CreateTimer
(_ => { callbackTimes.Add(timeProvider.GetUtcNow()); }, null, TimeSpan.Zero, period);
328
using var timer1 = timeProvider.
CreateTimer
(_ => callbacks.Add((1, timeProvider.GetElapsedTime(startTime))), null, TimeSpan.FromMilliseconds(3), TimeSpan.FromMilliseconds(3));
329
using var timer2 = timeProvider.
CreateTimer
(_ => callbacks.Add((2, timeProvider.GetElapsedTime(startTime))), null, TimeSpan.FromMilliseconds(3), TimeSpan.FromMilliseconds(3));
330
using var timer3 = timeProvider.
CreateTimer
(_ => callbacks.Add((3, timeProvider.GetElapsedTime(startTime))), null, TimeSpan.FromMilliseconds(6), TimeSpan.FromMilliseconds(5));
366
timers.Add(timeProvider.
CreateTimer
(index => triggers[(int)index!] = true, i, TimeSpan.FromSeconds(dueTimes[i]), TimeSpan.Zero));