Skip to content

Use ValueStopWatch#1148

Merged
ReubenBond merged 1 commit intomicrosoft:mainfrom
Kahbazi:kahbazi/ValueStopWatch
Nov 30, 2023
Merged

Use ValueStopWatch#1148
ReubenBond merged 1 commit intomicrosoft:mainfrom
Kahbazi:kahbazi/ValueStopWatch

Conversation

@Kahbazi
Copy link
Copy Markdown
Contributor

@Kahbazi Kahbazi commented Nov 30, 2023

No description provided.

Copy link
Copy Markdown
Member

@ReubenBond ReubenBond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @Kahbazi :)

@ReubenBond
Copy link
Copy Markdown
Member

ReubenBond commented Nov 30, 2023

In some cases, using TimeProvider might be appropriate, but we can make that change later (if we have tests which rely on time, such as for an implementation of IEndPointHealthFeature)

@ReubenBond ReubenBond merged commit df636ce into microsoft:main Nov 30, 2023
@Kahbazi Kahbazi deleted the kahbazi/ValueStopWatch branch November 30, 2023 19:29

namespace Microsoft.Extensions.Internal;

internal struct ValueStopwatch
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal readonly struct ValueStopwatch

Where did you take this code from? It looks to be a copy from https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Http/src/ValueStopwatch.cs, but doesn't have this change in it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I got it from the aspnetcore repo and removed the #ifs since this project is target .NET 8.0. Should I make the struct readonly as well?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just opened a PR for it - #1156

andrevlins pushed a commit to andrevlins/aspire that referenced this pull request Dec 3, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants