title: How to determine Big-o complexity if it only depends on values of input rather than input size?
body: <p>I just saw javascript code about sorting which uses <code>setTimeout</code> as shown </p>
  
  <pre><code>var list = [2,  5, 10, 4, 8, 32]; 
  var result = [];
  list.forEach( n =&gt; setTimeout(() =&gt; result.push(n), n));
  </code></pre>
  
  <p>It is interesting because in js <code>setTimeout</code> is asynchronous so if you wait for sufficient time, <code>result</code> will be sorted array. It is deterministic depends on only values of data but not the size of the input so I have no idea how to determine Big-O (time complexity) of this approach.</p>