Added AsyncTasks timings

This commit is contained in:
Shoghi Cervantes
2015-04-24 17:21:39 +02:00
parent 529f9b148b
commit d4cae729c3
3 changed files with 20 additions and 8 deletions

View File

@ -21,6 +21,7 @@
namespace pocketmine\scheduler;
use pocketmine\event\Timings;
use pocketmine\Server;
class AsyncPool{
@ -113,6 +114,8 @@ class AsyncPool{
unset($this->taskWorkers[$task->getTaskId()]);
$task->cleanObject();
unset($task);
}
public function removeTasks(){
@ -129,6 +132,8 @@ class AsyncPool{
}
public function collectTasks(){
Timings::$schedulerAsyncTimer->startTiming();
foreach($this->tasks as $task){
if($task->isGarbage()){
@ -142,5 +147,7 @@ class AsyncPool{
$this->server->getLogger()->critical("On ".$info["scope"].", line ".$info["line"] .", ".$info["function"]."()");
}
}
Timings::$schedulerAsyncTimer->stopTiming();
}
}