]> git.bts.cx Git - p8-perfgraph.git/blob - README.md
Changed to a cart
[p8-perfgraph.git] / README.md
1 # Perfgraph for PICO-8
2
3 This is a super simple way to get a performance graph into your PICO-8 carts.
4
5 ![See it in action!](demo1.gif)
6
7 1. `#include perfgraph.p8:1`.
8 2. Use `p_start(name)` and `p_end(name)` around the code you need to measure.
9 3. Call `p_show(x,y,width)` to show a graph! (The frame times will reset after you call this.)
10
11 Full example:
12
13 ```lua
14
15 #include perfgraph.p8:1
16
17 ::l::
18
19 p_start("frame")
20 p_start("complicated 1")
21 for i=0,100 do
22         circfill(rnd()*128,rnd()*128,rnd()*100,rnd()*16)
23 end
24 p_end("complicated 1")
25
26 p_start("complicated 2")
27 for i=0,100 do
28         circ(rnd()*128,rnd()*128,rnd()*100,rnd()*16)
29 end
30 p_end("complicated 2")
31 p_end("frame")
32
33 p_show(1,1,32)
34
35 flip()
36
37 goto l
38
39 ```
40
41 Have fun!