Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
I want to implement window form application which will track the user works like how much time he spend on particular application. Can anybody tell me how can i get the process idle time and how to find the total time user interaction with application. actually how can i get the exact time when process the terminated or exited. Thanks in Advance ...


What I have tried:

Process[] process=Process.GetAllProcesses();
foreach(var item in process)
{
Console.Writeline(item.startTime);
Console.writeline(item.MainWindowTitle);
Console.Writeline(item.exitTime);
}
Posted
Updated 5-Apr-16 1:00am
v2

1 solution

Try This: ProcessInfo Class (System.Web)[^] to begin with.

Also, if you take a look at the Taskmanager process info tab you can see the various columns available and you can do some arithmetic.

But wait! You will not really know much about what you're looking for. CPU usage and user time are not necessarily related. How long does a user spend doing work in order to require 50ms of CPU time? Good luck with that idea. Applications can be started and hardly touched - but the clock keeps running.

If you want to know how hard someone works - then see what they get done - which is only a first approximation. Coding, for example, can be very productive to a manager's eyes even if it were easy - and not look productive because massive problems had to be solved.



 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900