Implemented the function to set timeout of each process.