.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to track the Idle Time of CPU using C#.net?

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Windows Application
Hi folks!

I am working on a windows based project using C#.net, in VS 2005. I want to track the Employee Worked Hrs. But when that employee doesn't use the system for 5 mins, then I should ask him the reason or I want to logout his account.

SO How do I track the CPU's Idle Time. I dont want User's Idle Time here. I want System's Idle Time. i.e. No application is in active state even no video is running.

Hope I am clear with my doubt.

Thank U all for the support in advance.

Best Regards,
Vidyadhar - V the destiny

View Complete Post

More Related Resource Links

Track declining information over time

I am having some annoying problems, both based on the same principles. For the first issue, I am trying to track a census.  Basically, I have a list of people at a place, and want to figure out how many came in, and how many left, which will give me a positive or negative number. I want to compare this number to the original count of everyone, and then increase or decrease the amount by that factor. For example"   Starting number of people: 400     People Added: 2  People Subtracted: 10 Net loss or gain: -8  New number: 392.   I want that number that keeps track of everyone to be plotted out by month, in a line graph, so my chart would be something like   400 350        0 300                                0 250                                                 0            August             S

Performance of XBAP in .NET 4 degrades after a long idle time.


A few of my clients are using XBAP application running over .net 4 client profile in IE8. The operating system they use is windows XP (service pack 2 or 3) on all their machines. We've had no issues during install of the .net framework or our XBAP application but many of them are complaining that after keeping the xbap open for a long time their computer begins to slow down considerably. This specially happens when program is left open without using it for some time. On my own development system which is a windows 7 machine with full .net framework installed i haven't experienced such issue.

I checked for resource usage of the application but there is no significant increase in memory usage. The CPU consumption however becomes quite high, which I suspect is the reason for degradation of performance during these episodes. If this was a single case i would have ignored it for some glitch on their system but this is happening on many machines and I suspect this has got something to do with .net framework on xp machines.

I don't see any reason for why this should be happening. Is there any documented bug, report related to this ? Are there any compatibility issues of .net 4 with other common programs running in xp?  Do you have any idea on why this could be happening ? What kind of data should i provide you s

How to track user's time spent on a page


Hi all-

I've got a dynamic page where I'd like to track the time the user spends on it. 

Can someone point me in the right direction?

Time card management template is not track the time


we have installed Time card management template in share point 2007 . But Punch in, Punch out is not track the time.

we have to configure anything?

Max Idle Time for a Connection in SQL Server 2005


Can you please let me know where I can set the MAX IDLE TIME for the SQL SERVER CONNECTION.

IS this the value set for the KEEp Alive propoerty in the sql server configuration Manager.


idle logout time for sharepoint application

Hi All,

What will be the idle logout time for any sharepoint application how to set that.

Thanks Inadvance,

Calculate Web Application Idle Time


Hi all,

I have a requirement to calculate the Web application idle time. 

Say the user doesnt use the web application for 15 minutes, then a message needs to be displayed to the user.

How can this be done.

Round off time to the nearest minute

How would you round this up to the nearest minute? There isn't a built in function to do this so you have to use a little bit of maths to get there. There are 60 seconds in a minute. We already have 38 seconds on the clock. So we need to add on 60 - 38 = 22 more seconds.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

Track: SharePoint for Developers - Part 1

Are you a developer who wants to learn more about Microsoft Office SharePoint Server (MOSS)? MOSS is based on Microsoft Windows SharePoint Services, which will make it easier for you to get more problems solved with less effort. Windows SharePoint Services 3.0 takes full advantage of Microsoft ASP.NET and the Microsoft .NET runtime. In this course, you will be immersed in the new features and added programmability that is support in MOSS, which will provide you with a wealth of development opportunities.

How to track the changes of user contacts(colleagues) by using SharePoint API

We might have seen colleague tracker web part which keep tracks the changes made in our contacts/colleagues details like profile/lists/sites. The same tracking mechanism can be implemented by using MOSS API in any custom web part/ web control/ feature/web service...

UserProfile.GetColleagueChanges is the method which returns all changes happened with the contacts, this method also accepts a Query (UserProfileChangeQuery) where we can specify different parameters to filter the changes

Date and Time Functions in SQLSERVER

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

1 DATEPART Function
2 DATENAME Function
3 DAY, MONTH, and YEAR Functions
5 DATEADD Functions
6 DATEDIFF Function
7 More SQL Server Functions

Data Types - Date and Time in SqlServer

Date and time values can be stored with either the DATETIME or SMALLDATETIME data type. The difference between the two is that SMALLDATETIME supports a smaller range of dates and does not give the same level of precision when accounting for time. The DATETIME data type can hold values from January 1st of 1753 to December 31st of 9999. The time is stored to the 1 three hundredths of a second and each value takes up 8 bytes of storage. The SMALLDATETIME data type can hold values between January 1st 1900 and June 6th of 2079. The time is tracked to the minute and each value takes up 4 bytes of storage. The majority of business applications can live happily with SMALLDATETIME, however, if you are in an environment where each second matters or you need to make estimates to the distant future (or past) then you have to resort to DATETIME. If you fail to specify the time when inserting a value into a DATETIME or SMALLDATETIME column, a default of midnight is used. If you fail to specify the date portion the default of January 1, 1900 is used.

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

.NET 4 Web Application Startup Time

I was chatting with Jonathan Hawkins and some of the folks on the ASP.NET team about performance and Jonathan mentioned the startup time for large ASP.NET applications is improved on .NET 4. There are some improvements in the CLR and in ASP.NET itself that helped. If you have a giant app, you should do some tests.

Built-in Functions - Date and Time Functions

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

Essential SQL Server Date, Time and DateTime Functions

The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend