You mean, some milliseconds are more accurate than others? As in, they are precisely 1.0ms long each, rather than just roughly 1ms?
Now, assuming there is a high-accuracy kind of milliseconds, do you really care whether a so-called benchmark finishes in 2ms or 2.0ms? When there's easily a 25% chance that running the same test again will take either 1ms or 3ms?
SunSpider is beyond saving. Trying to make its results look more trustworthy is futile.
That said, here's a "run" function that returns the number of milliseconds it took to run a file:
function run(file) {
var start = Date.now();
load(file);
return Date.now() - start;
}
I don't see any reason why doing this with C++ in the shell would have different accuracy (in either direction). You could argue for a way to get timestamps that are precise to the microsecond, but then again, any benchmark that deserves the name runs long enough that millisecond precision is entirely sufficient, so what would be the point?