@phpstan-type CollectPromise Promise<list<string>>
Definition at line 51 of file TimingsHandler.php.
◆ __construct()
| pocketmine\timings\TimingsHandler::__construct |
( |
private string | $name, |
|
|
private ?TimingsHandler | $parent = null, |
|
|
private string | $group = Timings::GROUP_MINECRAFT ) |
◆ createReportFile()
| static pocketmine\timings\TimingsHandler::createReportFile |
( |
string | $directory, |
|
|
?string | $fileName = null ) |
|
static |
Creates a timings report file locally in the provided file path. Collects timings data and returns a promise that resolves with the created file.
- Parameters
-
| string | $directory | directory path to the timings folder. |
| string | null | $fileName | Optional custom file name, If null, uses default timings file naming |
@phpstan-return Promise<string>
Definition at line 355 of file TimingsHandler.php.
◆ getCollectCallbacks()
| static pocketmine\timings\TimingsHandler::getCollectCallbacks |
( |
| ) |
|
|
static |
@phpstan-return ObjectSet<\Closure() : list<CollectPromise>>
Definition at line 88 of file TimingsHandler.php.
◆ getGroup()
| pocketmine\timings\TimingsHandler::getGroup |
( |
| ) |
|
◆ getName()
| pocketmine\timings\TimingsHandler::getName |
( |
| ) |
|
◆ getReloadCallbacks()
| static pocketmine\timings\TimingsHandler::getReloadCallbacks |
( |
| ) |
|
|
static |
◆ getStartTime()
| static pocketmine\timings\TimingsHandler::getStartTime |
( |
| ) |
|
|
static |
◆ getToggleCallbacks()
| static pocketmine\timings\TimingsHandler::getToggleCallbacks |
( |
| ) |
|
|
static |
@phpstan-return ObjectSet<\Closure(bool $enable) : void>
Definition at line 78 of file TimingsHandler.php.
◆ isEnabled()
| static pocketmine\timings\TimingsHandler::isEnabled |
( |
| ) |
|
|
static |
◆ printCurrentThreadRecords()
| static pocketmine\timings\TimingsHandler::printCurrentThreadRecords |
( |
| ) |
|
|
static |
◆ printTimings()
| static pocketmine\timings\TimingsHandler::printTimings |
( |
| ) |
|
|
static |
- Deprecated
- This only collects timings from the main thread. Collecting timings from all threads is an async operation, so it can't be done synchronously.
- Returns
- string[]
Definition at line 158 of file TimingsHandler.php.
◆ reload()
| static pocketmine\timings\TimingsHandler::reload |
( |
| ) |
|
|
static |
◆ requestPrintTimings()
| static pocketmine\timings\TimingsHandler::requestPrintTimings |
( |
| ) |
|
|
static |
Collects timings asynchronously, allowing timings from multiple threads to be aggregated into a single report.
NOTE: You need to add a callback to collectCallbacks if you want to include timings from other threads. They won't be automatically collected if you don't, since the main thread has no way to access them.
This is an asynchronous operation, and the result is returned as a promise. The caller must add a callback to the returned promise to get the complete timings report.
@phpstan-return Promise<list<string>>
Definition at line 176 of file TimingsHandler.php.
◆ reset()
| pocketmine\timings\TimingsHandler::reset |
( |
| ) |
|
◆ setEnabled()
| static pocketmine\timings\TimingsHandler::setEnabled |
( |
bool | $enable = true | ) |
|
|
static |
◆ startTiming()
| pocketmine\timings\TimingsHandler::startTiming |
( |
| ) |
|
◆ stopTiming()
| pocketmine\timings\TimingsHandler::stopTiming |
( |
| ) |
|
◆ tick()
| static pocketmine\timings\TimingsHandler::tick |
( |
bool | $measure = true | ) |
|
|
static |
◆ time()
| pocketmine\timings\TimingsHandler::time |
( |
\Closure | $closure | ) |
|
- Returns
- mixed the result of the given closure
@phpstan-template TClosureReturn @phpstan-param \Closure() : TClosureReturn $closure @phpstan-return TClosureReturn
Definition at line 328 of file TimingsHandler.php.
The documentation for this class was generated from the following file: