Get Battery Usage By Process
===

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

I use the [PerformanceCounter][1] 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]: http://msdn.microsoft.com/fr-fr/library/system.diagnostics.performancecounter%28v=vs.90%29.aspx