]> git.bts.cx Git - p8-perfgraph.git/blob - README.md
Initial Commit
[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.lua`.
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.lua
16
17 ::l::
18
19 p_start("complicated 1")
20 for i=0,100 do
21         circfill(rnd()*128,rnd()*128,rnd()*100,rnd()*16)
22 end
23 p_end("complicated 1")
24
25 p_start("complicated 2")
26 for i=0,100 do
27         circ(rnd()*128,rnd()*128,rnd()*100,rnd()*16)
28 end
29 p_end("complicated 2")
30
31 p_show(1,1,32)
32
33 flip()
34
35 ```
36
37 Have fun. You can find a demo in perfgraphdemo.p8 in this repo. If you like this then feel free to follow me on Twitter: [@btsherratt](http://twitter.com/btsherratt/).