vendredi 21 septembre 2018

What is the difference between Math.round and Math.random and which one is better

Hello i would like to know the differences between :

Math.round(Math.random() * (900000 - 600000)) + 600000;

and

Math.random() * (900000 - 600000) + 600000; 

In my case i would like to get a random number between 600000 ms and 900000 ms.

Can you please tell me which way is the best ?

Best regards




Aucun commentaire:

Enregistrer un commentaire