C++ simulation time slice rotation method for CPU scheduling