changeset 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
files random.c
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/random.c	Sun Jul 27 20:50:24 2008 +0000
+++ b/random.c	Sun Jul 27 20:53:30 2008 +0000
@@ -87,15 +87,12 @@
     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);
 }