Ecore Time Functions
Functions that deal with time. More...
Functions | |
EAPI double | ecore_time_get (void) |
Retrieves the current system time as a floating point value in seconds. | |
EAPI double | ecore_loop_time_get (void) |
Retrieves the time at which the last loop stopped waiting for timeouts or events. | |
EAPI Ecore_Timer * | ecore_timer_add (double in, Eina_Bool(*func)(void *data), const void *data) |
Creates a timer to call the given function in the given period of time. | |
EAPI Ecore_Timer * | ecore_timer_loop_add (double in, Eina_Bool(*func)(void *data), const void *data) |
Creates a timer to call the given function in the given period of time. | |
EAPI void * | ecore_timer_del (Ecore_Timer *timer) |
Delete the specified timer from the timer list. | |
EAPI void | ecore_timer_interval_set (Ecore_Timer *timer, double in) |
Change the interval the timer ticks of. | |
EAPI double | ecore_timer_interval_get (Ecore_Timer *timer) |
Get the interval the timer ticks on. | |
EAPI void | ecore_timer_delay (Ecore_Timer *timer, double add) |
Add some delay for the next occurence of a timer. | |
EAPI double | ecore_timer_pending_get (Ecore_Timer *timer) |
Get the pending time regarding a timer. |
Detailed Description
Functions that deal with time.
These functions include those that simply retrieve it in a given format, and those that create events based on it.
Function Documentation
EAPI double ecore_loop_time_get | ( | void | ) |
Retrieves the time at which the last loop stopped waiting for timeouts or events.
This gets the time (since Jan 1st, 1970, 12:00AM) that the main loop ceased waiting for timouts and/or events to come in or for signals or any other interrupt source. This should be considered a reference point for all time based activity that should calculate its timepoint from the return of ecore_loop_time_get(). use this UNLESS you absolutely must get the current actual timepoint - then use ecore_time_get(). If this is called before any loop has ever been run, then it will call ecore_time_get() for you the first time and thus have an initial time reference.
- Returns:
- The number of seconds since 12.00AM 1st January 1970.
Referenced by ecore_animator_add(), and ecore_timer_loop_add().
EAPI double ecore_time_get | ( | void | ) |
Retrieves the current system time as a floating point value in seconds.
Also see ecore_loop_time_get().
- Returns:
- The number of seconds since 12.00AM 1st January 1970.
Referenced by ecore_init(), ecore_timer_add(), and ecore_timer_pending_get().
EAPI Ecore_Timer* ecore_timer_add | ( | double | in, |
Eina_Bool(*)(void *data) | func, | ||
const void * | data | ||
) |
Creates a timer to call the given function in the given period of time.
- Parameters:
-
in The interval in seconds. func The given function. If func
returns 1, the timer is rescheduled for the next intervalin
.data Data to pass to func
when it is called.
- Returns:
- A timer object on success.
NULL
on failure.
This function adds a timer and returns its handle on success and NULL on failure. The function func
will be called every in
seconds. The function will be passed the data
pointer as its parameter.
When the timer func
is called, it must return a value of either 1 (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL). If it returns 1, it will be called again at the next tick, or if it returns 0 it will be deleted automatically making any references/handles for it invalid.
References ecore_time_get().
Referenced by ecore_animator_frametime_set(), ecore_con_url_init(), and ecore_exe_kill().
EAPI void* ecore_timer_del | ( | Ecore_Timer * | timer | ) |
Delete the specified timer from the timer list.
- Parameters:
-
timer The timer to delete.
- Returns:
- The data pointer set for the timer when ecore_timer_add was called.
NULL
is returned if the function is unsuccessful.
Note: timer
must be a valid handle. If the timer function has already returned 0, the handle is no longer valid (and does not need to be delete).
Referenced by ecore_animator_frametime_set(), ecore_con_url_shutdown(), ecore_exe_free(), and ecore_exe_kill().
EAPI void ecore_timer_delay | ( | Ecore_Timer * | timer, |
double | add | ||
) |
Add some delay for the next occurence of a timer.
This doesn't affect the interval of a timer.
- Parameters:
-
timer The timer to change. add The dalay to add to the next iteration.
Referenced by ecore_animator_add().
EAPI double ecore_timer_interval_get | ( | Ecore_Timer * | timer | ) |
Get the interval the timer ticks on.
- Parameters:
-
timer The timer to retrieve the interval from
- Returns:
- The interval on success. -1 on failure.
EAPI void ecore_timer_interval_set | ( | Ecore_Timer * | timer, |
double | in | ||
) |
Change the interval the timer ticks of.
If set during a timer call, this will affect the next interval.
- Parameters:
-
timer The timer to change. in The interval in seconds.
EAPI Ecore_Timer* ecore_timer_loop_add | ( | double | in, |
Eina_Bool(*)(void *data) | func, | ||
const void * | data | ||
) |
Creates a timer to call the given function in the given period of time.
- Parameters:
-
in The interval in seconds from current loop time. func The given function. If func
returns 1, the timer is rescheduled for the next intervalin
.data Data to pass to func
when it is called.
- Returns:
- A timer object on success.
NULL
on failure.
This is the same as ecore_timer_add(), but "now" is the time from ecore_loop_time_get() not ecore_time_get() as ecore_timer_add() uses. See ecore_timer_add() for more details.
References ecore_loop_time_get().
Referenced by ecore_animator_add().
EAPI double ecore_timer_pending_get | ( | Ecore_Timer * | timer | ) |
Get the pending time regarding a timer.
- Parameters:
-
timer The timer to learn from.
References ecore_time_get().