3 ms·
The problem is that the JS engines in browsers rely on not-so-sophisticated APIs to get to their millisecond values. This means that yes, you do get time in mil
by pilif 15y ago
The problem is that the JS engines in browsers rely on not-so-sophisticated APIs to get to their millisecond values. This means that yes, you do get time in milliseconds, but the value is only updated every 40 to 100 ms
- AshleysBrain 15y agoI think some browsers on Windows are using QueryPerformanceCounter for timing, which has microsecond precision.
- yid 15y agoPerhaps not on modern on browsers. In Chromium on Linux, typing this in the dev console: x=new Date().getTime(); for(j=0;j<10000;j++); y=new Date().getTime(); for(j=0;j<10000;j++); z=new Date().getTime(); alert(x+' '+y+' '+z) gives me high resolution timestamps: 1311577733069 1311577733083 1311577733099