# Perfgraph for PICO-8

This is a super simple way to get a performance graph into your PICO-8 carts.

![See it in action!](demo1.gif)

1. `#include perfgraph.p8:1`.
2. Use `p_start(name)` and `p_end(name)` around the code you need to measure.
3. Call `p_show(x,y,width)` to show a graph! (The frame times will reset after you call this.)

Full example:

```lua

#include perfgraph.p8:1

::l::

p_start("frame")
p_start("complicated 1")
for i=0,100 do
	circfill(rnd()*128,rnd()*128,rnd()*100,rnd()*16)
end
p_end("complicated 1")

p_start("complicated 2")
for i=0,100 do
	circ(rnd()*128,rnd()*128,rnd()*100,rnd()*16)
end
p_end("complicated 2")
p_end("frame")

p_show(1,1,32)

flip()

goto l

```

Have fun!
