1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/apps/plugins/bench_scaler.c b/apps/plugins/bench_scaler.c
index 723e427..bba44d5 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 + 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_AFTER(t2, t_end) || count < 10);
             t2 -= t1;
             t2 *= 10;
             t2 += count >> 1;