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

Compiles OK for me.

Win 10
IDE 1.8.5
Arduino Nano or Uno

Can you compile and upload other programs ?