/* ////////////////////////////////////////////////////////////////////////////////////// * implementation */ static __tb_inline__ tb_hong_t tb_timer_now(tb_timer_impl_t* impl) { // using the real time? if (!impl->ctime) { // get the time tb_timeval_t tv = {0}; if (tb_gettimeofday(&tv, tb_null)) return ((tb_hong_t)tv.tv_sec * 1000 + tv.tv_usec / 1000); } // using cached time return tb_cache_time_mclock(); }
tb_time_t tb_time() { // time tb_timeval_t tv = {0}; return tb_gettimeofday(&tv, tb_null)? tv.tv_sec : (tb_time_t)-1; }