Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop instantiating Stopwatch #31347

Closed
roji opened this issue Jul 25, 2023 · 1 comment · Fixed by #31348
Closed

Stop instantiating Stopwatch #31347

roji opened this issue Jul 25, 2023 · 1 comment · Fixed by #31348
Assignees
Labels
area-diagnostics area-perf closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@roji
Copy link
Member

roji commented Jul 25, 2023

.NET 7.0 introduced some APIs which allow using Stopwatch statically, without instantiating and adding a heap allocation:

long timestamp = Stopwatch.GetTimestamp();

...

TimeSpan elapsedTime = Stopwatch.GetElapsedTime(timestamp);

See previous discussion about SQLite specifically in #26295.

@roji
Copy link
Member Author

roji commented Aug 3, 2023

Done in #31348

@roji roji closed this as completed Aug 3, 2023
@roji roji added this to the 8.0.0 milestone Aug 3, 2023
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 3, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0, 8.0.0-rc1 Aug 19, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0-rc1, 8.0.0 Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-diagnostics area-perf closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants