Time tools
[base utilsutils]

System time and CPU functions. More...

Classes

struct  GF_SystemRTInfo
 run-time system info object More...

Enumerations

enum  { GF_RTI_ALL_PROCESSES_TIMES = 1, GF_RTI_PROCESS_MEMORY = 1<<1, GF_RTI_SYSTEM_MEMORY_ONLY = 1<<2 }

Functions

void gf_sys_init ()
 System setup.
void gf_sys_close ()
 System closing.
u32 gf_sys_clock ()
 System clock query.
void gf_sleep (u32 ms)
 Sleeps thread/process.
Bool gf_sys_get_rti (u32 refresh_time_ms, GF_SystemRTInfo *rti, u32 flags)
 Gets Run-Time info.
Bool gf_sys_get_battery_state (Bool *onBattery, u32 *state, u32 *level)

Detailed Description

This section documents time functionalities and CPU management in GPAC.

Enumeration Type Documentation

anonymous enum

Selection flags for run-time info retrieval

Enumerator:
GF_RTI_ALL_PROCESSES_TIMES  Indicates all processes' times must be fetched. If not set, only the current process times will be retrieved, and the thread count and total times won't be available
GF_RTI_PROCESS_MEMORY  Indicates the process allocated heap size must be fetch. If not set, only the system physical memory is fetched. Fetching the entire ocess allocated memory can have a large impact on performances
GF_RTI_SYSTEM_MEMORY_ONLY  Indicates that only system memory should be fetched. When set, all refreshing info is ignored


Function Documentation

void gf_sys_init (  ) 

Inits the system high-resolution clock if any, and CPU usage manager. It is strongly recommended to call this function before calling any other GPAC functions, since on some systems (like winCE) it may result in a better memory usage estimation.

Note:
This can be called several times but only the first call will result in system setup.

void gf_sys_close (  ) 

Closes the system high-resolution clock and any CPU associated ressources.

Note:
This can be called several times but the system will be closed when no more users are counted.

u32 gf_sys_clock (  ) 

Gets the system clock time.

Returns:
System clock value since initialization in milliseconds.

void gf_sleep ( u32  ms  ) 

Locks calling thread/process execution for a given time.

Parameters:
ms Amount of time to sleep in milliseconds.

Bool gf_sys_get_rti ( u32  refresh_time_ms,
GF_SystemRTInfo rti,
u32  flags 
)

Gets CPU and memory usage info for the calling process and the system. Information gathering is controled through timeout values.

Parameters:
refresh_time_ms refresh time period in milliseconds. If the last sampling was done less than this period ago, the run-time info is not refreshed.
rti holder to the run-time info structure to update.
flags specify which info is to be retrieved.
Returns:
1 if info has been updated, 0 otherwise.
Note:
You should not try to use a too small refresh time. Typical values are 500 ms or one second.


Generated on Sun Nov 2 11:51:45 2008 for libgpac by  doxygen 1.5.5