Question: I have task, that I'm unsure on how i should approach.

there's a list of doubles, and i need to group them together to add up to a specific value.

Say i have:
14.6666666666666,
14.6666666666666,
2.37499999999999,
1.04166666666665,
1.20833333333334,
1.20833333333334,
13.9583333333333,
1.20833333333334,
3.41666666666714,
3.41666666666714,
1.20833333333334,
1.20833333333334,
14.5416666666666,
1.20833333333335,
1.04166666666666,

And i would like to group into set values such as 12,14,16 

I would like to take the highest value in the list then group it with short ones to equal the closest value above.

example:
take double 14.6666666666666, and group it with 1.20833333333334 to bring me close to 16, and if there are anymore small doubles left in the list, group them with that as well.

Then move on to the next double in the list..

Answer: 
It will NEVER show no matter how fast your machine is. Javascript will run to completion blocking the UI until its done.

Try this

HTML

```
<div id='d'></div>

```

JS

```
var d = document.getElementById('d');
var p = document.createElement('p');

p.innerText = "One";
d.appendChild(p);

for (i = 0; i < 1000000; i++) {
  for (z = 0; z < 10; z++){
    // this is nonsense that runs for a sec or two to block the JS thread
    // please never do this in production
  }
}

p.innerText = "Two"

```

will pause your browser and then show `Two` ... never `One`
Obviously appearance of elements depends on the power of CPU, browser algorithms, graphic card render time, monitor frequency and many other factors. However The programs (e.g JavaScript) may continue the actions by considering virtual elements without errors.

On the other hand the browser algorithm may decide to render the code line by line or not. As an experience if you run a heavy loop to append items to the body, the Opera browser displays the items one by one however the Chrome will render the page at the end of loop. However if you do the loop using the JavaScript **setTimeout**, in all browsers you will see the elements appearing one by one.