Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
dff4af44
Commit
dff4af44
authored
Jan 03, 2012
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timer: K&R formatting cosmetics
parent
f9b9dd87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
20 deletions
+24
-20
timer.h
libavutil/timer.h
+24
-20
No files found.
libavutil/timer.h
View file @
dff4af44
...
...
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <stdint.h>
#include "config.h"
#if ARCH_ARM
...
...
@@ -45,29 +46,32 @@
#endif
#ifdef AV_READ_TIME
#define START_TIMER \
uint64_t tend;
\
uint64_t tstart= AV_READ_TIME();
\
#define START_TIMER
\
uint64_t tend;
\
uint64_t tstart = AV_READ_TIME();
\
#define STOP_TIMER(id) \
tend= AV_READ_TIME();\
{\
static uint64_t tsum=0;\
static int tcount=0;\
static int tskip_count=0;\
if(tcount<2 || tend - tstart < 8*tsum/tcount || tend - tstart < 2000){\
tsum+= tend - tstart;\
tcount++;\
}else\
tskip_count++;\
if(((tcount+tskip_count)&(tcount+tskip_count-1))==0){\
av_log(NULL, AV_LOG_ERROR, "%"PRIu64" decicycles in %s, %d runs, %d skips\n",\
tsum*10/tcount, id, tcount, tskip_count);\
}\
}
#define STOP_TIMER(id) \
tend = AV_READ_TIME(); \
{ \
static uint64_t tsum = 0; \
static int tcount = 0; \
static int tskip_count = 0; \
if (tcount < 2 || \
tend - tstart < 8 * tsum / tcount || \
tend - tstart < 2000) { \
tsum+= tend - tstart; \
tcount++; \
} else \
tskip_count++; \
if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \
av_log(NULL, AV_LOG_ERROR, \
"%"PRIu64" decicycles in %s, %d runs, %d skips\n", \
tsum * 10 / tcount, id, tcount, tskip_count); \
} \
}
#else
#define START_TIMER
#define STOP_TIMER(id) {}
#define STOP_TIMER(id) {
}
#endif
#endif
/* AVUTIL_TIMER_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment