I need a unique number to be generated to be used in my code.I use
var id = new Date().valueOf()
I know the above returns the number of mi
On Windows the resolution of the timer is about 10.5 ms. So you have chances of getting the same value even few milliseconds later. There are better timers of course, but AFAIK they are not available to JavaScript.