if (EINA_UNLIKELY(clock_gettime(_ecore_time_clock_id, &t)))
{
CRI("Cannot get current time");
- // Try to at least return the latest value retrieved
- return ecore_loop_time_get();
+ return 0.0;
}
return (double)t.tv_sec + (((double)t.tv_nsec) / 1000000000.0);
EOLIAN static Eo *
_efl_loop_timer_efl_object_finalize(Eo *obj, Efl_Loop_Timer_Data *pd)
{
- if (pd->at < ecore_loop_time_get()) pd->at = ecore_time_get() + pd->in;
- else pd->at += pd->in;
-
pd->loop = efl_provider_find(obj, EFL_LOOP_CLASS);
pd->loop_data = efl_data_scope_get(pd->loop, EFL_LOOP_CLASS);
+ if (pd->at < efl_loop_time_get(pd->loop))
+ pd->at = ecore_time_get() + pd->in;
+ else pd->at += pd->in;
+
if (pd->in < 0.0)
{
ERR("You need to specify the interval of a timer to create a valid timer.");
// Do not reset the current timer while inside the callback
if (timer->loop_data->timer_current == timer) return;
- now = ecore_loop_time_get();
+ now = efl_loop_time_get(timer->loop);
if (!timer->initialized)
{
timer->at = now;
if (!object) return -1;
first = _efl_loop_timer_after_get(efl_data_scope_get(object, MY_CLASS));
- now = ecore_loop_time_get();
+ now = efl_loop_time_get(obj);
in = first->at - now;
if (in < 0) in = 0;
return in;