Solved

Measure CPU idle time

Posted on 2006-06-26
1
821 Views
Last Modified: 2013-12-27
Hi!

I need a way to measure CPU idle time on a Windows Mobile 5 device. Preferably by using C/C++.

Thankful for any suggestions!
0
Comment
Question by:10goto20
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
umahesh earned 500 total points
ID: 16990168
As for windows CE based devices,

DWORD GetIdleTime (void);
This function returns the amount of time, The number of milliseconds that the system has been idle. If GetIdleTime returns MAXDWORD, functionality is not supported by your platform.

The support for this function is dependent on the OEM's implementation of the curridlelow, curridlehigh, and idleconv variables in the OEM adaptation layer (OAL).

For ISVs, if the OEM does not set the curridlelow, curridlehigh, and idleconv variables in the OAL, the value returned from GetIdleTime never increases and is usually equal to 0.

The following code example shows how to determine how long the device has idled by wrapping a call to GetIdleTime with calls to GetTickCount.

dwStartTick = GetTickCount();
dwIdleSt = GetIdleTime();
Sleep();
dwStopTick = GetTickCount();
dwIdleEd = GetIdleTime();
PercentIdle = ((100*(dwIdleEd - dwIdleSt)) / (dwStopTick - dwStartTick));
The Sleep function is required to allow other threads in the system to run during a period of time.

Goodluck
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
A list of useful business intelligence software.
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
Viewers will learn how to use the Hootsuite Dashboard.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question