We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e275da commit 33e31e7Copy full SHA for 33e31e7
benchmark.py
@@ -0,0 +1,39 @@
1
+import pyb
2
+
3
+import display
4
+from display.ssd1322 import SSD1322
5
6
7
+def send_buffer(disp, n=1000):
8
+ disp.framebuf.fill(0)
9
+ start = pyb.millis()
10
11
+ for i in range(n):
12
+ disp.send_buffer()
13
14
+ return pyb.elapsed_millis(start)
15
16
17
+def text_screen(disp, n=1000):
18
19
20
21
22
23
24
+ for y in range(64 // 8):
25
+ disp.framebuf.text('BENCHMARK', 0, y*8, 0xF)
26
27
28
29
30
31
32
+def run_display_benchmark(disp=None):
33
+ disp = display.create_spi_display(SSD1322, 256, 64)
34
35
+ t1 = send_buffer(disp)
36
+ t2 = text_screen(disp)
37
38
+ print(t1, t2)
39
0 commit comments