stepper motor confusion

i am using a stepper motor with a a4988 driver chip .
i did read the datasheet and the motor is supposed to advance one step with every low to high shift on the step pin , now that works but the behavior of the motor changes when i change the pulse length .
i can't understand why .

which means that

digitalWrite(pin,1); delay(1); digitalWrite(pin,0); delay(1);
and
digitalWrite(pin,1); delay(1); digitalWrite(pin,0); delay(10);
and
digitalWrite(pin,1); delay(10); digitalWrite(pin,0); delay(10);

looped 100 times give an unequal number of steps , what's even more confusing is that the first one gives 100 steps which is correct ,the second and the third give alot less than 100 (variable around 60 to 70)

no matter how much i read on the internet , i can't explain this

anyone ?

this is the simple code i am using to test the matter
(it's driving me mad !)

void setup() {
 pinMode(7,1);
 pinMode(6,1);
 digitalWrite(6,0);
 digitalWrite(7,1);
 pinMode(3,1);
 pinMode(2,1);
 digitalWrite(2,1);
 digitalWrite(3,0);
}
int x=0;
void loop() {
delay(5000);
for(int i=0;i<800;i++) {digitalWrite(3,1); delayMicroseconds(500); digitalWrite(3,0); delayMicroseconds(500);}
  
}

the motor is set to 4th micro-step , so 800 steps should do a 360 degrees turn .
now the code above works perfectly as it performs a 360deg turn then stops for 5 seconds and so on .
the second delay is 500us or in my real program in needs to be alot longer , if i change the function to delay and have a delay of 20ms , 30ms , 40ms , 100ms etc .. the result becomes almost always incorrect as it never performs a full turn before stopping for 5sec . the bigger the second delay get's the less the motor turns , according to the datasheet this makes no sense .

+there is an other odd thing , after a couple of minutes the motor get's so hot that i wouldn't be able to place my finger on it .

motor : 17hs2408
driver : a4988
power supply to driver : 12V dc 2A
arduino power supply : pc

THANK YOU

For informed help, post a link to the data sheet for the motor and post a hand-drawn sketch of the wiring.

Also tell us the value to which you set the current limit on the A4988 driver.

Most stepper motors are designed to run hot. 60 degrees Celsius is common in industrial applications.