Optimize thread switch with priority
Add statistics of simulation time