Stepper Overheating

the code i am using is:

So why do you think code will cause overheating?

What driver are you using? What current have you set it to? What motor do you have?
The slower the motor turns the hotter it will get. When stopped it gets hottest.