Tracy debugger panel for measuring runtime of code snippets
Registering panel into Tracy bar can be done simply by calling prepared static method:
// Register panel to global Tracy instance...
$tracyPanel = Bilbofox\TimerPanel\TimerPanel::register();
// ...
// ...
// Retrieve instance of panel back
$tracyPanel = Bilbofox\TimerPanel\TimerPanel::instance();
// ...
$tracyPanel->start();
// heavy lifting...
$tracyPanel->stop();
Timer panel instance has methods for public usage - starting / stopping timerc etc. Each such method also has global function shortcut:
method | shortcut | description |
---|---|---|
TimerPanel::start() |
startTimer() |
Starts timer in default mode |
TimerPanel::startSum() |
startTimerSum() |
Starts timer in sum mode |
TimerPanel::startStack() |
startTimerStack() |
|
TimerPanel::getLastStarted() |
getLastStartedTimer() |
|
TimerPanel::stop() |
stopTimer() |
|
TimerPanel::stopAll() |
stopAllTimers() |
For the purpose of examples in next sections - global shortcuts will be used.
startTimer();
stopTimer();
For basic usage we simply call
modes TODO...