System time and CPU functions.
More...
Detailed Description
This section documents time functionalities and CPU management in GPAC.
Enumeration Type Documentation
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
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.
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.
Gets the system clock time.
- Returns:
- System clock value since initialization in milliseconds.
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.