static void recalc_tmo(unsigned long tmo, struct timeval *t0, struct timeval *t) { unsigned long dt; dt = elapsed_msec(t0); dt = (dt < tmo) ? tmo - dt : 0; (void)msec_to_timeval(dt, t); }
static void mini_control_background_action_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { minicontrol *mc = data; struct timeval t; gettimeofday(&t, 0); if (elapsed_msec(mc->button_last_event, t) <= 5) return; interface *p_intf = application_get_interface(mc->p_app); intf_raise(p_intf); playback_service_set_auto_exit(mc->p_ps, false); }
PJ_DEF(pj_time_val) pj_elapsed_time( const pj_timestamp *start, const pj_timestamp *stop ) { pj_highprec_t elapsed = elapsed_msec(start, stop); pj_time_val tv_elapsed; if (PJ_HIGHPREC_VALUE_IS_ZERO(elapsed)) { tv_elapsed.sec = tv_elapsed.msec = 0; return tv_elapsed; } else { pj_highprec_t sec, msec; sec = elapsed; pj_highprec_div(sec, MSEC); tv_elapsed.sec = (long)sec; msec = elapsed; pj_highprec_mod(msec, MSEC); tv_elapsed.msec = (long)msec; return tv_elapsed; } }
PJ_DEF(pj_uint64_t) pj_elapsed_msec64(const pj_timestamp *start, const pj_timestamp *stop ) { return (pj_uint64_t)elapsed_msec(start, stop); }