Hi all:
I have a problem about how to control loop time? When the user input a numeric is three for count loop , it will open 1.mp3 three times by Windows Media Player about every ten seconds. But this code first time loop time is ten seconds, then 2th loop time is about 20seconds, and last time loop time is about 30seconds then it will be closed.

Why is every loop time become long? It should fix about 10 seconds. May I ask everyone what codes something wrong? Who can help me modifying this codes? Thank you for advance.

Code:
numeric = "";
        while (numeric == "") and (numeric ~= "CANCEL") do
             numeric = Dialog.Input("Burn in", "Please enter your numeric for looping :", "", MB_ICONQUESTION);
   
           if numeric ==  "" then
             result = Dialog.Message("Invalid Input", "Please use a numeric value greater than" , MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
   
          elseif numeric ~= "CANCEL" then
            min = 1;        -- The number to start at
               max = numeric;  -- The number to stop at 
                             
              for count = min, max  do
                   
                       Quotes = '"'
                       Song = Quotes.._SourceFolder.."\\AutoPlay\\Audio\\1.mp3"..Quotes
                       File.Run("C:\\Program Files\\Windows Media Player\\wmplayer.exe", ""..Song, "", SW_SHOWNORMAL, false);
                       
                       TextFile.WriteFromString("C:\\Test.log", System.GetDate(DATE_FMT_US).."__Start time:"..System.GetTime(TIME_FMT_AMPM).."__".."Multi_Media_Audio" .. "\r\n", true);
                       for i=1, 20 do                   
                             for j=1 ,10 do 
                             end 
                       end                       
TextFile.WriteFromString("C:\\Test.log", System.GetDate(DATE_FMT_US).."__End   time:"..System.GetTime(TIME_FMT_AMPM).."__".."Multi_Media_Audio" .. "\r\n", true);
               end    
            end
         end    
  
   windows = Window.EnumerateTitles() 
 tblwindow_name = {"Windows Media Player", "Real", "WinAmp"}; 
     for index, window_name in tblwindow_name do

      for handle, title in windows do 
            result = String.Find(title, window_name, 1, false); 

          if (result ~= -1) then 
            Window.Close(handle, CLOSEWND_TERMINATE); 
          end 
       end
      end

Page.StopTimer ();
Window.Restore(handle);