X-Git-Url: https://git.bts.cx/p8-perfgraph.git/blobdiff_plain/f0474005338b4400393bdacf8198e77515f2252d..646258f4d35b09e0797cba7fc2a82f05dbf9b8e6:/README.md?ds=inline diff --git a/README.md b/README.md index c978e30..98c305f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ 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.lua`. +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.) @@ -12,10 +12,11 @@ Full example: ```lua -#include perfgraph.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) @@ -27,11 +28,14 @@ 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. 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/). +Have fun!