Ecore Throttle functions

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files
- Examples

Functions
Ecore Throttle functions
Ecore » Ecore main loop

## Functions
void | ecore_throttle_adjust (double amount)
| Increase throttle amount. More...
double | ecore_throttle_get (void)
| Get current throttle level. More...

## Detailed Description

## Function Documentation

void ecore_throttle_adjust | ( | double | amount | ) |

Increase throttle amount.

This will increase or decrease (if `amount` is positive or negative) the amount of "voluntary throttling" ecore will do to its main loop while running. This is intended to be used to limit animations and wakeups when in a strict power management state. The higher the current throttle value (which can be retrieved by ecore_throttle_get() ), the more throttling takes place. If the current throttle value is 0, then no throttling takes place at all.

The value represents how long the ecore main loop will sleep (in seconds) before it goes into a fully idle state waiting for events, input or timing events to wake it up. For example, if the current throttle level is 0.5, then after every time the main loop cycles and goes into idle after processing all events, the main loop will explicitly sleep for 0.5 seconds before sitting and waiting for incoming events or timeouts, thus preventing animation, async IO and network handling etc. for that period of time. Of course these events, data and timeouts will be buffered, thus not losing anything, simply delaying when they get handled by the throttle value.

Example:

1 void enter_powersave(void) {
2 ecore_throttle_adjust(0.2);
3 printf("Now at throttle level: %1.3f\n", ecore_throttle_get());
4 }
5
6 void enter_deep_powersave(void) {
7 ecore_throttle_adjust(0.5);
8 printf("Now at throttle level: %1.3f\n", ecore_throttle_get());
9 }
10
11 void exit_powersave(void) {
12 ecore_throttle_adjust(-0.2);
13 printf("Now at throttle level: %1.3f\n", ecore_throttle_get());
14 }
15
16 void exit_deep_powersave(void) {
17 ecore_throttle_adjust(-0.5);
18 printf("Now at throttle level: %1.3f\n", ecore_throttle_get());
19 }

Parameters

  amount | Amount (in seconds) to adjust by

References EINA_MAIN_LOOP_CHECK_RETURN.

double ecore_throttle_get | ( | void |  | ) |

Get current throttle level.

This gets the current throttling level, which can be adjusted by ecore_throttle_adjust(). The value is in seconds. Please see ecore_throttle_adjust() for more information.

Returns
  The current throttle level

References eina_evlog(), and EINA_MAIN_LOOP_CHECK_RETURN_VAL.