Improve PSO performance and add interface to determine time