Mercurial > libavutil.hg
comparison random.c @ 529:98f03aca378b libavutil
Change benchmarking code so it returns comparable values.
author | michael |
---|---|
date | Sun, 27 Jul 2008 20:53:30 +0000 |
parents | a5c3bc3dcd3e |
children | f8a5cb24c164 |
comparison
equal
deleted
inserted
replaced
528:a5c3bc3dcd3e | 529:98f03aca378b |
---|---|
85 int x=0; | 85 int x=0; |
86 int i, j; | 86 int i, j; |
87 AVRandomState state; | 87 AVRandomState state; |
88 | 88 |
89 av_init_random(0xdeadbeef, &state); | 89 av_init_random(0xdeadbeef, &state); |
90 for (j = 0; j < 100; j++) { | 90 for (j = 0; j < 10000; j++) { |
91 START_TIMER; | 91 START_TIMER |
92 x+= av_random(&state); | 92 for (i = 0; i < 624; i++) { |
93 STOP_TIMER("first call to av_random"); | |
94 for (i = 1; i < AV_RANDOM_N; i++) { | |
95 START_TIMER; | |
96 x+= av_random(&state); | 93 x+= av_random(&state); |
97 STOP_TIMER("AV_RANDOM_N calls of av_random"); | |
98 } | 94 } |
95 STOP_TIMER("624 calls of av_random"); | |
99 } | 96 } |
100 av_log(NULL, AV_LOG_ERROR, "final value:%X\n", x); | 97 av_log(NULL, AV_LOG_ERROR, "final value:%X\n", x); |
101 } | 98 } |
102 #endif | 99 #endif |