summaryrefslogtreecommitdiff
path: root/libavutil/random.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-07-27 20:53:30 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-07-27 20:53:30 +0000
commit51be0eb4828154ba9509fe070460b9dd258b3645 (patch)
tree1d327c9c1aa8550b122f915ac1d1807ee8021280 /libavutil/random.c
parentb6ff078b7bbb0700e95751c3877af8887173f237 (diff)
Change benchmarking code so it returns comparable values.
Originally committed as revision 14434 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/random.c')
-rw-r--r--libavutil/random.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libavutil/random.c b/libavutil/random.c
index 251eb1f270..2f73c19755 100644
--- a/libavutil/random.c
+++ b/libavutil/random.c
@@ -87,15 +87,12 @@ void main(void)
AVRandomState state;
av_init_random(0xdeadbeef, &state);
- for (j = 0; j < 100; j++) {
- START_TIMER;
- x+= av_random(&state);
- STOP_TIMER("first call to av_random");
- for (i = 1; i < AV_RANDOM_N; i++) {
- START_TIMER;
+ for (j = 0; j < 10000; j++) {
+ START_TIMER
+ for (i = 0; i < 624; i++) {
x+= av_random(&state);
- STOP_TIMER("AV_RANDOM_N calls of av_random");
}
+ STOP_TIMER("624 calls of av_random");
}
av_log(NULL, AV_LOG_ERROR, "final value:%X\n", x);
}