daymos / stopWatch

0 stars 0 forks source link

setInterval #5

Open nogainbar opened 8 years ago

nogainbar commented 8 years ago

setInterval() used(rather then for example new Date() fnction), meaning that there will always be a form of imprecision in the count.

daymos commented 8 years ago

This is a design choice rather then an issue. The method now() of the object Date is not very precise either, because it relies on your machine CPU. For max precision use window.performance.now() which is not based on user agent, we were just too lazy I guess :)

g-sam commented 8 years ago

While date.now has error (diagnosed in this), I think it's probably better than setinterval because its error is not cumulative (?)

daymos commented 8 years ago

good point