Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8310809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:35:44+00:00 2026-06-08T19:35:44+00:00

I have a code ( in c# ) for managed all process starded in

  • 0

I have a code ( in c# ) for managed all process starded in my computer.

I use the PerformanceCounter class for find all values linked in one specific process.

For sample, this code retrived the Processor Time use for firefox:

PerformanceCounter processorTime = new PerformanceCounter("Process", "% Processor Time", "firefox");

double processTime = 0;

while(true){
    processTime = processorTime.NextValue();
}

Also, I know how to retrieved the percentage of my battery :

PowerStatus power = SystemInformation.PowerStatus;
float secondsRemaining = power.BatteryLifePercent;
if (secondsRemaining >= 0)
{
    kpiBattery.batteryLevel = (secondsRemaining * 100).ToString();
}

I want to get the usage battery BY PROCESS, and not global.

For sample, during the process “firefox” is use, who many battery was using?

I KNOW I want to get Battery level when process was started and when process was killed, and make the difference, but, it’s NOT true level battery use, bacause, between start and end time process, maybe lot of other process was running, and consumes battery too.

If you have any idea, or if you know the solution, I’m very interested.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:35:46+00:00Added an answer on June 8, 2026 at 7:35 pm

    As you have already said, a lot of process could be running simultaneously. Moreover, the battery usage is not directly related to the CPU usage. It could be HDD activity, graphic chip and so on. So, there are no way to calculate an adequate battery usage per process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code in a managed bean: public void setTestProp(String newProp) { FacesMessage yourFailure
Well I have this code in my Managed C++/Cli in Visual Studio 2008, I
I have managed to crunch down a several line code to this For Each
So far I have managed to write some code that should print the source
I have new problem. My code: .method public static void Main() cil managed {
I am trying to parallelize my code using openmp. I have managed to parallelize
Telephone Manager give me Null phone number while i have use this code -
We have several devs in the team, the source code is managed using the
I have the following code: $(document).ready(function() { // Manage sidebar category display jQuery(#categories >
i have the following code to disable task manager of windows xp but it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.