summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/CATEGORIES1
-rw-r--r--apps/plugins/bench_mem_jpeg.c5
-rw-r--r--apps/plugins/bench_scaler.c5
3 files changed, 7 insertions, 4 deletions
diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES
index bf49c8afca..c7cdd3fe53 100644
--- a/apps/plugins/CATEGORIES
+++ b/apps/plugins/CATEGORIES
@@ -1,6 +1,7 @@
alpine_cdc,apps
autostart,apps
battery_bench,apps
+bench_scaler,apps
blackjack,games
bounce,demos
brickmania,games
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;
diff --git a/apps/plugins/bench_scaler.c b/apps/plugins/bench_scaler.c
index 723e427aa7..c24807dad6 100644
--- a/apps/plugins/bench_scaler.c
+++ b/apps/plugins/bench_scaler.c
@@ -109,17 +109,18 @@ enum plugin_status plugin_start(const void* parameter)
if (in == out)
continue;
lcd_printf("timing %dx%d->%dx>%d scale", in, in, out, out);
- long t1, t2;
+ long t1, t2, t_end;
int count = 0;
t2 = *(rb->current_tick);
in_dim.width = in_dim.height = in;
bm.width = bm.height = rset.rowstop = out;
while (t2 != (t1 = *(rb->current_tick)));
+ t_end = t1 + 10 * HZ;
do {
resize_on_load(&bm, false, &in_dim, &rset, (unsigned char *)plugin_buf, plugin_buf_len, &format_null, IF_PIX_FMT(0,) store_part_null, 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;