title: How to delay without freezing in Inno Setup
body: <p>Hello I like to know how can I delay a work (or a command) for a specified time in Inno Setup Pascal Script.</p>
  
  <p>The built in <code>Sleep(const Milliseconds: LongInt)</code> freezes all work while sleeping.</p>
  
  <p>And the following function I implemented also makes the <code>WizardForm</code> unresponsive but not freezing like built in <code>Sleep()</code> Function.</p>
  
  <pre class="lang-pascal prettyprint-override"><code>procedure SleepEx(const MilliSeconds: LongInt);
  begin
    ShellExec('Open', 'Timeout.exe', '/T ' + IntToStr(MilliSeconds div 1000), '', SW_HIDE,
              ewWaitUntilTerminated, ErrorCode);
  end;
  </code></pre>
  
  <p>I also read <a href="https://stackoverflow.com/questions/10892452/inno-setup-exec-function-wait-for-a-limited-time" title="Inno Setup Exec&#40;&#41; function Wait for a limited time">this</a>, but can't think how to use it in my function.</p>
  
  <p>I like to know how can I use <code>WaitForSingleObject</code> in this <code>SleepEx</code> function.</p>
  
  <p>Thanks in advance for your help.</p>