Skip to content

PeriodicTimer in C#: net10.0, timer disposal and behaviour tests - #2349

Merged
vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/103871-csharp-periodic-timer
Nov 2, 2026
Merged

vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/103871-csharp-periodic-timer

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Updates threads-csharp/PeriodicTimerCSharp for the refreshed PeriodicTimer article: both projects move to net10.0 with MSTest 4.5.2, Microsoft.NET.Test.Sdk 18.11.0 and coverlet.collector 10.1.0, StopTaskAsync now disposes the timer, the elapsed time prints TotalSeconds instead of the truncated Seconds component, the prompt says Press any key, and a new PeriodicTimerBehaviorTests class uses FakeTimeProvider (Microsoft.Extensions.TimeProvider.Testing 10.11.0) to cover missed-tick coalescing, the single-consumer rule, disposal and the settable Period.

…iour tests

Moves both projects to net10.0 with MSTest 4.5.2, Microsoft.NET.Test.Sdk 18.11.0 and coverlet.collector 10.1.0. StopTaskAsync now disposes the PeriodicTimer, the elapsed time prints TotalSeconds instead of the truncated Seconds component, and the prompt says 'Press any key'. Adds four FakeTimeProvider-based tests for missed-tick coalescing, the single-consumer rule, dispose and the settable Period.
@vladimir-pecanac-main
vladimir-pecanac-main merged commit b905b24 into CodeMazeBlog:main Nov 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant