How to modify the below code that the motor works (Turns on) for tamount of time

The problem compiling on Windows XP with some versions of the IDE is a known one. Did you try Googling for it ?

If you want to stop some, maybe all, of the messages being printed then delete those lines of code or put // in front of them, but until you fix the problem with using Windows XP I cannot help any further.