I want my script to repeat several times, how to implement that

See Multithreading article