When is it my turn? - RPG Turn Order question

your setup is there, you have an array of units sorted by speed.

when one unit ends turn get the next one and start turn. this creates a loop of actions.

you can monitor ‘rounds’ by when you get to the last index if you want to.

there are also a few tutorials on Turn Based RPGs on youtube