Usage:
At some point, start a timer:
Code: Select all
Diary.start("Main Loop")
Code: Select all
Diary.stop("Main Loop")
Code: Select all
Diary.stop("Draw call", "Main Loop") -- this timer is a child of the Main Loop timer
Code: Select all
Diary.autoAttach("Name of default timer")
Code: Select all
Diary.autoAttach()
Get the status of the diary with
Code: Select all
Diary.toStr()
Code: Select all
love.graphics.print(Diary.toStr(), x,y)
Code: Select all
print(Diary.toStr())
Code: Select all
[+] Main Loop: 49.8 ms
| [+] Update: 51.08 ms
| | [+] Reticulating Splines: 51.08 ms
| | | Subtask a: 33.07 ms
| | | Subtask b: 17.99 ms
| [+] Draw: 6.98 ms
| | Printing Text: 1.27 ms
| | Lubricating freewheel unit: 5.69 ms
A top-level entry: 5.99 ms
Please try it out and tell me how it can be made better! Try to break it!