From e631d1fb28f25ff05522263c44fa9c347cd63883 Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Mon, 18 May 2009 20:21:03 +0000 Subject: 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 --- apps/plugins/bench_mem_jpeg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apps/plugins/bench_mem_jpeg.c') 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) &format_null); if (ret == 1) { - long t1, t2; + long t1, t2, t_end; int count = 0; t2 = *(rb->current_tick); while (t2 != (t1 = *(rb->current_tick))); + t_end = t1 + 10 * HZ; do { decode_jpeg_mem(jpeg_buf, filesize, &bm, plugin_buf_len, FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT, &format_null); count++; t2 = *(rb->current_tick); - } while (t2 - t1 < HZ || count < 10); + } while (TIME_BEFORE(t2, t_end) || count < 10); t2 -= t1; t2 *= 10; t2 += count >> 1; -- cgit v1.2.3