summaryrefslogtreecommitdiff
path: root/apps/plugins/bench_mem_jpeg.c
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2009-05-18 20:21:03 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2009-05-18 20:21:03 +0000
commite631d1fb28f25ff05522263c44fa9c347cd63883 (patch)
treef96efae3b2561b10712fc8bbb934e8ec4416b0ec /apps/plugins/bench_mem_jpeg.c
parentc8d6a02c5a792f7c5d634dac8a99a82c6b4c3ad5 (diff)
downloadrockbox-e631d1fb28f25ff05522263c44fa9c347cd63883.tar.gz
rockbox-e631d1fb28f25ff05522263c44fa9c347cd63883.zip
Use TIME_BEFORE in bench_* plugins, and use 10s test duration.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20983 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/bench_mem_jpeg.c')
-rw-r--r--apps/plugins/bench_mem_jpeg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugins/bench_mem_jpeg.c b/apps/plugins/bench_mem_jpeg.c
index cd7dea356e..5169286fe3 100644
--- a/apps/plugins/bench_mem_jpeg.c
+++ b/apps/plugins/bench_mem_jpeg.c
@@ -119,17 +119,18 @@ enum plugin_status plugin_start(const void* parameter)
119 &format_null); 119 &format_null);
120 if (ret == 1) 120 if (ret == 1)
121 { 121 {
122 long t1, t2; 122 long t1, t2, t_end;
123 int count = 0; 123 int count = 0;
124 t2 = *(rb->current_tick); 124 t2 = *(rb->current_tick);
125 while (t2 != (t1 = *(rb->current_tick))); 125 while (t2 != (t1 = *(rb->current_tick)));
126 t_end = t1 + 10 * HZ;
126 do { 127 do {
127 decode_jpeg_mem(jpeg_buf, filesize, &bm, plugin_buf_len, 128 decode_jpeg_mem(jpeg_buf, filesize, &bm, plugin_buf_len,
128 FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT, 129 FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT,
129 &format_null); 130 &format_null);
130 count++; 131 count++;
131 t2 = *(rb->current_tick); 132 t2 = *(rb->current_tick);
132 } while (t2 - t1 < HZ || count < 10); 133 } while (TIME_BEFORE(t2, t_end) || count < 10);
133 t2 -= t1; 134 t2 -= t1;
134 t2 *= 10; 135 t2 *= 10;
135 t2 += count >> 1; 136 t2 += count >> 1;