implementing real time simulation, need to deal with millisec sleep