Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use Environment.TickCount64 in GetUptimeCommand#26151

Closed
xtqqczze wants to merge 3 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
xtqqczze:GetUptimeCommand-TickCount64xtqqczze/PowerShell-PowerShell:GetUptimeCommand-TickCount64Copy head branch name to clipboard
Closed

Use Environment.TickCount64 in GetUptimeCommand#26151
xtqqczze wants to merge 3 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
xtqqczze:GetUptimeCommand-TickCount64xtqqczze/PowerShell-PowerShell:GetUptimeCommand-TickCount64Copy head branch name to clipboard

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Oct 5, 2025

Copy link
Copy Markdown
Contributor
  • Use the .NET Core 3.0 API Environment.TickCount64 instead of Stopwatch.
  • Refactor into seperate methods for the different code paths.

cc: @iSazonov

Use the .NET Core 3.0 API `Environment.TickCount64` instead of `Stopwatch`
@iSazonov

iSazonov commented Oct 8, 2025

Copy link
Copy Markdown
Collaborator

@xtqqczze This is more difficult area than might be expected.
See dotnet/runtime#77945
Really we could say about:

  1. absolute OS boot time
  2. how long OS works since boot time minus suspended time
  3. time from OS boot time to current time
    Ideally the cmdlet should allow users to get all these times.

@xtqqczze

xtqqczze commented Oct 8, 2025

Copy link
Copy Markdown
Contributor Author

@iSazonov Does dotnet/runtime#77945 mean these changes are a change in behavior?

@iSazonov

iSazonov commented Oct 8, 2025

Copy link
Copy Markdown
Collaborator

Yes, this should correct the difference on different systems.

@xtqqczze

xtqqczze commented Oct 8, 2025

Copy link
Copy Markdown
Contributor Author

So these changes are a fix for #18469?

@iSazonov

iSazonov commented Oct 8, 2025

Copy link
Copy Markdown
Collaborator

One step in this direction. What would be ideal, I described above.

@xtqqczze

xtqqczze commented Oct 8, 2025

Copy link
Copy Markdown
Contributor Author

The cmdlet is documented to "return the time elapsed since the last boot of the operating system"

So if these changes align with this, then I think that is sufficient for this PR.

how long OS works since boot time minus suspended time

This would be a new feature and could be implemented separately.

@iSazonov

iSazonov commented Oct 9, 2025

Copy link
Copy Markdown
Collaborator

This cmdlet was presented as an experimental one to get feedback. After some issues and user expectations have been identified, this cmdlet can be fixed as I described, but a fix in Runtime is required before.

@xtqqczze

xtqqczze commented Oct 9, 2025

Copy link
Copy Markdown
Contributor Author

This cmdlet was presented as an experimental one to get feedback. After some issues and user expectations have been identified, this cmdlet can be fixed as I described, but a fix in Runtime is required before.

I see there is now PR: dotnet/runtime#119443

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 12, 2025
@xtqqczze

Copy link
Copy Markdown
Contributor Author

Waiting on dotnet/runtime#119443

@microsoft-github-policy-service microsoft-github-policy-service Bot removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept Stale labels Oct 27, 2025
@iSazonov

Copy link
Copy Markdown
Collaborator

I suggest to close the PR because we need not only update from .Net but also we should redesign the cmdlet based on feedback we got in last years.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 31, 2025
@xtqqczze

xtqqczze commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

Waiting on dotnet/runtime#119443

It does not look like this will be happening anytime soon.

@microsoft-github-policy-service microsoft-github-policy-service Bot added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Nov 4, 2025
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.