timer.h
资源名称:h264src.zip [点击查看]
上传用户:sunbaby
上传日期:2013-05-31
资源大小:242k
文件大小:1k
源码类别:
mpeg/mp3
开发平台:
Visual C++
- #ifndef _TIMER_H_
- #define _TIMER_H_
- #include "portab.h"
- typedef struct
- {
- int64_t all;
- int64_t start;
- int64_t overhead;
- } timer_st;
- #ifdef ENABLE_PROFILE
- static __inline void
- start_timer(timer_st* t)
- {
- t->start = read_counter();
- }
- static __inline void
- stop_timer_all(timer_st* t)
- {
- t->all += read_counter() - t->start - t->overhead;
- }
- static __inline void
- init_timer(timer_st* t)
- {
- memset(t, 0, sizeof(*t));
- start_timer(t);
- t->overhead = read_counter() - t->start;
- }
- #else // ENABLE_PROFILE
- static __inline void
- start_timer(timer_st* t)
- {
- }
- static __inline void
- stop_timer_all(timer_st* t)
- {
- }
- static __inline void
- init_timer(timer_st* t)
- {
- }
- #endif
- #endif