GetIdleTime
9/8/2008
Essa função retorna a quantidade de tempo, em milissegundos, que o sistema foi ocioso.
Syntax
DWORD GetIdleTime (void);
Parameters
Nenhum.
Return Value
O número de milissegundos que o sistema foi ocioso. Se GetIdleTime Retorna MAXDWORD, essa funcionalidade não é com suporte por sua plataforma.
Remarks
O seguinte mostra como determinar quanto tempo o dispositivo tem idled, quebra automática exemplo de código um chamar para GetIdleTime Com as chamadas para GetTickCount.
dwStartTick = GetTickCount();
dwIdleSt = GetIdleTime();
// You must insert a call to the Sleep(sleep_time) function to allow
// idle time to accrue. An example of an appropriate sleep time is
// 1000 ms.
dwStopTick = GetTickCount();
dwIdleEd = GetIdleTime();
PercentIdle = ((100*(dwIdleEd - dwIdleSt)) / (dwStopTick - dwStartTick));
Requirements
Header | winbase.h |
Library | coredll.lib |
Windows Embedded CE | Windows CE 3.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
See Also
Reference
Time Functions
GetTickCount
Sleep